'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:
Operand | Description |
---|---|
input | any type |
Results:
Result | Description |
---|---|
result | A type that represents any valid OM type. |
om.class
(::circt::om::ClassOp)
Traits: NoTerminator, SingleBlock
Interfaces: ClassLike, OpAsmOpInterface, RegionKindInterface, Symbol
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
formalParamNames | ::mlir::ArrayAttr | string array attribute |
om.class.extern
(::circt::om::ClassExternOp)
Traits: NoTerminator, SingleBlock
Interfaces: ClassLike, OpAsmOpInterface, RegionKindInterface, Symbol
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
formalParamNames | ::mlir::ArrayAttr | string 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:
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
type | ::mlir::TypeAttr | any 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:
Attribute | MLIR Type | Description |
---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
Operands:
Operand | Description |
---|---|
value | any 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:
Attribute | MLIR Type | Description |
---|---|---|
value | ::mlir::TypedAttr | TypedAttr instance |
Results:
Result | Description |
---|---|
result | any 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:
Operand | Description |
---|---|
inputs | any type |
Results:
Result | Description |
---|---|
result | A 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:
Operand | Description |
---|---|
inputs | a pair whose first element is an attribute |
Results:
Result | Description |
---|---|
result | A 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:
Attribute | MLIR Type | Description |
---|---|---|
className | ::mlir::StringAttr | string attribute |
Operands:
Operand | Description |
---|---|
actualParams | any type |
Results:
Result | Description |
---|---|
result | A 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:
Attribute | MLIR Type | Description |
---|---|---|
fieldPath | ::mlir::ArrayAttr | flat symbol ref array attribute |
Operands:
Operand | Description |
---|---|
object | A type that represents a reference to a Class. |
Results:
Result | Description |
---|---|
result | any 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:
Attribute | MLIR Type | Description |
---|---|---|
targetKind | ::circt::om::TargetKindAttr | object model target kind |
target | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Results:
Result | Description |
---|---|
result | A 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:
Operand | Description |
---|---|
root | A path to a hardware component |
path | A path to a hardware component |
Results:
Result | Description |
---|---|
result | A 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:
Operand | Description |
---|---|
inputs | any type |
Results:
Result | Description |
---|---|
result | tuple 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:
Attribute | MLIR Type | Description |
---|---|---|
index | ::mlir::IntegerAttr | 32-bit signless integer attribute |
Operands:
Operand | Description |
---|---|
input | tuple with any combination of any type values |
Results:
Result | Description |
---|---|
result | any type |
Attribute definition
MapAttr
An attribute that represents a string map
Syntax:
#om.map<
mlir::Type, # valueType
mlir::DictionaryAttr # elements
>
Parameters:
Parameter | C++ type | Description |
---|---|---|
valueType | mlir::Type | |
elements | mlir::DictionaryAttr |
IntegerAttr
An attribute that represents an arbitrary integer
Syntax:
#om.integer<
mlir::IntegerAttr # value
>
Parameters:
Parameter | C++ type | Description |
---|---|---|
value | mlir::IntegerAttr |
ListAttr
An attribute that represents a list
Syntax:
#om.list<
mlir::Type, # elementType
mlir::ArrayAttr # elements
>
Parameters:
Parameter | C++ type | Description |
---|---|---|
elementType | mlir::Type | |
elements | mlir::ArrayAttr |
PathAttr
An attribute that represents a path
Syntax:
#om.path<
::mlir::StringAttr # path
>
Parameters:
Parameter | C++ type | Description |
---|---|---|
path | ::mlir::StringAttr |
SymbolRefAttr
An attribute that wraps a FlatSymbolRefAttr type
Syntax:
#om.sym_ref<
mlir::FlatSymbolRefAttr # ref
>
Parameters:
Parameter | C++ type | Description |
---|---|---|
ref | mlir::FlatSymbolRefAttr |
ReferenceAttr
An attribute that wraps a #hw.innerNameRef with !om.ref type
Syntax:
#om.ref<
circt::hw::InnerRefAttr # innerRef
>
Parameters:
Parameter | C++ type | Description |
---|---|---|
innerRef | circt::hw::InnerRefAttr |
Type definition
ClassType
A type that represents a reference to a Class.
Syntax:
!om.class.type<
mlir::FlatSymbolRefAttr # className
>
Parameters:
Parameter | C++ type | Description |
---|---|---|
className | mlir::FlatSymbolRefAttr |
EnumType
An enum type
Parameters:
Parameter | C++ type | Description |
---|---|---|
elements | ::llvm::ArrayRef<::circt::om::EnumType::EnumElement> | enum fields |
ListType
A type that represents a list.
Syntax:
!om.list<
mlir::Type # elementType
>
Parameters:
Parameter | C++ type | Description |
---|---|---|
elementType | mlir::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:
Parameter | C++ type | Description |
---|---|---|
keyType | mlir::Type | |
valueType | mlir::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