'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.
Operations
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 non-token type |
Results:
| Result | Description |
|---|---|
result | A type that represents any valid OM type. |
om.basepath_create (::circt::om::BasePathCreateOp)
Produce a base path value
Syntax:
operation ::= `om.basepath_create` $basePath $target attr-dict
Produces a value which represents a fragment of a hierarchical path to a target. Given a base path, extend it with the name of a module instance, to produce a new base path. The instance is identified via an NLA. Once the final verilog name of the instance is known, this op can be converted into a FrozenBasePathOp.
Example:
hw.module @Foo() -> () {
hw.inst "bar" sym @bar @Bar() -> ()
}
hw.hierpath @Path [@Foo::@bar]
om.class @OM(%basepath: !om.basepath) {
%0 = om.basepath_create %base @Path
}
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface), SymbolUserOpInterface
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
target | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Operands:
| Operand | Description |
|---|---|
basePath | A fragment of a path to a hardware component |
Results:
| Result | Description |
|---|---|
result | A fragment of a path to a hardware component |
om.class (::circt::om::ClassOp)
An object model class definition
An OM class defines a named object template with formal parameters and
named, typed fields. Its body computes the field values from the parameters
and terminates with om.class.fields. An om.object instantiates the class
with actual parameters.
Classes marked linkonce_odr must be public. All same-named definitions
must also be marked and equivalent, including their referenced symbols.
When such a class is instantiated, one of its definitions is
non-deterministically chosen. Non-equivalent definitions violate the ODR
contract and may result in errors. The linker coalesces the definitions
without comparing them.
Traits: IsolatedFromAbove, SingleBlockImplicitTerminator<ClassFieldsOp>, SingleBlock, SymbolName, SymbolVisibility
Interfaces: ClassLike, OpAsmOpInterface, RegionKindInterface, Symbol
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
sym_visibility | ::mlir::StringAttr | string attribute |
formalParamNames | ::mlir::ArrayAttr | string array attribute |
fieldNames | ::mlir::ArrayAttr | array attribute |
fieldTypes | ::mlir::DictionaryAttr | dictionary of named attribute values |
linkonce_odr | ::mlir::UnitAttr | unit attribute |
om.class.extern (::circt::om::ClassExternOp)
Traits: IsolatedFromAbove, NoTerminator, SymbolName, SymbolVisibility
Interfaces: ClassLike, OpAsmOpInterface, RegionKindInterface, Symbol
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
sym_name | ::mlir::StringAttr | string attribute |
sym_visibility | ::mlir::StringAttr | string attribute |
formalParamNames | ::mlir::ArrayAttr | string array attribute |
fieldNames | ::mlir::ArrayAttr | array attribute |
fieldTypes | ::mlir::DictionaryAttr | dictionary of named attribute values |
om.class.fields (::circt::om::ClassFieldsOp)
Syntax:
operation ::= `om.class.fields` attr-dict ($fields^ `:` qualified(type($fields)))?
custom<FieldLocs>($field_locs)
Traits: AlwaysSpeculatableImplTrait, HasParent<ClassOp>, ReturnLike, Terminator
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), RegionBranchTerminatorOpInterface
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
field_locs | ::mlir::ArrayAttr | location array attribute |
Operands:
| Operand | Description |
|---|---|
fields | variadic of any non-token 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 non-token type |
om.elaborated_object (::circt::om::ElaboratedObjectOp)
Object value with explicit field operands
Syntax:
operation ::= `om.elaborated_object` $className `(` $fieldValues `)` attr-dict `:`
functional-type($fieldValues, $result)
om.elaborated_object denotes an object value whose fields are given
explicitly as operands. The operands correspond to the referenced class
fields in their declared order.
This operation is for internal use only and is not intended to be created by frontends. It is generated by optimization and elaboration passes.
Interfaces: SymbolUserOpInterface
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
className | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Operands:
| Operand | Description |
|---|---|
fieldValues | variadic of any non-token type |
Results:
| Result | Description |
|---|---|
result | A type that represents a reference to a Class. |
om.frozenbasepath_create (::circt::om::FrozenBasePathCreateOp)
Produce a frozen base path value
Syntax:
operation ::= `om.frozenbasepath_create` $basePath custom<BasePathString>($path) attr-dict
Produces a value which represents a fragment of a hierarchical path to a target.
Example:
om.class @OM(%basepath: !om.basepath)
%0 = om.frozenbasepath_create %basepath "Foo/bar:Bar/baz"
}
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
path | ::circt::om::PathAttr | An attribute that represents an instance path |
Operands:
| Operand | Description |
|---|---|
basePath | A frozen fragment of a path to a hardware component |
Results:
| Result | Description |
|---|---|
result | A frozen fragment of a path to a hardware component |
om.frozenpath_create (::circt::om::FrozenPathCreateOp)
Produce a frozen path value
Syntax:
operation ::= `om.frozenpath_create` $targetKind $basePath custom<PathString>($path, $module, $ref, $field)
attr-dict
Produces a value which represents a hierarchical path to a hardware component from a base path to a target.
Example:
om.class @OM(%basepath: !om.basepath)
%0 = om.frozenpath_create reference %base "Foo/bar:Bar>w.a"
}
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
targetKind | ::circt::om::TargetKindAttr | object model target kind |
path | ::circt::om::PathAttr | An attribute that represents an instance path |
module | ::mlir::StringAttr | string attribute |
ref | ::mlir::StringAttr | string attribute |
field | ::mlir::StringAttr | string attribute |
Operands:
| Operand | Description |
|---|---|
basePath | A frozen fragment of a path to a hardware component |
Results:
| Result | Description |
|---|---|
result | A frozen path to a hardware component |
om.frozenpath_empty (::circt::om::FrozenEmptyPathOp)
Produce a frozen path value to nothing
Syntax:
operation ::= `om.frozenpath_empty` attr-dict
Produces a value which represents a hierarchical path to nothing.
Example:
om.class @OM()
%0 = om.frozenpath_empty
}
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Results:
| Result | Description |
|---|---|
result | A frozen path to a hardware component |
om.integer.add (::circt::om::IntegerAddOp)
Add two OMIntegerType values
Syntax:
operation ::= `om.integer.add` $lhs `,` $rhs attr-dict `:` type($result)
Perform arbitrary precision signed integer addition of two OMIntegerType values.
Example:
%2 = om.integer.add %0, %1 : !om.integer
Traits: AlwaysSpeculatableImplTrait, Commutative
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
lhs | A type that represents an arbitrary width integer. |
rhs | A type that represents an arbitrary width integer. |
Results:
| Result | Description |
|---|---|
result | A type that represents an arbitrary width integer. |
om.integer.and (::circt::om::IntegerAndOp)
Bitwise AND of two integer OM values
Syntax:
operation ::= `om.integer.and` $lhs `,` $rhs attr-dict `:` type($result)
Compute the bitwise AND of two integer OM values of the same width, returning an integer result of the same width.
Example:
%2 = om.integer.and %0, %1 : i1
%3 = om.integer.and %4, %5 : i8
Traits: AlwaysSpeculatableImplTrait, Commutative, SameOperandsAndResultType
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
lhs | integer |
rhs | integer |
Results:
| Result | Description |
|---|---|
result | integer |
om.integer.bitand (::circt::om::IntegerBitAndOp)
Compute the bitwise AND of two OMIntegerType values
Syntax:
operation ::= `om.integer.bitand` $lhs `,` $rhs attr-dict `:` type($result)
Perform arbitrary precision signed integer bitwise AND of two OMIntegerType values.
Example:
%2 = om.integer.bitand %0, %1 : !om.integer
Traits: AlwaysSpeculatableImplTrait, Commutative
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
lhs | A type that represents an arbitrary width integer. |
rhs | A type that represents an arbitrary width integer. |
Results:
| Result | Description |
|---|---|
result | A type that represents an arbitrary width integer. |
om.integer.bitnot (::circt::om::IntegerBitNotOp)
Compute the bitwise NOT of an OMIntegerType value
Syntax:
operation ::= `om.integer.bitnot` $input attr-dict `:` type($result)
Perform arbitrary precision signed integer bitwise NOT of an OMIntegerType value.
Example:
%1 = om.integer.bitnot %0 : !om.integer
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
input | A type that represents an arbitrary width integer. |
Results:
| Result | Description |
|---|---|
result | A type that represents an arbitrary width integer. |
om.integer.bitor (::circt::om::IntegerBitOrOp)
Compute the bitwise OR of two OMIntegerType values
Syntax:
operation ::= `om.integer.bitor` $lhs `,` $rhs attr-dict `:` type($result)
Perform arbitrary precision signed integer bitwise OR of two OMIntegerType values.
Example:
%2 = om.integer.bitor %0, %1 : !om.integer
Traits: AlwaysSpeculatableImplTrait, Commutative
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
lhs | A type that represents an arbitrary width integer. |
rhs | A type that represents an arbitrary width integer. |
Results:
| Result | Description |
|---|---|
result | A type that represents an arbitrary width integer. |
om.integer.mul (::circt::om::IntegerMulOp)
Multiply two OMIntegerType values
Syntax:
operation ::= `om.integer.mul` $lhs `,` $rhs attr-dict `:` type($result)
Perform arbitrary prevision signed integer multiplication of two OMIntegerType values.
Example:
%2 = om.integer.mul %0, %1 : !om.integer
Traits: AlwaysSpeculatableImplTrait, Commutative
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
lhs | A type that represents an arbitrary width integer. |
rhs | A type that represents an arbitrary width integer. |
Results:
| Result | Description |
|---|---|
result | A type that represents an arbitrary width integer. |
om.integer.or (::circt::om::IntegerOrOp)
Bitwise OR of two integer OM values
Syntax:
operation ::= `om.integer.or` $lhs `,` $rhs attr-dict `:` type($result)
Compute the bitwise OR of two integer OM values of the same width, returning an integer result of the same width.
Example:
%2 = om.integer.or %0, %1 : i1
%3 = om.integer.or %4, %5 : i8
Traits: AlwaysSpeculatableImplTrait, Commutative, SameOperandsAndResultType
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
lhs | integer |
rhs | integer |
Results:
| Result | Description |
|---|---|
result | integer |
om.integer.shl (::circt::om::IntegerShlOp)
Shift an OMIntegerType value left by an OMIntegerType value
Syntax:
operation ::= `om.integer.shl` $lhs `,` $rhs attr-dict `:` type($result)
Perform arbitrary precision signed integer arithmetic shift left of the lhs OMIntegerType value by the rhs OMIntegerType value. The rhs value must be non-negative.
Example:
%2 = om.integer.shl %0, %1 : !om.integer
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
lhs | A type that represents an arbitrary width integer. |
rhs | A type that represents an arbitrary width integer. |
Results:
| Result | Description |
|---|---|
result | A type that represents an arbitrary width integer. |
om.integer.shr (::circt::om::IntegerShrOp)
Shift an OMIntegerType value right by an OMIntegerType value
Syntax:
operation ::= `om.integer.shr` $lhs `,` $rhs attr-dict `:` type($result)
Perform arbitrary precision signed integer arithmetic shift right of the lhs OMIntegerType value by the rhs OMIntegerType value. The rhs value must be non-negative.
Example:
%2 = om.integer.shr %0, %1 : !om.integer
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
lhs | A type that represents an arbitrary width integer. |
rhs | A type that represents an arbitrary width integer. |
Results:
| Result | Description |
|---|---|
result | A type that represents an arbitrary width integer. |
om.integer.xor (::circt::om::IntegerXorOp)
Bitwise XOR of two integer OM values
Syntax:
operation ::= `om.integer.xor` $lhs `,` $rhs attr-dict `:` type($result)
Compute the bitwise XOR of two integer OM values of the same width, returning an integer result of the same width. NOT can be expressed as `xor(a, all-ones)`.
Example:
%2 = om.integer.xor %0, %1 : i1
%3 = om.integer.xor %4, %5 : i8
Traits: AlwaysSpeculatableImplTrait, Commutative, SameOperandsAndResultType
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
lhs | integer |
rhs | integer |
Results:
| Result | Description |
|---|---|
result | integer |
om.list_concat (::circt::om::ListConcatOp)
Concatenate multiple lists to produce a new list
Syntax:
operation ::= `om.list_concat` $subLists attr-dict `:` type($result)
Produces a value of list type by concatenating the provided lists.
Example:
%3 = om.list_concat %0, %1, %2 : !om.list<string>
Traits: AlwaysSpeculatableImplTrait, SameOperandsAndResultType
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
subLists | variadic of A type that represents a list. |
Results:
| Result | Description |
|---|---|
result | A type that represents a list. |
om.list_contains (::circt::om::ListContainsOp)
Check if a list contains a value
Syntax:
operation ::= `om.list_contains` $list `,` $element attr-dict `:` type($list)
Returns 1 if the list contains an element equal to the search value, and 0
otherwise, using the equality semantics of om.prop.eq.
The search value and list element must have exactly the same type.
Example:
%found = om.list_contains %objects, %obj : !om.list<!om.class.type<@Foo>>
%refFound = om.list_contains %refs, %ref : !om.list<!om.any>
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
list | A type that represents a list. |
element | A type that represents a string. or A type that represents an arbitrary width integer. or 1-bit signless integer or A type that represents a reference to a Class. or A type that represents any valid OM type. |
Results:
| Result | Description |
|---|---|
result | 1-bit signless integer |
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 | variadic of any non-token type |
Results:
| Result | Description |
|---|---|
result | A type that represents a list. |
om.list_length (::circt::om::ListLengthOp)
Get the length of a list
Syntax:
operation ::= `om.list_length` $list attr-dict `:` type($list)
Returns the number of elements in the list as an !om.integer. The list
element type is unrestricted.
Example:
%length = om.list_length %list : !om.list<!om.string>
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
list | A type that represents a list. |
Results:
| Result | Description |
|---|---|
result | A type that represents an arbitrary width integer. |
om.object (::circt::om::ObjectOp)
Syntax:
operation ::= `om.object` $className `(` $actualParams `)` attr-dict `:`
functional-type($actualParams, $result)
Interfaces: SymbolUserOpInterface
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
className | ::mlir::FlatSymbolRefAttr | flat symbol reference attribute |
Operands:
| Operand | Description |
|---|---|
actualParams | variadic of any non-token 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 `[` $field `]` attr-dict `:` functional-type($object, $result)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), SymbolUserOpInterface
Effects: MemoryEffects::Effect{}
Attributes:
| Attribute | MLIR Type | Description |
|---|---|---|
field | ::mlir::StringAttr | string attribute |
Operands:
| Operand | Description |
|---|---|
object | A type that represents a reference to a Class. |
Results:
| Result | Description |
|---|---|
result | any non-token type |
om.option_create (::circt::om::OptionCreateOp)
Create an optional value
Syntax:
operation ::= `om.option_create` ($value^)? attr-dict `:` type($result)
Creates an empty option or an option containing the given value. The option type is explicit, and the value type is inferred from its element type. An unknown value makes the entire option unknown.
Example:
%none = om.option_create : !om.option<!om.integer>
%some = om.option_create %value : !om.option<!om.integer>
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
value | any non-token type |
Results:
| Result | Description |
|---|---|
result | A type that represents an optional value. |
om.option_get_or_else (::circt::om::OptionGetOrElseOp)
Get an optional value or a default
Syntax:
operation ::= `om.option_get_or_else` $option `,` $defaultValue attr-dict `:` type($option)
Returns the value contained in the option if it is not empty, and the default value otherwise. The default value and result types are inferred from the option’s element type.
Example:
%value = om.option_get_or_else %option, %default : !om.option<!om.integer>
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
option | A type that represents an optional value. |
defaultValue | any non-token type |
Results:
| Result | Description |
|---|---|
result | any non-token type |
om.path_create (::circt::om::PathCreateOp)
Produce a path value
Syntax:
operation ::= `om.path_create` $targetKind $basePath $target attr-dict
Produces a value which represents a hierarchical path to a hardware target. from a base path to a target.
Example:
hw.module @Foo() -> () {
%wire = hw.wire sym @w: !i1
}
hw.hierpath @Path [@Foo::@w]
om.class @OM(%basepath: !om.basepath)
%0 = om.path_create reference %basepath @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 |
Operands:
| Operand | Description |
|---|---|
basePath | A fragment of a path to a hardware component |
Results:
| Result | Description |
|---|---|
result | A path to a hardware component |
om.path_empty (::circt::om::EmptyPathOp)
Produce a path value to nothing
Syntax:
operation ::= `om.path_empty` attr-dict
Produces a value which represents a hierarchical path to nothing.
Example:
om.class @OM()
%0 = om.path_empty
}
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Results:
| Result | Description |
|---|---|
result | A path to a hardware component |
om.prop.eq (::circt::om::PropEqOp)
Compare two OM property values for equality
Syntax:
operation ::= `om.prop.eq` $lhs `,` $rhs attr-dict `:` type($lhs)
Compare two OM property values (String, Integer, Bool, Class, or Any) for equality, returning a 1-bit integer (i1) result. Returns 1 if the values are equal, 0 otherwise. Both operands must have exactly the same type.
Strings, integers, and booleans are compared by value. Class and any values
are compared by object identity, not by structural equality of object
fields. Operands of type !om.any must contain object references. The
om.any_cast operation preserves object identity. Comparing the same
reference SSA value with itself returns 1, even if the value is unknown.
Otherwise, comparisons involving unknown values remain unknown.
Example:
%2 = om.prop.eq %0, %1 : !om.string
%3 = om.prop.eq %4, %5 : !om.integer
%6 = om.prop.eq %7, %8 : i1
%9 = om.prop.eq %lhs, %rhs : !om.class.type<@Foo>
%10 = om.prop.eq %lhsAny, %rhsAny : !om.any
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
lhs | A type that represents a string. or A type that represents an arbitrary width integer. or 1-bit signless integer or A type that represents a reference to a Class. or A type that represents any valid OM type. |
rhs | A type that represents a string. or A type that represents an arbitrary width integer. or 1-bit signless integer or A type that represents a reference to a Class. or A type that represents any valid OM type. |
Results:
| Result | Description |
|---|---|
result | 1-bit signless integer |
om.property_assert (::circt::om::PropertyAssertOp)
Assert that a boolean property holds at evaluation time
Syntax:
operation ::= `om.property_assert` $condition `,` $message attr-dict `:` type($condition)
Asserts that $condition (a 1-bit integer) is non-zero when evaluated by
the OM evaluator. If the evaluator resolves the condition to zero,
evaluation fails with $message.
Example:
om.property_assert %cond, %message : i1
Operands:
| Operand | Description |
|---|---|
condition | 1-bit signless integer |
message | A type that represents a string. |
om.registry_create (::circt::om::RegistryCreateOp)
Create a registry with initial elements
Syntax:
operation ::= `om.registry_create` ($elements^)? attr-dict `:` qualified(type($result))
Creates a fresh registry for each object, initially containing the given values. A registry is an unordered, append-only collection shared by reference; it retains duplicate values.
%items = om.registry_create %a, %b : !om.registry<!om.integer>
Traits: HasParent<ClassOp>, SameTypeOperands
Operands:
| Operand | Description |
|---|---|
elements | variadic of any non-token type |
Results:
| Result | Description |
|---|---|
result | An unordered, append-only registry handle. |
om.registry_insert (::circt::om::RegistryInsertOp)
Add an element to a registry
Syntax:
operation ::= `om.registry_insert` $registry `,` $element attr-dict `:` qualified(type($registry))
Traits: HasParent<ClassOp>
Interfaces: MemoryEffectOpInterface (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{MemoryEffects::Write on ::mlir::SideEffects::DefaultResource}
Operands:
| Operand | Description |
|---|---|
registry | An unordered, append-only registry handle. |
element | any non-token type |
om.string.concat (::circt::om::StringConcatOp)
Concatenate multiple string values
Syntax:
operation ::= `om.string.concat` $strings attr-dict `:` type($result)
Perform string concatenation of multiple OM string values.
Example:
%3 = om.string.concat %0, %1, %2 : !om.string
Traits: AlwaysSpeculatableImplTrait, SameOperandsAndResultType
Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Operands:
| Operand | Description |
|---|---|
strings | variadic of A type that represents a string. |
Results:
| Result | Description |
|---|---|
result | A type that represents a string. |
om.unknown (::circt::om::UnknownValueOp)
An operation with an unknown value used to tie-off connections
Syntax:
operation ::= `om.unknown` attr-dict `:` type($result)
An operation that is used to tie-off connections to objects for which we do not care about the value being used.
This is used in situations where a class exists and is instantiated, but the instantiator has no reasonable value that it can or should drive.
Interfaces: SymbolUserOpInterface
Results:
| Result | Description |
|---|---|
result | any non-token type |
Attributes
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 an instance path
Parameters:
| Parameter | C++ type | Description |
|---|---|---|
| path | ::llvm::ArrayRef<::circt::om::PathElement> |
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 |
Types
BasePathType
A fragment of a path to a hardware component
Syntax: !om.basepath
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 |
FrozenBasePathType
A frozen fragment of a path to a hardware component
Syntax: !om.frozenbasepath
FrozenPathType
A frozen path to a hardware component
Syntax: !om.frozenpath
ListType
A type that represents a list.
Syntax:
!om.list<
mlir::Type # elementType
>
Parameters:
| Parameter | C++ type | Description |
|---|---|---|
| elementType | 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
OptionType
A type that represents an optional value.
Syntax:
!om.option<
mlir::Type # elementType
>
An option is either empty or contains one value. The element type is unrestricted.
Parameters:
| Parameter | C++ type | Description |
|---|---|---|
| elementType | mlir::Type |
PathType
A path to a hardware component
Syntax: !om.path
ReferenceType
A type that represents a reference to a hardware entity.
Syntax: !om.ref
RegistryType
An unordered, append-only registry handle.
Syntax:
!om.registry<
mlir::Type # elementType
>
A reference to an unordered, append-only collection of elements.
Parameters:
| Parameter | C++ type | Description |
|---|---|---|
| elementType | mlir::Type |
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
Enums
TargetKind
Object model target kind
Cases:
| Symbol | Value | String |
|---|---|---|
| DontTouch | 0 | dont_touch |
| Instance | 1 | instance |
| MemberInstance | 2 | member_instance |
| MemberReference | 3 | member_reference |
| Reference | 4 | reference |