mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
bank/description: pad unaligned multi-word registers at the top
This commit is contained in:
parent
9449bbea0a
commit
493b181af1
1 changed files with 7 additions and 0 deletions
|
@ -61,6 +61,13 @@ def expand_description(description, busword):
|
|||
for field in reg.fields:
|
||||
size += field.size
|
||||
if size > busword:
|
||||
# add padding
|
||||
totalsize = sum([field.size for field in reg.fields])
|
||||
padding = busword - (totalsize % busword)
|
||||
if padding == busword:
|
||||
padding = 0
|
||||
size += padding
|
||||
|
||||
top = field.size
|
||||
while size > busword:
|
||||
slice1 = busword - size + top
|
||||
|
|
Loading…
Reference in a new issue