CIRCT

Circuit IR Compilers and Tools

'emit' Dialect

Types and operations for the emit dialect The emit dialect is intended to model the structure of the emitted RTL.

It organizes the files, file lists, directories and collateral.

Operations

emit.file (::circt::emit::FileOp)

Represents the contents of an emitted file

Syntax:

operation ::= `emit.file` $file_name (`sym` $sym_name^)? $bodyRegion attr-dict

This operation groups a set of nested operations to be emitted to a file.

Other operations (such as file lists)can reference a file to access its filename through an optional symbol.

Traits: IsolatedFromAbove, NoRegionArguments, NoTerminator, SingleBlock

Interfaces: Symbol

Attributes:

AttributeMLIR TypeDescription
file_name::mlir::StringAttrstring attribute
sym_name::mlir::StringAttrstring attribute

emit.file_list (::circt::emit::FileListOp)

Represents a file list

Syntax:

operation ::= `emit.file_list` $file_name `,` $files (`sym` $sym_name^)? attr-dict

This operation emits a file list referencing a set of files.

File lists can be references from other ops (including other file lists) through an optional symbol.

Interfaces: SymbolUserOpInterface, Symbol

Attributes:

AttributeMLIR TypeDescription
file_name::mlir::StringAttrstring attribute
files::mlir::ArrayAttrflat symbol ref array attribute
sym_name::mlir::StringAttrstring attribute

emit.fragment (::circt::emit::FragmentOp)

Emittable fragment which can be replicated before modules

Syntax:

operation ::= `emit.fragment` $sym_name $bodyRegion attr-dict

The fragment operation is a container for other operations that can be emitted before other operations. It carries a symbol that can be referenced by an emit.fragments attribute placed on operations before which the fragments should be inserted.

In single-file mode, each fragment is emitted once. In split file emission mode, fragments precede all operations that reference them, but are still emitted at most once per file.

Traits: HasParent<mlir::ModuleOp>, IsolatedFromAbove, NoRegionArguments, NoTerminator, SingleBlock

Interfaces: Symbol

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute

emit.ref (::circt::emit::RefOp)

Print a referenced SV operation inline into the file

Syntax:

operation ::= `emit.ref` $target attr-dict

The emit.ref operation targets an op via a symbol, emitting its contents into the file it is part of. The set of targetable operations and the emission rules are defined in ExportVerilog.

Traits: HasParent<circt::emit::FileOp>

Interfaces: SymbolUserOpInterface

Attributes:

AttributeMLIR TypeDescription
target::mlir::FlatSymbolRefAttrflat symbol reference attribute

emit.verbatim (::circt::emit::VerbatimOp)

Verbatim opaque text emitted inline.

Syntax:

operation ::= `emit.verbatim` $text attr-dict

This operation produces opaque text inline in the file.

emit.verbatim allows symbol reference substitutions with {{0}} syntax.

Traits: HasParent<circt::emit::FileOp>

Attributes:

AttributeMLIR TypeDescription
text::mlir::StringAttrstring attribute

'emit' Dialect Docs