calyx icon indicating copy to clipboard operation
calyx copied to clipboard

Support `new_fsm` attribute for tdst pass

Open calebmkim opened this issue 2 years ago • 7 comments

In the same way that the new_fsm attribute prevents fsm complexity blow up in the tdcc pass, we might want to add support for the attribute when compiling tdst as well. I can try to implement this, since it will probably be helpful for me to better understand tdst, especially if I'm trying to implement some of the new static group syntax (w/ the % relative clock cycles thing).

calebmkim avatar Feb 16 '23 17:02 calebmkim

You can take a shot but the big problem is that the static FSMs don't reset correctly which means you can't compositionally compile the program. This is why our current implementation is so restrictive (one component, completely static).

The problem is that there is no good way (that I know of) to build a static FSM that provides both a done condition and resets correctly so that it can be re-executed in the same cycle.

To observe this problem, you can run the code mentioned in the fix-tdst PR. Uncomment the code and delete the stuff before and after the loop. If you look at the generated VCD, you'll notice that the inner if branches don't reset in time to be re-executed every cycle.

rachitnigam avatar Feb 16 '23 18:02 rachitnigam

Ah I see. Maybe this is something that would be better to implement once the static group stuff is more developed.

calebmkim avatar Feb 16 '23 21:02 calebmkim

I'm going to make this task blocked on the static timing implementation

rachitnigam avatar Mar 06 '23 19:03 rachitnigam

Blocked on #1344

rachitnigam avatar Mar 06 '23 19:03 rachitnigam

@calebmkim did we decide that this doesn't need to be solved or that it isn't obvious what it means in the context of the new static lowering pass?

rachitnigam avatar Jun 27 '23 01:06 rachitnigam

We never fully reached a conclusion, but rn I'm leaning towards it not needing to be solved. I explain why I think that here. (although in the comment, you mention that it's possible that there may be some benefit to inlining static control w/ new fsms).

calebmkim avatar Jun 27 '23 11:06 calebmkim

Right! Maybe we should mark this as a low priority QoR thing to investigate if we have the time?

rachitnigam avatar Jun 27 '23 12:06 rachitnigam

This discussion is subsumed by the overall FSM optimizations discussion described in #2020.

calebmkim avatar May 13 '24 12:05 calebmkim