Port-validity as a first class concept #588
rachitnigam
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
I'm a bit lost here. Where did these registers come from? It went from a combinational group to a single-cycled group? Also I imagine that the |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Awesome!!! I think this is a great way to proceed. Here are a couple of notes:
And two questions:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In pursuit of the next big set of features of Calyx (pipelining, combinational components), we should extend the IR with a notion of port validity.
Port validity: A port is considered "valid" if it allows a value to be read from it. For example:
Calyx already supports valid ports as a second class concept:
The
lt.out with condsyntax really says that "after runningcond, thelt.outport will have a valid value on it (except in this case, it has the added complication thatcondmight be combinational and it's not really "after runningcond" but "whilecondis running". More on this later.)Proposed extensions
with-syntax for groups: The group syntax is extended to represented the set of ports that can be read after the group has finished executing:combsyntax for combinational groups: Thegroup[done] = 1'd1is a well known wart in the design of Calyx. What we really want in this case is a combinational group with some special properties (such as valid ports). With the extended syntax, we can say:Note that a
combgroup does not have adonecondition because all connections are always active in a combinational path. This also means thatcombgroups cannot occur inside most control operators. Initially, the only valid position forcombgroups would be as condition forifandwhilecontrol operators.With a notion of valid ports,
combgroups can be compiled into "normal" groups:The conversion from
combtogrouppreserves the values that would've appeared on the specified valid ports. In this case, the two portslt.outandadd.outhave been saved inlt_regandadd_reg. Note that this conversion will always result in a group that takes exactly one cycle because all specified ports can be within one cycle since the group is combinational.This extension gives frontends the flexibility to specify combinational circuitry, let passes optimize combinational conditions (which is not currently possible with either
static-timingorcompile-control), and allow the rest of Calyx pipeline to deal with a homogenous notion of groups.The Future: Dataflow execution
The
combgroup representation along with valid ports will allow us to specify a newdataflowoperator that only allowscombgroups within itself and automatically inserts registers.Such dataflow execution can be basis for the pipeline operator as well.
Beta Was this translation helpful? Give feedback.
All reactions