calyx icon indicating copy to clipboard operation
calyx copied to clipboard

eDSL: issue warning when user creates guard conjunctions involving `done` signals

Open anshumanmohan opened this issue 8 months ago • 0 comments

As #2131 explains, it is a bad idea to create a group like so:

with comp.group("big_group") as big_group:
    ...
    foo.in_ = ...
    bar.in_ = ...
    ...
    big_group.done = (foo.done & bar.done) @ 1

This is a bad idea because now big_group's done condition is actually subtly requiring foo and bar to be done on some same cycle. Combine this with the fact that individual cells may only be required to raise their done signals for one cycle (not perpetuity), and you have a problem.

In #2131 I went through existing eDSL programs and massaged away this structure where I saw it. This issue is to request a warning at the eDSL level when the user tries to write a create a guard conjunction involving multiple done signals.

I will note, however, that guard conjunction is not itself verboten; there are plenty of bona-fide uses, including in the creation of done signals. We just want to issue a warning and an explanation when the conjuncts themselves are done signals.

anshumanmohan avatar Jun 13 '24 14:06 anshumanmohan