Skip to content

Commit

Permalink
tests: mmap: simplify wishbone operations
Browse files Browse the repository at this point in the history
simplify wishbone operations.

Signed-off-by: Fin Maaß <[email protected]>
  • Loading branch information
maass-hamburg committed Sep 16, 2024
1 parent 6ab6cbd commit 9411b79
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions test/test_spi_mmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,7 @@ def wb_gen(dut, addr, data, offset):
dut.done = 0

yield dut.offset.eq(offset)
yield dut.bus.adr.eq(addr + offset)
print((yield dut.bus.adr))
yield dut.bus.we.eq(1)
yield dut.bus.cyc.eq(1)
yield dut.bus.stb.eq(1)
yield dut.bus.dat_w.eq(data)

while (yield dut.bus.ack) == 0:
yield
yield from dut.bus.write(addr + offset, data)

dut.done = 1

Expand Down Expand Up @@ -116,15 +108,9 @@ def test_spi_mmap_read_test(self):
def wb_gen(dut, addr, data):
dut.data_ok = 0

yield dut.bus.adr.eq(addr)
yield dut.bus.we.eq(0)
yield dut.bus.cyc.eq(1)
yield dut.bus.stb.eq(1)
dat = yield from dut.bus.read(addr)

while (yield dut.bus.ack) == 0:
yield
print((yield dut.bus.dat_r))
if (yield dut.bus.dat_r) == data:
if dat == data:
dut.data_ok = 1

def phy_gen(dut, addr, data):
Expand Down

0 comments on commit 9411b79

Please sign in to comment.