-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement combinational groups and primitives #635
Conversation
Speedups from the new, more-concise dynamic FSMs:
|
…d fix misc bugs in passes
Hey @EclecticGriffin! Can I get some help fixing the interpreter? The changes to the normal interpreter seemed straightforward to make but the stepper changes seemed more involved. |
Sure thing, I'll untangle those |
Thanks! Apart from the interpreter fixes, the PR is ready for review & merge. |
alright that should do it for the interpreter (probably). What's the situation with edit: ah just saw the punt on static timing. nvm then sidebar: I am very much not looking forward to merging these interpreter changes with the multi-component stuff. |
This will be a relatively big PR with pervasive changes.
TODO
comb
groups attached towith
clauses. This will require changes to the frontends.comb
groups will be converted into normal groups by theremove-comb-groups
pass.top-down-cc
work again.top-down-cc
#639 for FSMs generated bytop-down-cc
.if
immediately nested in awhile
.while
as the first node in the control programcomb group
for Calyx backend cucapra/dahlia#383remove-dead-groups
minimize-regs
port
inif
andwhile
to the gens listPunt
static-timing
pass #654Notes
Change to Language Semantics
Change the invariant for compilation passes: control nodes cannot have
with
attached to them anymore. This means thatif-with
andwhile-with
need to be converted in simpleif
andwhile
nodes. This will be done either in a new pass orremove-comb-groups
:New syntax for
if
withoutwith
:In this case, we need to be sure that
r.out
will have a stable value during the entire execution of either the true or false branch. For frontends, they can manipulate the value ofr.out
during the execution of the branches. The compiler must use the new pass to ensure that the value in the port remains stable. @sampsyo does this feel reasonable or am I making this unnecessarily expressive?while
w/owith
will have a similar syntax and restrictions.Normal
if-with
syntax will be modified to only allow for combinational groups in thewith
position.remove-comb-group
can always ensure the stable property because combinational groups cannot be used in normal control flow.Changes to Passes
remove-comb-groups
The pass will transform
comb
groups to normal groups using the original heuristic. The only change is that it will also hoist the group into aseq
before theif
orwhile
:if lt.out with cond { .. }
turns into:seq { cond; if lt_reg.out { .. }
The
if
transformation is:The
while
transformation is:top-down-cc
BREAKING: Requires
top-down-cc
to run before this and assumes there are no groups inwith
position. New mechanism to generate FSMs (see #639).Invalid Notes
Changes that didn't make into this PR. I'm leaving them here for future context.
@stable
annotation on conditional portsThe compilation passes will require ports used in the cond position to be marked with the annotation
@stable
which tells the pass that the port's value will not change during the execution of the branches ofif
or the body of awhile
loop. When compilingcomb
groups,remove-comb-groups
will add this annotation. For non combinational conditions, the frontend must add this annotation.(NOTE: I'm starting to think that this strategy will not work for
while
loops at all since they might need to recompute things for the condition and therefore need to run a cond group.)