Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fixup and update #75

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 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 @@ -95,9 +87,6 @@ def phy_gen(dut, addr, data):

yield
yield dut.sink.valid.eq(1)
while (yield dut.source.valid) == 0:
yield
yield dut.sink.valid.eq(0)
yield
addr = 0xcafe
data = 0xdeadbeef
Expand All @@ -116,15 +105,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
Loading