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.

Operations

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
operandsvariadic of any type

Results:

ResultDescription
«unnamed»variadic of 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>, InnerSymbolTable, IsolatedFromAbove, NoTerminator, SingleBlock

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

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` $inner_sym `,` $targetName attr-dict
              custom<ScopeRefFromName>(type($scopeRef), ref($targetName))

Instantiates an Ibis container.

Interfaces: HasCustomSSAName, InnerSymbolOpInterface, InstanceGraphInstanceOpInterface, SymbolUserOpInterface

Attributes:

AttributeMLIR TypeDescription
inner_sym::circt::hw::InnerSymAttrInner symbol definition
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, InnerRefUserOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

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, InnerRefUserOpInterface

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` $inner_sym `,` $targetName attr-dict
              custom<ScopeRefFromName>(type($scopeRef), ref($targetName))

Instantiates an Ibis class.

Interfaces: HasCustomSSAName, InnerSymbolOpInterface, InstanceGraphInstanceOpInterface, SymbolUserOpInterface

Attributes:

AttributeMLIR TypeDescription
inner_sym::circt::hw::InnerSymAttrInner symbol definition
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<ClassOp>, IsolatedFromAbove

Interfaces: InnerSymbolOpInterface, MethodLikeOpInterface, OpAsmOpInterface

Attributes:

AttributeMLIR TypeDescription
inner_sym::circt::hw::InnerSymAttrInner symbol definition
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<ClassOp>, IsolatedFromAbove, SingleBlockImplicitTerminator<ibis::ReturnOp>, SingleBlock

Interfaces: FineGrainedDataflowRegionOpInterface, InnerSymbolOpInterface, MethodLikeOpInterface, RegionKindInterface

Attributes:

AttributeMLIR TypeDescription
inner_sym::circt::hw::InnerSymAttrInner symbol definition
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.pipeline.header (::circt::ibis::PipelineHeaderOp)

Ibis pipeline header operation

Syntax:

operation ::= `ibis.pipeline.header` attr-dict

This operation defines the hardware-like values used to drive a pipeline, such as clock and reset. This is an intermediate operation, meaning that it’s strictly used to facilitate progressive lowering of ibis static blocks to scheduled pipelines.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Results:

ResultDescription
clockA type for clock-carrying wires
reset1-bit signless integer
go1-bit signless integer
stall1-bit signless integer

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

Ibis input port

Syntax:

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

Traits: HasParent<ClassOp, ContainerOp>

Interfaces: HasCustomSSAName, InferTypeOpInterface, InnerSymbolOpInterface, PortOpInterface

Attributes:

AttributeMLIR TypeDescription
inner_sym::circt::hw::InnerSymAttrInner symbol definition
type::mlir::TypeAttrtype attribute of any type

Results:

ResultDescription
port

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

Ibis output port

Syntax:

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

Traits: HasParent<ClassOp, ContainerOp>

Interfaces: HasCustomSSAName, InferTypeOpInterface, InnerSymbolOpInterface, PortOpInterface

Attributes:

AttributeMLIR TypeDescription
inner_sym::circt::hw::InnerSymAttrInner symbol definition
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
retValuesvariadic of any 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, SingleBlockImplicitTerminator<BlockReturnOp>, SingleBlock

Interfaces: BlockOpInterface

Attributes:

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

Operands:

OperandDescription
inputsvariadic of any type

Results:

ResultDescription
outputsvariadic of any type

ibis.sblock.dc (::circt::ibis::DCBlockOp)

DC-interfaced Ibis block

The ibis.sblock.dc operation is like an ibis.sblock operation with a few differences, being:

  1. The operation is DC-interfaced, meaning that all arguments and results are dc-value typed.
  2. The operation is IsolatedFromAbove.

Traits: AutomaticAllocationScope, IsolatedFromAbove, SingleBlockImplicitTerminator<BlockReturnOp>, SingleBlock

Interfaces: BlockOpInterface

Attributes:

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

Operands:

OperandDescription
inputsvariadic of any type

Results:

ResultDescription
outputsvariadic of any 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<MethodOp>

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<MethodOp>

ibis.sblock.isolated (::circt::ibis::IsolatedStaticBlockOp)

Ibis isolated block

The ibis.sblock.isolated operation is like an ibis.sblock operation but with an IsolatedFromAbove condition, meaning that all arguments and results are passed through the block as arguments and results.

Traits: AutomaticAllocationScope, IsolatedFromAbove, SingleBlockImplicitTerminator<BlockReturnOp>, SingleBlock

Interfaces: BlockOpInterface

Attributes:

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

Operands:

OperandDescription
inputsvariadic of any type

Results:

ResultDescription
outputsvariadic of any type

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

Ibis static block terminator

Syntax:

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

Traits: AlwaysSpeculatableImplTrait, HasParent<StaticBlockOp, IsolatedStaticBlockOp, DCBlockOp>, ReturnLike, Terminator

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), RegionBranchTerminatorOpInterface

Effects: MemoryEffects::Effect{}

Operands:

OperandDescription
retValuesvariadic of any 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, InnerRefUserOpInterface

Attributes:

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

Results:

ResultDescription
thisRef

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

Ibis variable definition

Syntax:

operation ::= `ibis.var` $inner_sym `:` $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: InnerSymbolOpInterface

Attributes:

AttributeMLIR TypeDescription
inner_sym::circt::hw::InnerSymAttrInner symbol definition
type::mlir::TypeAttrany memref type

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

Ibis input wire

Syntax:

operation ::= `ibis.wire.input` $inner_sym `:` 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, InnerSymbolOpInterface, PortOpInterface

Attributes:

AttributeMLIR TypeDescription
inner_sym::circt::hw::InnerSymAttrInner symbol definition

Results:

ResultDescription
port
outputany type

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

Ibis output wire

Syntax:

operation ::= `ibis.wire.output` $inner_sym `,` $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, InnerSymbolOpInterface, PortOpInterface

Attributes:

AttributeMLIR TypeDescription
inner_sym::circt::hw::InnerSymAttrInner symbol definition

Operands:

OperandDescription
inputany type

Results:

ResultDescription
port

Attributes

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

Types

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