You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Top down static timing is a reimplementation of the old static-timing pass that generates latency-sensitive FSMs for control sub-programs with an inferred static annotation.
As a first requirement, we need the infer-static-timing pass to run and annotate the control program with @static annotations. Next, we need to define compilation functions for each container operators: seq, par, if, and while because a control sub-program can start with any one of these. enable and invoke are leaf nodes and therefore only make sense in the context of one of these.
Example
Given a program like this:
@static(4) seq {
@static(3) if lt.out {
@static(2) one
} else {
@static(1) two
}
@static(1) three
}
Note: infer-static-timing gives max(tru, fal) + 1 cycles to the latency of an if. This is not necessarily a good choice specially in the case when the branches are unbalanced.
We want to generate an FSM that executes each group for exactly the right number of cycles:
Building a structure that computes which groups need to be activated when.
Realizing it into structural assignments.
Handling par
The big difference between TopDownCompileControl and this pass is that statically timed par blocks do not need to create a separate FSM for each child because we know exactly how long they need to run for:
Note the assignments for three and four which need to basically propagate the par start time into the seq. This kind of nested FSM state generation will show up for all container operators.
Top Down Static Timing
Top down static timing is a reimplementation of the old
static-timing
pass that generates latency-sensitive FSMs for control sub-programs with an inferred static annotation.As a first requirement, we need the
infer-static-timing
pass to run and annotate the control program with@static
annotations. Next, we need to define compilation functions for each container operators:seq
,par
,if
, andwhile
because a control sub-program can start with any one of these.enable
andinvoke
are leaf nodes and therefore only make sense in the context of one of these.Example
Given a program like this:
Note:
infer-static-timing
givesmax(tru, fal) + 1
cycles to the latency of anif
. This is not necessarily a good choice specially in the case when the branches are unbalanced.We want to generate an FSM that executes each group for exactly the right number of cycles:
Like in the TopDownCompileControl pass, we should separate this in two steps:
Handling
par
The big difference between TopDownCompileControl and this pass is that statically timed
par
blocks do not need to create a separate FSM for each child because we know exactly how long they need to run for:Works with the following FSM:
Note the assignments for
three
andfour
which need to basically propagate thepar
start time into theseq
. This kind of nested FSM state generation will show up for all container operators.Resources
The following methods might be useful:
TopDownCompileControl::compute_unique_ids
TopDownCompileControl::Schedule::realize_schedule
TopDownCompileControl::calculate_states_recur
TODO
-d static-timing
flag to "correctness dynamic" tests-d static-timing
flag totests/regressions/group-multi-drive.futil
examples/tutorial/language-tutorial-compute
is slower withtdcc
which shouldn't be the case.par
compilation.The text was updated successfully, but these errors were encountered: