-
Notifications
You must be signed in to change notification settings - Fork 53
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
remove-comb-groups
should be optional
#911
Comments
Logistically, how would this work? Would remove-comb-groups be removed from the pre-opt alias, and the tdcc and top-down-st passes updated accordingly? |
Yup! Alternatively, if we only implement this in |
Just commenting an example of how this could be useful. The current implementation of ========== means a clock cycle boundary Current loop body implementation:========== Without remove comb groups, with chained comb groups during tdst:========== This only saves one cycle per loop iteration, but that adds up quickly for loops that run for many iterations. |
I have been out of the loop (heh), but I do remember looking at that extra cycle for both statically timed loops as well as the normal latency insensitive loops, and wondering if it would be possible to save the extra cycle of latency. |
While working on fixing this, I came across this program which cannot be compiled correctly:
In this case, the predecessors of A & B are computed to be the start of the However, when fixing this issue, we run the assignments in the comb group in every predecessor state, that is, every state that can transition into
The obvious problem is that 0 (start state) can transition to both Before implementing the fix, we would always transform the program to look like this:
Which would ensure that conflicting assignments to This problem seems to reflect the fact that |
Sorry if this is naive, but wouldn't the correct predecessor set for |
Okay, so I've realized that loops where we chain the condition check with the next group will also potentially suffer from the above problem. Consider:
If we exit the inner loop and want to start a new iteration of the outer loop, how many cycles should it take for The current pass attempts to schedule |
Wow, nice catch. I can't help but wonder if there's an underlying principle here that would cover Anyway, yeah, it seems like the thing to do for this particular example is to allow for an extra FSM state (and an extra cycle), at least when the loop conditions conflict. |
After #1338, I've realized that there is no good way to eliminate this pass in general. Instead, I think we should change it so that it doesn't create unnecessary groups. For example, there is no reason for the pass to compile away The new static timing proposal (#1344) will enable us to write loops that can re-execute their bodies every cycle. |
The current compilation pipeline requires
remove-comb-groups
to be run before any compilation passes are run (tdcc
andstatic-timing
). Instead of doing this, the compilation passes should be allowed to directly handle the compilation of combinational groups.tdcc
can enable the combinational assignments in the cycle when it is reading the conditional port.static-timing
can enable the combinational assignments in the cycle when the conditional port is read and in the case of a@bound while
, eliminated altogether.TODO
infer-static-timing
should no longer infer timing forif
to bemax(tr, fl) + 1
since the1
comes from1
cycle needed to evaluate the condition group.The text was updated successfully, but these errors were encountered: