From 670aebacd24b5ba79fd842ac6b8043aea9a04e2f Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sat, 28 Oct 2023 00:16:09 -0600 Subject: tb: add block test: test_fb --- tb/top/test_fb.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tb/top/test_fb.py (limited to 'tb/top') diff --git a/tb/top/test_fb.py b/tb/top/test_fb.py new file mode 100644 index 0000000..c7bbddf --- /dev/null +++ b/tb/top/test_fb.py @@ -0,0 +1,28 @@ +import struct + +import cocotb +from cocotb.clock import Clock +from cocotb.triggers import Combine, ClockCycles, RisingEdge, Timer, with_timeout +from cocotb_bus.drivers.avalon import AvalonMaster + +@cocotb.test() +async def fp_mat_mul(dut): + await cocotb.start(Clock(dut.clk, 2).start()) + + dut.rst_n.value = 1 + await Timer(1) + dut.rst_n.value = 0 + await Timer(1) + dut.rst_n.value = 1 + + master = AvalonMaster(dut, 'cmd', dut.clk, case_insensitive=False) + + for i in range(32): + await master.write(i, int.from_bytes(struct.pack('