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
-
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 cond
syntax really says that "after runningcond
, thelt.out
port will have a valid value on it (except in this case, it has the added complication thatcond
might be combinational and it's not really "after runningcond
" but "whilecond
is 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:comb
syntax for combinational groups: Thegroup[done] = 1'd1
is 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
comb
group does not have adone
condition because all connections are always active in a combinational path. This also means thatcomb
groups cannot occur inside most control operators. Initially, the only valid position forcomb
groups would be as condition forif
andwhile
control operators.With a notion of valid ports,
comb
groups can be compiled into "normal" groups:The conversion from
comb
togroup
preserves the values that would've appeared on the specified valid ports. In this case, the two portslt.out
andadd.out
have been saved inlt_reg
andadd_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-timing
orcompile-control
), and allow the rest of Calyx pipeline to deal with a homogenous notion of groups.The Future: Dataflow execution
The
comb
group representation along with valid ports will allow us to specify a newdataflow
operator that only allowscomb
groups 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