kuznia-rdzeni / coreblocks

RISC-V out-of-order core for education and research purposes
https://kuznia-rdzeni.github.io/coreblocks/
BSD 3-Clause "New" or "Revised" License
33 stars 13 forks source link

Cannot specify `enable` signal when calling a method #686

Closed xThaid closed 2 months ago

xThaid commented 2 months ago

It is impossible to specify enable signal when calling a method with keyword arguments, i.e.

method(m, enable=C(0), data=123)

The current code treats enable as another argument and then we get an error:

KeyError: 'Field enable not present in lhs'
tilk commented 2 months ago

The enable argument is currently positional only. You could write:

method(m, None, C(0), data=123)

Which is not great. But if it wasn't positional only, the enable name couldn't be used for an argument, and also calls with the enable written in the middle of other arguments would look weird.

Currently, using m.If is preferred to using the enable argument.

xThaid commented 2 months ago

I see now. It seems that we could remove enable argument altogether in favor of m.If, as enable arg is not used widely in coreblocks.

I am closing this issue for now.