-
Notifications
You must be signed in to change notification settings - Fork 43
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
hwset on multibit field #99
Comments
In SystemVerilog, the logic [31:0] example;
// The following two lines are equivalent
assign example = '1;
assign example = 32'hFFFFFFFF;
// Not to be confused with:
assign example = 1;
// which is identical to:
assign example = 32'h00000001; |
Sorry, yes, that's correct; however, my expectation was that the That being said, the spec says "set the field (hwclr and hwset) by asserting a single pin" and so perhaps my expectation is wrong. Allowing each bit to be set independently seems more useful than setting all bits, but perhaps my use case is unusual. Is there a better way to accomplish this? Do I need to manually add 32 1-bit fields with the |
Ah I see. I misunderstood your question. That is correct - for the Aside from splitting to individual 1-bit fields, if you want to set individual bits in a field you probably have to handle this outside of the regblock. I can't think of a good way to do it entirely in RDL. One way would be using the hardware write-enable mechanism:
Then in RTL use the write-enable to apply the updated per-bit set behavior: assign hwif_in.a.b.we = |my_bit_set_vector;
assign hwif_in.a.b.next = my_bit_set_vector | hwif_out.a.b.value; |
Thank you! And thanks for PeakRDL! Would you be open to a PR which added an option for this? I'm not sure if I'm going to take that on right now, still evaluating, but thinking about it. It's useful enough to us. |
Sure! I can see how this could be useful. This would definitely have to be a separate property. Changing the behavior of I would recommend implementing this as separate user-defined properties like |
The
hwset
property does not work as I expect on multi-bit fields. Instead of ahwset
input port matching the width of the field, it is always a single bit, and sets the field to 1 regardless of the width.I feel like the spec is a bit unclear about this, so I'm not sure if this is a bug or as designed and matches the spec.
In the following minimal example, the 32-bit field
b
only gets a singlehwset
bit in the generated code:Command:
peakrdl regblock test.rdl -o .
test_pkg.sv:
test.sv:
The text was updated successfully, but these errors were encountered: