bank/description: pad unaligned multi-word registers at the top

This commit is contained in:
Sebastien Bourdeauducq 2012-05-21 22:55:23 +02:00
parent 9449bbea0a
commit 493b181af1

View file

@ -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