-
Notifications
You must be signed in to change notification settings - Fork 52
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
Combinational Groups and Visible Results #207
Comments
This seems great to me. I don't think I fully understand the risks, so there may be downsides I'm aware of, but the rule seems intuitive to me and there is an important upside about being able to express "operator chaining" of combinational logic. |
Perhaps this is ready for prototyping, at least speculatively? |
This is really cool. I had one question. For the following depiction of
Cycles 0, 1 are used to compute the mult. Why don't we need at least a single cycle to compute the add? It seems like we are skipping the compute time for the add step here, but I may be misinterpreting how to read this. |
didn't see that you commented this, sorry about that. the thing about add is that it can be done combinationally. so it can add the output from mult and have it's results ready in the same cycle. |
Ok that makes sense, thanks. |
Putting this here as a note: We can't do this compilation without changing combinational groups to use
We want If we instead follow the policy that This issue would also be avoided by guarding done holes with the go hole always. The problem with this, and this is the reason we current don't do this, is that it prevents use of conditioning the execution of a group based on when it isn't done. For example:
when holes are inlined this becomes
which can't be inlined further because there's a cycle. We use this in a few places, but maybe we should think hard about whether we really need to condition executing a group using it's done signal as a condition. |
This seems like a strong argument to me! |
After a discussion with Adrian, it seems that we have a choice between making For the record, here's a sketch of how a combinational aware
and a sketch of the "latching" pass approach:
After writing these out in detail, it seems clear to me that both options are not drastically different and the second option is slightly simpler to implement. It's basically a question of whether we do this transformation during compilation or in a separate pass before compilation. |
Discussion moved to #270 |
The current semantics don't have a clearly defined way to interpret combinational groups (groups that have
"static"=0
or havegroup[done] = 1
) or have a way to pass values between groups, like in the following example:The group
save
never gets to see the results of the multiply because the way that we compile control makes these two groups entirely disjoint.I propose that we change the compilation so that for a group executing sequentially after another, get's to see the done signal of that group.
seq { A; B; }
, B gets to see the done signal ofA
and thus can use the results of previous groups.while port with G { B }
:B
can see the done ofG
whenport
is true andG
can see the done ofB
if port with G { T} else { F }
:T
orF
can see the done ofG
par { A; B; }
: there is no guarantee about whetherA
orB
can see each other's done signalsThese semantics makes it clear how combinational groups should work. For example
will take the same amount of time as just
save_add
alone andsave_add
will be able to use results produced inadd
.This proposal works with the static timing annotations. We just shift the generated schedule to overlap on the last cycle.
So for the program for
x = a + (b * c)
: we can use the schedule(
c
means computing,r
means data is ready).The old schedule required each group to save it's own results and looked like:
Additionally this proposal makes it easier to break up long combinational chains, assuming that are specified in FuTIL control rather than in a group. Previously, an expression like
a + b + c + d + e
was compiled to a single group that computed the entire expression.Now, because groups can see each others results, each binary expression can be expressed as it's own group and you can express the schedule like:
seq { AB; CD; ABCDE }
. It then becomes trivial to insert a register at any point in the chain and the schedule remains the same.The text was updated successfully, but these errors were encountered: