tb: Fix incorrect valid in send_recovered_bits
At the end of the bitstream, we might not have enough bits for valid=2.
If we don't change it to valid=1, instead of marking an X as valid.
Fixes: d351291
("Initial commit")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
parent
6800b85a85
commit
15ae994ad6
|
@ -90,11 +90,11 @@ class saw_valid:
|
|||
return self.last
|
||||
|
||||
async def send_recovered_bits(clk, data, valid, bits, valids):
|
||||
bits = iter(bits)
|
||||
await FallingEdge(clk)
|
||||
try:
|
||||
while True:
|
||||
v = valids()
|
||||
valid.value = v
|
||||
if v == 0:
|
||||
d = 'XX'
|
||||
elif v == 1:
|
||||
|
@ -105,8 +105,10 @@ async def send_recovered_bits(clk, data, valid, bits, valids):
|
|||
second = next(bits)
|
||||
except StopIteration:
|
||||
second = 'X'
|
||||
v = 1
|
||||
d = (first, second)
|
||||
data.value = LogicArray(d)
|
||||
valid.value = v
|
||||
await FallingEdge(clk)
|
||||
except StopIteration:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue