Guarantees for Static Timing #1331
Replies: 3 comments 10 replies
-
|
Nice! Having these defined for the "static subset" of Calyx seems like a really good idea. Perhaps this should become a docs page once we resolve the unknowns? Here are a few scattered thoughts on the questions within:
I'm not 100% sure what this would mean… since the entire program takes exactly
Are we sure we want the whole thing to take |
Beta Was this translation helpful? Give feedback.
-
|
Note that the way we've defined the semantics for This also indicates an inverse transformation from non-static |
Beta Was this translation helpful? Give feedback.
-
|
I'm starting to realize that precise timing guarantees might be fundamentally in tension with the isolated, compositional nature of groups. Consider this program: This implements a The FSM simply counts up to Now we're saying that the FSM is reset the cycle after it is set to 3 allowing us to re-execute the group. Let's see if this works: This program will generate an incorrect result. Here is the cycle-by-cycle account:
Whoops. The problem is that The above group can correctly execute all of its internal groups since This means that we cannot compile this group in a non-static context. The problem is that static groups are a fundamentally different beast from normal groups. The reason they can be timing precise is because we guarantee that we are not going to look at their Implicit in this representation is the fact that Owing to our old adage "problems for groups are problems for components", the following program also doesn't work correctly if the FSM for Possible SolutionsAll of these problems stem from the idea that
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
By default, Calyx works with a latency-insensitive model of computation and leaves it to the compiler to discover latency information. The compiler can then exploit this information to generate more efficient and performant programs. Long-term, we should treat this as Calyx's "killer feature" and orient the design of the language and the compiler towards it.
To this end, we should work on making latency sensitivity a first-class concept in the language. There are various upgrades to the language that we should consider such as upgrading
staticto a keyword and definingstatic groups andstatic components, all of them begin with a stronger guarantee of how static programs are scheduled.seqFor the following program:
The compiler must guarantee that the execution takes exactly
K + L + Mcycles and thattwostarts executing on cycleK+1andthreestarts executing on cycleK+L+1.parA
parprogram must ensure that all its children start executing in the same cycle:The compiler must ensure that
one,two, andthreeall start executing in the same cycle and that the program takes exactlymax(K, L, M)cycles.ifThe
ifprogram must ensure that thethenandelsebranches start executing in the same cycle:The program takes
max(K, L)cycles and either branch is guaranteed to start in the same when theifprogram starts.whileThe scheduling guarantee of
whileextends to repeated executions. If the body takesKcycles, then the next iteration must start on cycleK+1and the program takesn*Kcycles wherenis the number of iterations.Beta Was this translation helpful? Give feedback.
All reactions