test: correct DMAReaderDriver/DMAWriterDriver logic

This commit is contained in:
Jędrzej Boczar 2020-03-17 15:37:50 +01:00
parent 6ef623efae
commit 36d5b42aa0
1 changed files with 4 additions and 8 deletions

View File

@ -95,8 +95,7 @@ class DMAWriterDriver:
yield self.dma.sink.data.eq(data)
while not (yield self.dma.sink.ready):
yield
while (yield self.dma.sink.ready):
yield
yield
yield self.dma.sink.valid.eq(0)
@staticmethod
@ -104,8 +103,7 @@ class DMAWriterDriver:
for _ in range(n):
while not (yield port.wdata.ready):
yield
while (yield port.wdata.ready):
yield
yield
class DMAReaderDriver:
@ -130,10 +128,8 @@ class DMAReaderDriver:
def read_handler(self):
yield self.dma.source.ready.eq(1)
while True:
while not (yield self.dma.source.valid):
yield
data = (yield self.dma.source.data)
self.data.append(data)
if (yield self.dma.source.valid):
self.data.append((yield self.dma.source.data))
yield