Skip to content

Commit

Permalink
Fix accidental blocking assignment in always_ff for read buffering st…
Browse files Browse the repository at this point in the history
…orage elements
  • Loading branch information
amykyta3 committed Jan 6, 2024
1 parent 6433cd1 commit 6a550ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Install from `PyPi`_ using pip

Example
-------
The easiest way is to use the `PeakRDL command line tool <https://peakrdl.readthedocs.io/>`_:
The easiest way to use PeakRDL-regblock is via the `PeakRDL command line tool <https://peakrdl.readthedocs.io/>`_:

.. code-block:: bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ def get_assignments(self, node: RegNode) -> str:
for field in node.fields():
if bidx < field.low:
# zero padding before field
s.append(f"{data}[{field.low-1}:{bidx}] = '0;")
s.append(f"{data}[{field.low-1}:{bidx}] <= '0;")

value = self.exp.dereferencer.get_value(field)
if field.msb < field.lsb:
# Field gets bitswapped since it is in [low:high] orientation
value = f"{{<<{{{value}}}}}"
s.append(f"{data}[{field.high}:{field.low}] = {value};")
s.append(f"{data}[{field.high}:{field.low}] <= {value};")

bidx = field.high + 1

regwidth = node.get_property('regwidth')
if bidx < regwidth:
# zero padding after last field
s.append(f"{data}[{regwidth-1}:{bidx}] = '0;")
s.append(f"{data}[{regwidth-1}:{bidx}] <= '0;")

return "\n".join(s)

0 comments on commit 6a550ab

Please sign in to comment.