Hdl21 icon indicating copy to clipboard operation
Hdl21 copied to clipboard

Allow zero-arg `h.generator`

Open dan-fritchman opened this issue 2 years ago • 2 comments

Currently to make an argument-less Generator, you need to actually declare a parameter and give it a type. Often h.HasNoParams is used for the latter, like so:

@h.generator
def PmosIdac(_: h.HasNoParams) -> h.Module:
  # ...

The issue: we should be able to just write

@h.generator
def PmosIdac() -> h.Module: # <= here
  # ...

We do enough inspection of the Generator call-signature already, and lots of tuning when we invoke them during elaboration. This should be a pretty straightforward case to add.

dan-fritchman avatar Dec 20 '22 23:12 dan-fritchman