mirror of
https://github.com/Silicon1602/srdl2sv.git
synced 2024-12-22 06:58:41 +00:00
Fix bug introduced in 95b9a5a4
that broke registers with just 1 byte
This commit is contained in:
parent
9be761b53d
commit
85dc71919e
@ -219,9 +219,15 @@ class Register(Component):
|
||||
|
||||
bytes_read_format = []
|
||||
bytes_read_sorted = sorted(bytes_read, reverse = True)
|
||||
prev = msb = bytes_read_sorted[0]
|
||||
|
||||
for i in bytes_read_sorted[1:]:
|
||||
try:
|
||||
prev = msb = bytes_read_sorted[0]
|
||||
except IndexError:
|
||||
# Do nothing. bytes_written simply didn't exist
|
||||
# The loop below will simply not be entered
|
||||
pass
|
||||
|
||||
for i in bytes_read_sorted[0:]:
|
||||
if prev - i > 1:
|
||||
bytes_read_format.append(
|
||||
f"|{wdgt_str}[{msb}:{prev}]" if msb > prev else f"{wdgt_str}[{msb}]")
|
||||
@ -235,9 +241,15 @@ class Register(Component):
|
||||
|
||||
bytes_written_format = []
|
||||
bytes_written_sorted = sorted(bytes_written, reverse = True)
|
||||
prev = msb = bytes_written_sorted[0]
|
||||
|
||||
for i in bytes_written_sorted[1:]:
|
||||
try:
|
||||
prev = msb = bytes_written_sorted[0]
|
||||
except IndexError:
|
||||
# Do nothing. bytes_written simply didn't exist
|
||||
# The loop below will simply not be entered
|
||||
pass
|
||||
|
||||
for i in bytes_written_sorted[0:]:
|
||||
if prev - i > 1:
|
||||
bytes_written_format.append(
|
||||
f"|{wdgt_str}[{msb}:{prev}]" if msb > prev else f"{wdgt_str}[{msb}]")
|
||||
|
Loading…
Reference in New Issue
Block a user