Circuit IR Compilers and Tools

-calyx-compile-control: Generates latency-insensitive finite state machines to realize control. 

This pass performs a bottom-up traversal of the control program and does the following:

  1. For each control statement such as “calyx.seq”, create a new GroupOp to contain all the structure to realize the schedule.
  2. Implement the schedule by setting the constituent groups’ GoOp and DoneOp.
  3. Replace the control statement in the control program with the corresponding compilation group.

-calyx-go-insertion: Insert go signals into the guards of a group’s non-hole assignments 

This pass inserts the operation “calyx.group_go” into the guards of all assignments housed in the group, with the exception of the “calyx.group_done” terminator. For example,

Before: @Group1 {
  calyx.assign %in = %out1, %guard ? : i8
  %done = calyx.group_done %out2 : i1


// The `go` assignment takes on an undefined
// value until the Compile Control pass.
%undef = calyx.undef : i1
... @Group1 {
  %go = calyx.group_go %undef : i1

  %and = comb.and %guard, %go : i1
  calyx.assign %in = %out1, %and ? : i8

  %done = calyx.group_done %out2 : i1