CIRCT

Circuit IR Compilers and Tools

'ibis' Dialect

Types and operations for Ibis dialect The ibis dialect is intended to support porting and eventual open sourcing of an internal hardware development language.

Operation definition

ibis.call (::circt::ibis::CallOp)

Ibis method call

Syntax:

operation ::= `ibis.call` $callee `(` $operands `)` attr-dict `:` functional-type($operands, results)

Dispatch a call to an Ibis method.

Interfaces: CallOpInterface

Attributes:

AttributeMLIR TypeDescription
callee::mlir::SymbolRefAttrsymbol reference attribute

Operands:

OperandDescription
operandsany type

Results:

ResultDescription
«unnamed»any type

ibis.class (::circt::ibis::ClassOp)

Ibis class

Syntax:

operation ::= `ibis.class` $sym_name attr-dict-with-keyword $body

Ibis has the notion of a class which can contain methods and member variables.

In the low-level Ibis representation, the ClassOp becomes a container for ibis.ports, ibis.containers, and contain logic for member variables.

Traits: HasParent mlir::ModuleOp, IsolatedFromAbove, NoTerminator, SingleBlock, SymbolTable

Interfaces: InstanceGraphModuleOpInterface, RegionKindInterface, ScopeOpInterface, Symbol

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute

ibis.container (::circt::ibis::ContainerOp)

Ibis container

Syntax:

operation ::= `ibis.container` $sym_name attr-dict-with-keyword $body

An ibis container describes a collection of logic nested within an Ibis class.

Traits: IsolatedFromAbove, NoRegionArguments, NoTerminator, SingleBlock, SymbolTable

Interfaces: InstanceGraphModuleOpInterface, RegionKindInterface, ScopeOpInterface, Symbol

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute

ibis.container.instance (::circt::ibis::ContainerInstanceOp)

Ibis container instance

Syntax:

operation ::= `ibis.container.instance` $sym_name `,` $targetName attr-dict
              custom<ScopeRefFromName>(type($scopeRef), ref($targetName))

Instantiates an Ibis container.

Interfaces: HasCustomSSAName, InstanceGraphInstanceOpInterface, Symbol, SymbolUserOpInterface

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
targetName::mlir::FlatSymbolRefAttrflat symbol reference attribute

Results:

ResultDescription
scopeRef

ibis.get_port (::circt::ibis::GetPortOp)

Ibis get port

Syntax:

operation ::= `ibis.get_port` $instance `,` $portSymbol `:` qualified(type($instance)) `->`
              qualified(type($port)) attr-dict

Given an Ibis class reference, returns a port of said class. The port is specified by the symbol name of the port in the referenced class.

Importantly, the user must specify how they intend to use the op, by specifying the direction of the portref type that this op is generated with. If the request port is to be read from, the type must be !ibis.portref<out T> and if the port is to be written to, the type must be !ibis.portref<in T>. This is to ensure that the usage is reflected in the get_port type which in turn is used by the tunneling passes to create the proper ports through the hierarchy.

This implies that the portref direction of the get_port op is independent of the actual direction of the target port, and only the inner portref type must match.

Traits: AlwaysSpeculatableImplTrait

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

Effects: MemoryEffects::Effect{}

Attributes:

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

Operands:

OperandDescription
instance

Results:

ResultDescription
port

ibis.get_var (::circt::ibis::GetVarOp)

Dereferences an ibis member variable through a scoperef

Syntax:

operation ::= `ibis.get_var` $instance `,` $varName attr-dict `:` qualified(type($instance)) `->` qualified(type($var))

Interfaces: HasCustomSSAName, SymbolUserOpInterface

Attributes:

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

Operands:

OperandDescription
instance

Results:

ResultDescription
varmemref of any type values

ibis.instance (::circt::ibis::InstanceOp)

Ibis class instance

Syntax:

operation ::= `ibis.instance` $sym_name `,` $targetName attr-dict
              custom<ScopeRefFromName>(type($scopeRef), ref($targetName))

Instantiates an Ibis class.

Interfaces: HasCustomSSAName, InstanceGraphInstanceOpInterface, Symbol, SymbolUserOpInterface

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
targetName::mlir::FlatSymbolRefAttrflat symbol reference attribute

Results:

ResultDescription
scopeRef

ibis.method (::circt::ibis::MethodOp)

Ibis method

Ibis methods are a lot like software functions: a list of named arguments and unnamed return values with imperative control flow.

Traits: AutomaticAllocationScope, HasParent, IsolatedFromAbove

Interfaces: CallableOpInterface, FunctionOpInterface, OpAsmOpInterface, Symbol

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
function_type::mlir::TypeAttrtype attribute of function type
argNames::mlir::ArrayAttrarray attribute
arg_attrs::mlir::ArrayAttrArray of dictionary attributes
res_attrs::mlir::ArrayAttrArray of dictionary attributes

ibis.method.df (::circt::ibis::DataflowMethodOp)

Ibis dataflow method

Ibis dataflow methods share the same interface as an ibis.method but without imperative CFG-based control flow. Instead, this method implements a graph region, and control flow is expected to be defined by dataflow operations.

Traits: HasParent, IsolatedFromAbove, SingleBlock, SingleBlockImplicitTerminator ibis::ReturnOp

Interfaces: CallableOpInterface, FineGrainedDataflowRegionOpInterface, FunctionOpInterface, RegionKindInterface, Symbol

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
function_type::mlir::TypeAttrtype attribute of function type
argNames::mlir::ArrayAttrarray attribute
arg_attrs::mlir::ArrayAttrArray of dictionary attributes
res_attrs::mlir::ArrayAttrArray of dictionary attributes

ibis.path (::circt::ibis::PathOp)

Ibis path

Syntax:

operation ::= `ibis.path` $path attr-dict

The ibis.path operation describes an instance hierarchy path relative to the current scope. The path is specified by a list of either parent or child identifiers (navigating up or down the hierarchy, respectively).

Scopes along the path are optionally typed, however, An ibis.path must lways terminate in a fully typed specifier, i.e. never an !ibis.scoperef<>.

The operation returns a single !ibis.scoperef-typed value representing the scope at the end of the path.

Traits: AlwaysSpeculatableImplTrait

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

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
path::mlir::ArrayAttrPath step array attribute

Results:

ResultDescription
instance

ibis.port.input (::circt::ibis::InputPortOp)

Ibis input port

Syntax:

operation ::= `ibis.port.input` $sym_name `:` $type attr-dict

Traits: HasParent<ClassOp, ContainerOp>

Interfaces: HasCustomSSAName, InferTypeOpInterface, PortOpInterface

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
type::mlir::TypeAttrtype attribute of any type

Results:

ResultDescription
port

ibis.port.output (::circt::ibis::OutputPortOp)

Ibis output port

Syntax:

operation ::= `ibis.port.output` $sym_name `:` $type attr-dict

Traits: HasParent<ClassOp, ContainerOp>

Interfaces: HasCustomSSAName, InferTypeOpInterface, PortOpInterface

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
type::mlir::TypeAttrtype attribute of any type

Results:

ResultDescription
port

ibis.port.read (::circt::ibis::PortReadOp)

Ibis port read

Syntax:

operation ::= `ibis.port.read` $port attr-dict `:` qualified(type($port))

Read the value of a port reference.

Traits: AlwaysSpeculatableImplTrait

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

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
port

Results:

ResultDescription
outputany type

ibis.port.write (::circt::ibis::PortWriteOp)

Ibis port write

Syntax:

operation ::= `ibis.port.write` $port `,` $value attr-dict `:` qualified(type($port))

Write a value to a port reference.

Operands:

OperandDescription
port
valueany type

ibis.return (::circt::ibis::ReturnOp)

Ibis method terminator

Syntax:

operation ::= `ibis.return` ($retValues^)? attr-dict (`:` type($retValues)^)?

Traits: AlwaysSpeculatableImplTrait, HasParent<MethodOp, DataflowMethodOp>, ReturnLike, Terminator

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), RegionBranchTerminatorOpInterface

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
retValuesany type

ibis.sblock (::circt::ibis::StaticBlockOp)

Ibis block

The ibis.sblock operation defines a block wherein a group of operations are expected to be statically scheduleable. The operation is not isolated from above to facilitate ease of construction. However, once a program has been constructed and lowered to a sufficient level, the user may run --ibis-argify-blocks to effectively isolate the block from above, by converting SSA values referenced through dominanes into arguments of the block

The block may contain additional attributes to specify constraints on the block further down the compilation pipeline.

Traits: AutomaticAllocationScope, SingleBlock, SingleBlockImplicitTerminator

Attributes:

AttributeMLIR TypeDescription
maxThreads::mlir::IntegerAttr64-bit signless integer attribute whose minimum value is 1

Operands:

OperandDescription
inputsany type

Results:

ResultDescription
outputsany type

ibis.sblock.inline.begin (::circt::ibis::InlineStaticBlockBeginOp)

Ibis inline static block begin marker

Syntax:

operation ::= `ibis.sblock.inline.begin` attr-dict

The ibis.sblock.inline.begin operation is a marker that indicates the begin of an inline static block. The operation is used to maintain ibis.sblocks while in the Ibis inline phase (to facilitate e.g. mem2reg).

The operation:

  1. denotes the begin of the sblock
  2. carries whatever attributes that the source ibis.sblock carried.
  3. is considered side-effectfull.

Traits: HasParent

ibis.sblock.inline.end (::circt::ibis::InlineStaticBlockEndOp)

Ibis inline static block end marker

Syntax:

operation ::= `ibis.sblock.inline.end` attr-dict

The ibis.sblock.inline.end operation is a marker that indicates the end of an inline static block. The operation is used to maintain ibis.sblocks while in the Ibis inline phase (to facilitate e.g. mem2reg).

Traits: HasParent

ibis.sblock.return (::circt::ibis::BlockReturnOp)

Ibis static block terminator

Syntax:

operation ::= `ibis.sblock.return` ($retValues^)? attr-dict (`:` type($retValues)^)?

Traits: AlwaysSpeculatableImplTrait, HasParent, ReturnLike, Terminator

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), RegionBranchTerminatorOpInterface

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
retValuesany type

ibis.this (::circt::ibis::ThisOp)

Return a handle to the current scope !ibis.scoperef

Syntax:

operation ::= `ibis.this` $scopeName attr-dict custom<ScopeRefFromName>(type($thisRef), ref($scopeName))

Interfaces: HasCustomSSAName, SymbolUserOpInterface

Attributes:

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

Results:

ResultDescription
thisRef

ibis.var (::circt::ibis::VarOp)

Ibis variable definition

Syntax:

operation ::= `ibis.var` $sym_name `:` $type attr-dict

Defines an Ibis class member variable. The variable is typed with a memref.memref type, and may define either a singleton or uni-dimensional array of values. ibis.var defines a symbol within the encompassing class scope which can be dereferenced through a !ibis.scoperef value of the parent class.

Interfaces: Symbol

Attributes:

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

ibis.wire.input (::circt::ibis::InputWireOp)

Ibis input wire

Syntax:

operation ::= `ibis.wire.input` $sym_name `:` qualified(type($output)) attr-dict

An input wire defines an ibis.portref<in T> port alongside a value of type T which represents the value to-be-written to the wire.

Traits: HasParent<ClassOp, ContainerOp>

Interfaces: HasCustomSSAName, PortOpInterface

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute

Results:

ResultDescription
port
outputany type

ibis.wire.output (::circt::ibis::OutputWireOp)

Ibis output wire

Syntax:

operation ::= `ibis.wire.output` $sym_name `,` $input `:` qualified(type($input)) attr-dict

An output wire defines an ibis.portref<out T> port that can be read. The operation takes an input value of type T which represents the value on the output portref.

Traits: HasParent<ClassOp, ContainerOp>

Interfaces: HasCustomSSAName, InferTypeOpInterface, PortOpInterface

Attributes:

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute

Operands:

OperandDescription
inputany type

Results:

ResultDescription
port

Attribute definition

PathStepAttr

Syntax:

#ibis.step<
  PathDirection,   # direction
  ::mlir::Type,   # type
  mlir::FlatSymbolRefAttr   # child
>

Used to describe a single step in a path

Parameters:

ParameterC++ typeDescription
directionPathDirection
type::mlir::Type
childmlir::FlatSymbolRefAttr

Type definition

PortRefType

Syntax:

!ibis.portref<
  TypeAttr,   # portTypeAttr
  ibis::Direction   # direction
>

A reference to an Ibis port.

Parameters:

ParameterC++ typeDescription
portTypeAttrTypeAttr
directionibis::Direction

ScopeRefType

Syntax:

!ibis.scoperef<
  mlir::FlatSymbolRefAttr   # scopeRef
>

A reference to an Ibis scope. May be either a reference to a specific scope (given a $scopeName argument) or an opaque reference.

Parameters:

ParameterC++ typeDescription
scopeRefmlir::FlatSymbolRefAttr

'ibis' Dialect Docs