CIRCT

Circuit IR Compilers and Tools

'om' Dialect

The Object Model dialect captures design intent from various domains in an object model.

For more information about the Object Model dialect, see the Object Model Dialect Rationale.

Operation definition

om.any_cast (::circt::om::AnyCastOp)

Cast any value to any type.

Syntax:

operation ::= `om.any_cast` $input attr-dict `:` functional-type($input, $result)

Casts any value to AnyType. This is useful for situations where a value of AnyType is needed, but a value of some concrete type is known.

In the evaluator, this is a noop, and the value of concrete type is used.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
inputany type

Results:

ResultDescription
resultA type that represents any valid OM type.

om.class (::circt::om::ClassOp)

Traits: NoTerminator, SingleBlock

Interfaces: ClassLike, OpAsmOpInterface, RegionKindInterface, Symbol

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
formalParamNames::mlir::ArrayAttrstring array attribute

om.class.extern (::circt::om::ClassExternOp)

Traits: NoTerminator, SingleBlock

Interfaces: ClassLike, OpAsmOpInterface, RegionKindInterface, Symbol

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
formalParamNames::mlir::ArrayAttrstring array attribute

om.class.extern.field (::circt::om::ClassExternFieldOp)

Syntax:

operation ::= `om.class.extern.field` $sym_name attr-dict `:` $type

Traits: HasParent

Interfaces: ClassFieldLike, Symbol

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
type::mlir::TypeAttrany type attribute

om.class.field (::circt::om::ClassFieldOp)

Syntax:

operation ::= `om.class.field` $sym_name `,` $value  attr-dict `:` type($value)

Traits: HasParent

Interfaces: ClassFieldLike, Symbol

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute

Operands:

OperandDescription
valueany type

om.constant (::circt::om::ConstantOp)

Syntax:

operation ::= `om.constant` $value attr-dict

Traits: AlwaysSpeculatableImplTrait, ConstantLike

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
value::mlir::TypedAttrTypedAttr instance

Results:

ResultDescription
resultany type

om.list_create (::circt::om::ListCreateOp)

Create a list of values

Creates a list from a sequence of inputs.

%list = om.list_create %a, %b, %c : !om.ref

Traits: AlwaysSpeculatableImplTrait, SameTypeOperands

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
inputsany type

Results:

ResultDescription
resultA type that represents a list.

om.map_create (::circt::om::MapCreateOp)

Create a map

Creates a map from a sequence of inputs.

%map = om.map_create %e1, %e2 : !om.string, i8

where %e1 and e2 have !om.tuple<!om.string, i8> and %map has !om.map<!om.string, i8> type.

Traits: AlwaysSpeculatableImplTrait, SameTypeOperands

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
inputsa pair whose first element is an attribute

Results:

ResultDescription
resultA type that represents a map. A key type must be either
an integer or string type

om.object (::circt::om::ObjectOp)

Syntax:

operation ::= `om.object` $className `(` $actualParams `)`  attr-dict `:`
              functional-type($actualParams, $result)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), SymbolUserOpInterface

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
className::mlir::StringAttrstring attribute

Operands:

OperandDescription
actualParamsany type

Results:

ResultDescription
resultA type that represents a reference to a Class.

om.object.field (::circt::om::ObjectFieldOp)

Syntax:

operation ::= `om.object.field` $object `,` $fieldPath attr-dict `:` functional-type($object, $result)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), SymbolUserOpInterface

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
fieldPath::mlir::ArrayAttrflat symbol ref array attribute

Operands:

OperandDescription
objectA type that represents a reference to a Class.

Results:

ResultDescription
resultany type

om.path (::circt::om::PathOp)

Produce a path value

Syntax:

operation ::= `om.path` $targetKind $target attr-dict

Produces a value which represents a hierarchical path to a hardware component.

Example:

hw.module @Foo {
  %wire = hw.wire sym @w: !i1
}
hw.hierpath @Path [@Foo::@w]
%0 = om.path member @Path

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface), SymbolUserOpInterface

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
targetKind::circt::om::TargetKindAttrobject model target kind
target::mlir::FlatSymbolRefAttrflat symbol reference attribute

Results:

ResultDescription
resultA path to a hardware component

om.path_append (::circt::om::PathAppendOp)

Append two path value

Syntax:

operation ::= `om.path_append` $root `,` $path attr-dict

Appends the path to the root path. The root path must not have a component. The appended path must begin where the root path ends.

Example:

%root = om.constant #om.path<"Foo/bar:Bar">
%path = om.constant #om.path<"Bar/baz:Baz>output">
%0 = om.path_append %root, %path

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
rootA path to a hardware component
pathA path to a hardware component

Results:

ResultDescription
resultA path to a hardware component

om.tuple_create (::circt::om::TupleCreateOp)

Create a tuple of values

Syntax:

operation ::= `om.tuple_create` $inputs attr-dict `:` type($inputs)

Create a tuple from a sequence of inputs.

%tuple = om.tuple_create %a, %b, %c : !om.ref, !om.string, !om.list<i32>

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
inputsany type

Results:

ResultDescription
resulttuple with any combination of any type values

om.tuple_get (::circt::om::TupleGetOp)

Extract a value from a tuple

Syntax:

operation ::= `om.tuple_get` $input `[` $index `]` attr-dict `:` type($input)

Extract a value from a tuple.

%value = om.tuple_get %a[0] : tuple<!om.ref, !om.string, !om.list<i32>>

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
index::mlir::IntegerAttr32-bit signless integer attribute

Operands:

OperandDescription
inputtuple with any combination of any type values

Results:

ResultDescription
resultany type

Attribute definition

MapAttr

An attribute that represents a string map

Syntax:

#om.map<
  mlir::Type,   # valueType
  mlir::DictionaryAttr   # elements
>

Parameters:

ParameterC++ typeDescription
valueTypemlir::Type
elementsmlir::DictionaryAttr

IntegerAttr

An attribute that represents an arbitrary integer

Syntax:

#om.integer<
  mlir::IntegerAttr   # value
>

Parameters:

ParameterC++ typeDescription
valuemlir::IntegerAttr

ListAttr

An attribute that represents a list

Syntax:

#om.list<
  mlir::Type,   # elementType
  mlir::ArrayAttr   # elements
>

Parameters:

ParameterC++ typeDescription
elementTypemlir::Type
elementsmlir::ArrayAttr

PathAttr

An attribute that represents a path

Syntax:

#om.path<
  ::mlir::StringAttr   # path
>

Parameters:

ParameterC++ typeDescription
path::mlir::StringAttr

SymbolRefAttr

An attribute that wraps a FlatSymbolRefAttr type

Syntax:

#om.sym_ref<
  mlir::FlatSymbolRefAttr   # ref
>

Parameters:

ParameterC++ typeDescription
refmlir::FlatSymbolRefAttr

ReferenceAttr

An attribute that wraps a #hw.innerNameRef with !om.ref type

Syntax:

#om.ref<
  circt::hw::InnerRefAttr   # innerRef
>

Parameters:

ParameterC++ typeDescription
innerRefcirct::hw::InnerRefAttr

Type definition

ClassType

A type that represents a reference to a Class.

Syntax:

!om.class.type<
  mlir::FlatSymbolRefAttr   # className
>

Parameters:

ParameterC++ typeDescription
classNamemlir::FlatSymbolRefAttr

EnumType

An enum type

Parameters:

ParameterC++ typeDescription
elements::llvm::ArrayRef<::circt::om::EnumType::EnumElement>enum fields

ListType

A type that represents a list.

Syntax:

!om.list<
  mlir::Type   # elementType
>

Parameters:

ParameterC++ typeDescription
elementTypemlir::Type

MapType

A type that represents a map. A key type must be either an integer or string type

Syntax:

!om.map<
  mlir::Type,   # keyType
  mlir::Type   # valueType
>

Parameters:

ParameterC++ typeDescription
keyTypemlir::Type
valueTypemlir::Type

AnyType

A type that represents any valid OM type.

Syntax: !om.any

OMIntegerType

A type that represents an arbitrary width integer.

Syntax: !om.integer

PathType

A path to a hardware component

Syntax: !om.path

ReferenceType

A type that represents a reference to a hardware entity.

Syntax: !om.ref

StringType

A type that represents a string.

Syntax: !om.string

SymbolRefType

A type that represents a reference to a flat symbol reference.

Syntax: !om.sym_ref

'om' Dialect Docs