CIRCT

Circuit IR Compilers and Tools

'calyx' Dialect

Types and operations for the Calyx dialect Calyx is an intermediate language and infrastructure for building compilers that generate custom hardware accelerators. For more information, visit the documentation .

Operation definition 

calyx.std_add (::circt::calyx::AddLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_add` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
outany type

calyx.std_and (::circt::calyx::AndLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_and` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
outany type

calyx.assign (::circt::calyx::AssignOp) 

Calyx Assignment

The “calyx.assign” operation represents a non-blocking assignment. An assignment may optionally be guarded, which controls when the assignment should be active. This operation should only be instantiated in the “calyx.wires” section or a “calyx.group”.

  calyx.assign %dest = %src : i16
  calyx.assign %dest = %guard ? %src : i16

Traits: HasParent<GroupOp, CombGroupOp, WiresOp>

Operands: 

OperandDescription
destany type
srcany type
guard1-bit signless integer

calyx.comb_group (::circt::calyx::CombGroupOp) 

Calyx Combinational Group

Syntax:

operation ::= `calyx.comb_group` $sym_name $body attr-dict

Represents a Calyx combinational group, which is a collection of combinational assignments that are only active when the group is run from the control execution schedule. A combinational group does not have group_go or group_done operators.

  calyx.comb_group @MyCombGroup {
    calyx.assign %1 = %2 : i32
  }

Traits: HasParent, NoRegionArguments, NoTerminator, SingleBlock

Interfaces: GroupInterface, RegionKindInterface, Symbol

Attributes: 

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute

calyx.component (::circt::calyx::ComponentOp) 

Calyx Component

The “calyx.component” operation represents an overall Calyx component containing: (1) In- and output port definitions that define the interface. (2) The cells, wires, and control schedule.

A Calyx component requires attributes clk, go, and reset on separate input ports, and done on an output port.

  calyx.component @C(%in: i32, %go: i1 {go}, %clk: i1 {clk}, %reset: i1 {reset}) -> (%out: i16, %done: i1 {done}) {
    ...
    calyx.wires { ... }
    calyx.control { ... }
  }

Traits: FunctionLike, HasParent, IsolatedFromAbove, NoTerminator, SingleBlock, SymbolTable

Interfaces: Symbol

Attributes: 

AttributeMLIR TypeDescription
portNames::mlir::ArrayAttrarray attribute
portAttributes::mlir::ArrayAttrarray attribute
portDirections::mlir::IntegerAttrarbitrary integer attribute

calyx.control (::circt::calyx::ControlOp) 

Calyx Control

Syntax:

operation ::= `calyx.control` $body attr-dict

The “calyx.control” operation represents the execution schedule defined for the given component, i.e. when each group executes.

  calyx.control {
    calyx.seq {
      calyx.enable @GroupA
    }
  }

Traits: HasParent, NoRegionArguments, NoTerminator, SingleBlock

calyx.std_div_pipe (::circt::calyx::DivPipeLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_div_pipe` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
go1-bit signless integer
clk1-bit signless integer
reset1-bit signless integer
out_quotientany type
out_remainderany type
done1-bit signless integer

calyx.enable (::circt::calyx::EnableOp) 

Calyx Enable

Syntax:

operation ::= `calyx.enable` $groupName attr-dict

The “calyx.enable” operation represents the execution of a group defined explicitly in the “calyx.wires” section.

The ‘compiledGroups’ attribute is used in the Compile Control pass to track which groups are compiled within the new compilation group.

  calyx.enable @SomeGroup

Traits: ControlLike

Attributes: 

AttributeMLIR TypeDescription
groupName::mlir::FlatSymbolRefAttrflat symbol reference attribute
compiledGroups::mlir::ArrayAttrarray attribute

calyx.std_eq (::circt::calyx::EqLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_eq` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.std_ge (::circt::calyx::GeLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_ge` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.group_done (::circt::calyx::GroupDoneOp) 

Calyx Group Done Port

The “calyx.group_done” operation represents a port on a Calyx group that signifies when the group is finished. A done operation may optionally be guarded, which controls when the group’s done operation should be active.

  calyx.group_done %src : i1
  calyx.group_done %guard ? %src : i1

Traits: HasParent, Terminator

Operands: 

OperandDescription
src1-bit signless integer
guard1-bit signless integer

calyx.group_go (::circt::calyx::GroupGoOp) 

Calyx Group Go Port

The “calyx.group_go” operation represents a port on a Calyx group that signifies when the group begins. A go operation may optionally be guarded, which controls when the group’s go operation should be active. The go operation should only be inserted during the Go Insertion pass. It does not receive a source until the Compile Control pass.

  %group_name1.go = calyx.group_go %src : i1
  %group_name2.go = calyx.group_go %guard ? %src : i1

Traits: HasParent

Interfaces: OpAsmOpInterface

Operands: 

OperandDescription
src1-bit signless integer
guard1-bit signless integer

Results: 

ResultDescription
«unnamed»1-bit signless integer

calyx.group (::circt::calyx::GroupOp) 

Calyx Group

Syntax:

operation ::= `calyx.group` $sym_name $body attr-dict

Represents a Calyx group, which is a collection of assignments that are only active when the group is run from the control execution schedule. A group signifies its termination with a special port named a “done” port.

  calyx.group @MyGroup {
    calyx.assign %1 = %2 : i32
    calyx.group_done %3 : i1
  }

Traits: HasParent, NoRegionArguments, SingleBlock

Interfaces: GroupInterface, RegionKindInterface, Symbol

Attributes: 

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute

calyx.std_gt (::circt::calyx::GtLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_gt` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.if (::circt::calyx::IfOp) 

Calyx If

Syntax:

operation ::= `calyx.if` $cond (`with` $groupName^)? $thenRegion (`else` $elseRegion^)? attr-dict

The “calyx.if” operation represents and if-then-else construct for conditionally executing two Calyx groups. The operands to an if operation is a 1-bit port and an optional combinational group under which this port is driven.

Note: The native and CIRCT Calyx IRs may diverge wrt. ‘with’ execution, see: https://github.com/cucapra/calyx/discussions/588

  calyx.if %1 with @G1 {
    calyx.enable @G2
    ...
  } else {
    calyx.enable @G3
    ...
  }
  calyx.if %1 {
    calyx.enable @G2
    ...
  }

Traits: ControlLike, NoRegionArguments, NoTerminator, SingleBlock

Attributes: 

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

Operands: 

OperandDescription
cond1-bit signless integer

calyx.instance (::circt::calyx::InstanceOp) 

Calyx Component Instance

Syntax:

operation ::= `calyx.instance` $instanceName `of` $componentName attr-dict (`:` type($results)^)?

Represents an instance of a Calyx component, which may include state.

  %c.in, %c.out = calyx.instance @c of @MyComponent : i64, i16

Interfaces: CellInterface, OpAsmOpInterface, SymbolUserOpInterface

Attributes: 

AttributeMLIR TypeDescription
instanceName::mlir::FlatSymbolRefAttrflat symbol reference attribute
componentName::mlir::FlatSymbolRefAttrflat symbol reference attribute

Results: 

ResultDescription
resultsany type

calyx.std_le (::circt::calyx::LeLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_le` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.std_lsh (::circt::calyx::LshLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_lsh` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
outany type

calyx.std_lt (::circt::calyx::LtLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_lt` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.memory (::circt::calyx::MemoryOp) 

Defines a memory

Syntax:

operation ::= `calyx.memory` $instanceName ` ` `<` $sizes `x` $width `>` $addrSizes attr-dict `:` type($results)

The “calyx.memory” op defines a memory. Memories can have any number of dimensions, as specified by the length of the $sizes and $addrSizes arrays. The $addrSizes specify the bitwidth of each dimension’s address, and should be wide enough to address the range of the corresponding dimension in $sizes. The $width attribute dictates the width of a single element.

See https://capra.cs.cornell.edu/docs/calyx/libraries/core.html#memories for more information.

  // A 1-dimensional, 32-bit memory with size dimension 1. Equivalent representation in the native compiler:
  // `m1 = std_mem_d1(32, 1, 1)`
  %m1.addr0, %m1.write_data, %m1.write_en, %m1.clk, %m1.read_data, %m1.done = calyx.memory @m1 <[1] x 32> [1] : i1, i32, i1, i1, i32, i1

  // A 2-dimensional, 8-bit memory with size dimensions 64 x 64. Equivalent representation in the native compiler:
  // `m2 = std_mem_d2(8, 64, 64, 6, 6)`
  %m2.addr0, %m2.addr1, %m2.write_data, %m2.write_en, %m2.clk, %m2.read_data, %m2.done = calyx.memory @m2 <[64, 64] x 8> [6, 6] : i6, i6, i8, i1, i1, i8, i1

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

AttributeMLIR TypeDescription
instanceName::mlir::FlatSymbolRefAttrflat symbol reference attribute
width::mlir::IntegerAttr64-bit signless integer attribute
sizes::mlir::ArrayAttrarray attribute
addrSizes::mlir::ArrayAttrarray attribute

Results: 

ResultDescription
resultssignless integer

calyx.std_mult_pipe (::circt::calyx::MultPipeLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_mult_pipe` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
go1-bit signless integer
clk1-bit signless integer
reset1-bit signless integer
outany type
done1-bit signless integer

calyx.std_neq (::circt::calyx::NeqLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_neq` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.std_not (::circt::calyx::NotLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_not` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
ininteger
outinteger

calyx.std_or (::circt::calyx::OrLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_or` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
outany type

calyx.std_pad (::circt::calyx::PadLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_pad` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
ininteger
outinteger

calyx.par (::circt::calyx::ParOp) 

Calyx Parallel

Syntax:

operation ::= `calyx.par` $body attr-dict

The “calyx.par” operation executes the control within its region in parallel.

  calyx.par {
    // G1 and G2 will execute in parallel.
    // The region is complete when both
    // G1 and G2 are done.
    calyx.enable @G1
    calyx.enable @G2
  }

Traits: ControlLike, NoRegionArguments, NoTerminator, SingleBlock

calyx.program (::circt::calyx::ProgramOp) 

Calyx Program

Syntax:

operation ::= `calyx.program` $entryPointName $body attr-dict

The “calyx.program” operation represents an overall Calyx program, containing a list of Calyx components. This must include an entry-point component.

calyx.program "main" { ... }

Traits: IsolatedFromAbove, NoRegionArguments, NoTerminator, SingleBlock, SymbolTable

Attributes: 

AttributeMLIR TypeDescription
entryPointName::mlir::StringAttrstring attribute

calyx.register (::circt::calyx::RegisterOp) 

Defines a register

Syntax:

operation ::= `calyx.register` $instanceName attr-dict `:` type(results)

The “calyx.register” op defines a register.

  // A 32-bit register.
  %r.in, %r.write_en, %r.clk, %r.reset, %r.out, %r.done = calyx.register @r : i32, i1, i1, i1, i32, i1

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
inany type
write_en1-bit signless integer
clk1-bit signless integer
reset1-bit signless integer
outany type
done1-bit signless integer

calyx.std_rsh (::circt::calyx::RshLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_rsh` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
outany type

calyx.std_seq (::circt::calyx::SeqLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_seq` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.seq (::circt::calyx::SeqOp) 

Calyx Sequential

Syntax:

operation ::= `calyx.seq` $body attr-dict

The “calyx.seq” operation executes the control within its region sequentially.

  calyx.seq {
    // G2 will not begin execution until G1 is done.
    calyx.enable @G1
    calyx.enable @G2
  }

Traits: ControlLike, NoRegionArguments, NoTerminator, SingleBlock

calyx.std_sge (::circt::calyx::SgeLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_sge` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.std_sgt (::circt::calyx::SgtLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_sgt` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.std_shru (::circt::calyx::ShruLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_shru` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
outany type

calyx.std_sle (::circt::calyx::SleLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_sle` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.std_slice (::circt::calyx::SliceLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_slice` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
ininteger
outinteger

calyx.std_slt (::circt::calyx::SltLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_slt` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.std_sneq (::circt::calyx::SneqLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_sneq` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
out1-bit signless integer

calyx.std_srsh (::circt::calyx::SrshLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_srsh` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
outany type

calyx.std_sub (::circt::calyx::SubLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_sub` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
outany type

calyx.undef (::circt::calyx::UndefinedOp) 

Calyx Undefined Value

Syntax:

operation ::= `calyx.undef` attr-dict `:` type($res)

The “undef” operation represents an undefined value that may be used when a specific source or destination does not have an assignment yet. This is used to avoid pulling in the entire LLVMIR dialect for a single operation.

  %0 = calyx.undef : i1

Interfaces: NoSideEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Results: 

ResultDescription
resany type

calyx.while (::circt::calyx::WhileOp) 

Calyx While

Syntax:

operation ::= `calyx.while` $cond (`with` $groupName^)? $body attr-dict

The “calyx.while” operation represents a construct for continuously executing the inner groups of the ‘while’ operation while the condition port evaluates to true. The operands to a while operation is a 1-bit port and an optional combinational group under which this port is driven.

Note: The native and CIRCT Calyx IRs may diverge wrt. ‘with’ execution, see: https://github.com/cucapra/calyx/discussions/588

  calyx.while %1 with @G1 {
    calyx.enable @G2
    ...
  }
  calyx.while %1 {
    calyx.enable @G2
    ...
  }

Traits: ControlLike, NoRegionArguments, NoTerminator, SingleBlock

Attributes: 

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

Operands: 

OperandDescription
cond1-bit signless integer

calyx.wires (::circt::calyx::WiresOp) 

Calyx Wires

Syntax:

operation ::= `calyx.wires` $body attr-dict

The “calyx.wires” operation represents a set of guarded connections between component instances, which may be placed within groups.

  calyx.wires {
    calyx.group @A { ... }
    calyx.assign %1 = %2 : i16
  }

Traits: HasParent, NoRegionArguments, NoTerminator, SingleBlock, SymbolTable

calyx.std_xor (::circt::calyx::XorLibOp) 

Defines an operation which maps to a Calyx library primitive

Syntax:

operation ::= `calyx.std_xor` $instanceName attr-dict `:` type(results)

This operation represents an instance of a Calyx library primitive. A library primitive maps to some hardware-implemented component within the native Calyx compiler.

  // A 32-bit adder. This falls under the binary library operations.
  %add.left, %add.right, %add.out = calyx.std_add @add : i32, i32, i32

  // An 8-bit comparison operator (with a 1-bit output). This falls under
  // the boolean binary library operations.
  %gt.left, %gt.right, %gt.out = calyx.std_gt @gt : i8, i8, i1

  // An 8-bit to 16-bit pad operator. This falls under the unary
  // library operations.
  %pad.in, %pad.out = calyx.std_pad @pad : i8, i16

Traits: Combinational

Interfaces: CellInterface, OpAsmOpInterface

Attributes: 

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

Results: 

ResultDescription
leftany type
rightany type
outany type