Skip to content

Commit

Permalink
Structs multireg fix (#466)
Browse files Browse the repository at this point in the history
fix bug for multireg
  • Loading branch information
StefanoAlbini96 authored Mar 5, 2024
1 parent 88c8919 commit 01c514c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/structs_gen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import hjson
from math import ceil
import string
import argparse
import sys
Expand Down Expand Up @@ -297,7 +298,7 @@ def add_registers(peripheral_json):
n_bits += count_bits(f["bits"])

# computes the number of registers needed to pack all the bit fields needed
n_multireg = int((count * n_bits) / int(peripheral_json["regwidth"]))
n_multireg = ceil((count * n_bits) / int(peripheral_json["regwidth"]))

# generate the multiregisters
for r in range(n_multireg):
Expand Down

0 comments on commit 01c514c

Please sign in to comment.