You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in which I think addr_width = (node.size-1).bit_length() is correct.
I see that under utils.py you have a clog2 function and I think it would be most appropriate to use that where possible.
Additionally, I'd think it would be appropriate to use clog2 in peakrdl_regblock/hwif/generators.py, under OutputStructGenerator_Hier::_add_external_block_members: self.add_member("addr", (node.size - 1).bit_length()) should be (I think) self.add_member("addr", clog2(node.size)).
Thanks,
Aylon
The text was updated successfully, but these errors were encountered:
Hello,
I think there's an improper bit select within the external memory template when it comes to setting the external bus's address.
For the following RDL file:
The generated code gives the external memory interface struct as:
in where the
addr
field has the correct address width.However in the module file we see:
The bit select on
decoded_addr
is too wide and should be[9:0]
.The root of the issue seems to lie in
src/peakrdl_regblock/field_logic/generators.py
'sFieldLogicGenerator::assign_external_block_outputs
:in which I think
addr_width = (node.size-1).bit_length()
is correct.I see that under
utils.py
you have aclog2
function and I think it would be most appropriate to use that where possible.Additionally, I'd think it would be appropriate to use
clog2
inpeakrdl_regblock/hwif/generators.py
, underOutputStructGenerator_Hier::_add_external_block_members
:self.add_member("addr", (node.size - 1).bit_length())
should be (I think)self.add_member("addr", clog2(node.size))
.Thanks,
Aylon
The text was updated successfully, but these errors were encountered: