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:
Re-exports§
pub use rewriter::Rewriter;
Modules§
- from_
ast - Module to transform AST programs into IR.
- rewriter
- Modules to rewrite the IR
- serializers
- Serializer methods for IR nodes.
- source_
info - utils
- Helpers used to examine calyx programs. Used in Xilinx and Yxi backends among others.
Macros§
- build_
assignments - Build guarded assignment statements and return a vector containing them.
- guard
- Parse guard expression into
ir::Guard
. - structure
- Add primitives and constants to the component and
let
-bind the references.
Structs§
- Assignment
- Represents a guarded assignment in the program
- Attributes
- Attributes associated with a specific IR structure.
- Backend
Conf - Configuration information for the backends.
- Builder
- 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
- Canonical name of a Port
- Cell
- Represents an instantiated cell.
- Cloner
- Implement cloning operations on control statements. We implement these separatily from the Clone trait because cloning trait is not very common and clones should be explicit.
- Comb
Group - A combinational group. A combinational group does not have any holes and should only contain assignments that should will be combinationally active
- Component
- In memory representation of a Component.
- Context
- The IR Context that represents an entire Calyx program with all of its imports and dependencies resolved.
- Empty
- Data for the
empty
control statement. - Enable
- Data for the
enable
control statement. - FSM
- FSMEnable
- Data for the
enable
control statement. - Group
- A Group of assignments that perform a logical action.
- Guard
Pool - A
GuardPool
is an “arena”-style storage area forFlatGuard
s. - Guard
Ref - Id
- Represents an identifier in a Calyx program
- IdList
- 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.
- If
- Data for the
if
control statement. - Invoke
- Data for an
invoke
control statement. - Library
Signatures - A representation of all the primitive definitions found while parsing the root program.
- Nothing
- Par
- Data for the
par
control statement. - Port
- Represents a port on a cell.
- PortDef
- 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
. - Port
Iterator - Wraps generic iterators over ports to allow functions to build and return port iterators in different ways.
- Primitive
- Representation of a external primitive definition.
- Printer
- Printer for the IR.
- Repeat
- Data for the Dynamic
Repeat
control statement. Repeats the body of the loop a given number times. - Seq
- Data for the
seq
control statement. - Static
Enable - Data for the
enable
control for a static group. - Static
Group - A Group of assignments that perform a logical action.
- Static
If - Data for the
static if
control statement. - Static
Invoke - Data for a
StaticInvoke
control statement - Static
Par - Static
Repeat - Data for the
StaticRepeat
control statement. Essentially a static while loop. - Static
Seq - Data for the
static seq
control statement. - Static
Timing - WRC
- A Wrapper for a weak RefCell pointer. Used by parent pointers in the internal representation.
- While
- Data for the
while
control statement.
Enums§
- Attribute
- Defines the known attributes that can be attached to IR nodes. All caps names represent attributes that are internal to the compiler and cannot be parsed back.
- Bool
Attr - Attributes that are only allowed to take boolean values.
- Cell
Type - The type for a Cell
- Control
- Control AST nodes.
- Direction
- Direction of a port on a cell.
- Flat
Guard - Generic
Control - Either holds a reference to a StaticControl, reference to a Control, or None Helpful when we want to be able get get any specific control statement within a control program. For example, suppose we assign an id to each enable (static or dynamic) in the control program. A function that takes in an id and returns the appropriate enable would have to return a GenericControl. Has the weird affect that GenericControl::Dynamic(Control::Static()) can be a bit redundant with GenericControl::Static() but the latter gives us more precise access to every enum in the static control, instead of just the big wrapper.
- Guard
- An assignment guard which has pointers to the various ports from which it reads.
- Internal
Attr - Internal attributes that cannot be parsed back from the IL.
- NumAttr
- Attributes that can take numeric values
- Port
Comp - Comparison operations that can be performed between ports by Guard::CompOp.
- Port
Parent - Ports can come from Cells or Groups
- Primitive
Info - Tracks the information for Primitives defined in the program.
- Static
Control - Control AST nodes.
- Transition
- Width
- Represents an abstract width of a primitive signature.
Constants§
- DEPRECATED_
ATTRIBUTES - Attributes that have been deprecated.
- RESERVED_
NAMES - Names that are reserved in Calyx and Verilog.
Traits§
- GetAttributes
- Structs that can return an
Attributes
instance. - GetName
- A trait representing something in the IR that has a name.
Functions§
- rrc
- Construct a new RRC.