Module calyx::ir

source · []
Expand description

Internal representation for the Calyx compiler.

The representation is generated from the frontend AST. The key differences between the frontend AST and the IR are:

  1. The IR uses pointers instead of Id to refer to things like Port and Group.
  2. The IR attempts to represent similar concepts in a homogeneous manner.


pub use rewriter::Rewriter;


Module to transform AST programs into IR.

Visitor to traverse a control program.


Represents a guarded assignment in the program

Attributes associated with a specific IR structure.

Configuration information for the backends.

IR builder. Uses internal references to the component to construct and validate constructs when needed. By default, assumes that the cells are being added by a pass and marks them with the @generated attribute.

Canonical name of a Port

Represents an instantiated cell.

A combinational group. A combinational group does not have any holes and should only contain assignments that should will be combinationally active

In memory representation of a Component.

The IR Context that represents an entire Calyx program with all of its imports and dependencies resolved.

Data for the empty control statement.

Data for the enable control statement.

A Group of assignments that perform a logical action.

Represents an identifier in a Calyx program

A wrapper struct exposing an ordered collection of named entities within an RRC with deterministic iteration and constant-time look-up on names directly. The struct assumes that the name of an entity cannot change. Doing so will introduce incorrect results for look-ups.

Data for the if control statement.

Data for an invoke control statement.

A representation of all the primitive definitions found while parsing the root program.

Data for the par control statement.

Represents a port on a cell.

Definition of a port parameterized by a width type. Ports on Primitives can be parameteris and use Width. Ports on Components cannot be parameterized and therefore use u64.

Wraps generic iterators over ports to allow functions to build and return port iterators in different ways.

Representation of a external primitive definition.

Printer for the IR.

Data for the seq control statement.

A Wrapper for a weak RefCell pointer. Used by parent pointers in the internal representation.

Data for the if control statement.


The type for a Cell

Control AST nodes.

Direction of a port on a cell.

An assignment guard which has pointers to the various ports from which it reads.

Comparison operations that can be performed between ports by Guard::CompOp.

Ports can come from Cells or Groups

Represents an abstract width of a primitive signature.



A utility trait representing the ability to clone the name of an object. Automatically definied for anything that implements GetName

Structs that can return an Attributes instance.

A trait representing something in the IR that has a name.

Type Definitions

Alias for bindings

Alias for a RefCell contained in an Rc reference.