-
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
Deprecating @static
and what to replace it with
#1896
Comments
@static
and What to replace it with@static
and what to replace it with
One tricky part with this will be supporting early-resetting in such components. You'd basically end up needing to generate shift-register-based FSMs instead of the normal single-register FSMs we generate. |
Maybe this warrants a synchronous discussion, but could you elaborate on why this is: in particular, in what situations we need shift-register-based FSMs? If it's pipelining that you're thinking about, I I thought we'd be fine since the FSMs only need to count up to the II of the component, not the latency. So during a given invocation of the component, we would have just a single FSM that is able to coordinate the execution of all the pipeline stages. But you may be thinking of something different. Also, for components with an Also, it's possible I'm just misinterpreting what you mean by "early-resettings" and my comments just don't make sense. |
Well, one of the problems with early resetting is that we cant support both early resets and done signals right? If this is not true the. i'm wrong. If this is true, then we need some other mechanism to generate both early resets and done signals which shift registers would do. |
We currently support this similar to how we compile the wrapper for static control, using a The exact logic for how we set the |
@calebmkim is this considered resolved with #1897 |
Closed with #1897 |
(Please let me know if any of this is unclear)
Continuing on #1429, I have a PR that is close to being ready to deprecate
@static
. If we merge the PR, this is what the state of static will/should be:static<n>
andpromotable
static<n>
can go on groups, control, and components to provide a guarantee for static timing (this is unchanged from before). When placed on a component, it provides nodone
signal. You assert thego
signal on the 0th cycle, and get the result on the nth cycle.@promotable(n)
can go on groups, control, andgo
ports of components to provide a hint for static timing. This provides no timing guarantees. When placed on components, the interface is still dynamic: you assert thego
signal until thedone
signal is high, at which point the result is ready. Because@promotable
is just a hint, you can not, for example,static invoke
a component even if it has a@promotable
attribute.@interval
for double-dutyHowever, we have some components (like registers) which we would like to be able to serve double-duty (can be invoked in both static and dynamic contexts). We also (I think?) want Calyx components, not just primitives, to be able to serve double-duty as well. Therefore, we introduce a new attribute,
@interval(n)
, which can be placed on the@go
ports of registers, multipliers, and any other components we wish to be capable of double duty. The interface for@interval(n)
is the following:go
for cycles [0,n). On the nth cycle, thedone
signal will be high and the output will be ready.This has a few consequences:
@interval(n)
, the control must bestatic<n>
(it can't just be@promotable
, since@promotable
could be ignored), or it must contain continuous assignments (in which case they operate kind of like Verilog primitives).@interval(n)
, you canstatic invoke
it. This allows us tostatic invoke
registers, for example. 1.loose ends
The way static promotion currently works is that, it upgrades dynamic components to
static<n>
components, and adds an attribute@promoted
to it, which tells the component to provide adone
signal, since the promoted component still may be used in dynamic contexts. Here is the interface that these components obey:go
on the 0th cycle, and then on the nth cycle, thedone
signal will be high and the output will be ready.A few notes:
go
signal (i.e., thego
signal doesn't have to guard every assignment in the component anymore).@interval(n)
components "under the hood". In other words, we treat@interval
components like a component we just promoted to static (i.e. we treat it like astatic<n>
that still must produce adone
signal).go
signals in certain components.Footnotes
When compiling these
static invoke comp
, we guardcomp.go = %0 ? 1
if we have astatic<n> comp
and we guardcomp.go =1
if we have an@interval
comp. ↩The text was updated successfully, but these errors were encountered: