-
Notifications
You must be signed in to change notification settings - Fork 140
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
mkRegFileFullLoad
does not actually Load
if index_t
is 0 bits.
#643
Comments
Interesting. Thanks for reporting! A new Verilog primitive would be reasonable. I first wondered whether it should be I then wondered if it shouldn't be |
Two other things: (1) A new primitive would need to be added for Bluesim as well. (2) If it's billed as a register, then it should probably be added to the register inlining stage. And, well, (3) tests for Verilog, Bluesim, and inlining would be needed. (It may also be worth testing it in BDW -- I don't think any special handling is needed there, but worth checking.) Adding a new Verilog primitive is incredibly simple. Adding it for Bluesim and inlining would add a little more work, but should be straightforward. |
To be honest, I am not exactly sure what I am suggesting specifically. It does feel intuitively like a Reg should load on reset.. but I think I would have said the same for a RegFile... but they don't, so my intuition might be off? Maybe a |
Does your use case involve the block that uses this register ever getting synthesized? (Assuming you can share that much, of course.) Off the top of my head, I can think of three use cases:
For the first it probably makes no difference what one does, but for the second and third one might want to at least consider interaction with various synthesis and backend tools. Also, if this ends up being implemented for “normal” registers, I'm not sure I'd want them to be inlined. If they're separate modules, I could swap them out for other reg modules without the |
TL;DR: Longer answer: |
What we could do for now is put an assertion in the I'd suggest changing |
Note that the existing register modules already have |
I wonder if just a warningM would probably be sufficient to save the debugging time. |
So.... I acknowledge that this is a bit of a silly thing to want to do...
But I do actually have reasons... I promise. :-)
I traced the issue down to the wrapRegFile function in RegFile.bs:
Specifically, this bit:
(Lines 90~98)
When
si
(the size in bits of theindex_t
parameter) is0
, then it just creates a register, since RegFile.v can't handle the address size being 0 bits.But, if the module being wrapped is
mkRegFileFullLoad
(or presumablymkRegFileLoad
) then the "Load" part does not get implemented, and the file is never read.The most obvious solution (if this is worth fixing at all), it to make some
Load
variants of some registers (at leastmkRegLoad
andmkConfigRegULoad
), and use those in place of themkConfigRegU
andmkRegU
on line 94.I dunno if it is worth fixing, but it should be a pretty easy thing to do.
And who knows... Maybe "Load" variants of registers are also useful things for some people (like me). :-)
What do you think?
The text was updated successfully, but these errors were encountered: