test/analyzer_tb: retrieve and print data

This commit is contained in:
Florent Kermarrec 2016-04-01 09:07:20 +02:00
parent b1b9e61ecf
commit 2539dce96f
2 changed files with 14 additions and 5 deletions

View File

@ -14,7 +14,7 @@ example_designs:
cd ../example_designs && $(PYTHON) make.py -t simple -p kc705 -Ob run False build-bitstream
cd ../example_designs && $(PYTHON) make.py -t core build-core
all: dump_tb example_designs
all: dump_tb analyzer_tb example_designs
clean:
rm -f dump.*

View File

@ -13,18 +13,27 @@ class TB(Module):
def main_generator(dut):
yield dut.analyzer.frontend.trigger.value.storage.eq(0x0080)
yield dut.analyzer.frontend.trigger.mask.storage.eq(0xfff0)
yield dut.analyzer.frontend.subsampler.value.storage.eq(1)
yield dut.analyzer.frontend.subsampler.value.storage.eq(0)
yield
yield dut.analyzer.storage.length.storage.eq(32)
yield dut.analyzer.storage.offset.storage.eq(16)
yield dut.analyzer.storage.length.storage.eq(64)
yield dut.analyzer.storage.offset.storage.eq(32)
for i in range(16):
yield
yield dut.analyzer.storage.start.re.eq(1)
yield
yield dut.analyzer.storage.start.re.eq(0)
yield
for i in range(1024):
while not (yield dut.analyzer.storage.idle.status):
yield
data = []
while (yield dut.analyzer.storage.mem_valid.status):
data.append((yield dut.analyzer.storage.mem_data.status))
yield dut.analyzer.storage.mem_ready.re.eq(1)
yield dut.analyzer.storage.mem_ready.r.eq(1)
yield
print(data)
print(len(data))
print(data[32])
if __name__ == "__main__":
tb = TB()