Skip to content

Commit dad9c29

Browse files
upload
1 parent 43c2e2d commit dad9c29

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

test/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
SIM ?= icarus
66
TOPLEVEL_LANG ?= verilog
77
SRC_DIR = $(PWD)/../src
8-
PROJECT_SOURCES = project.v
8+
PROJECT_SOURCES = project.v testchain.v cinv.v
99

1010
ifneq ($(GATES),yes)
1111

test/test.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,30 @@ async def test_project(dut):
2525

2626
dut._log.info("Test project behavior")
2727

28-
# Set the input values you want to test
29-
dut.ui_in.value = 20
30-
dut.uio_in.value = 30
28+
# scan mode
29+
dut.uio_in.value = 0
30+
31+
for l in range(0,9):
32+
dut.ui_in.value = 255
33+
await ClockCycles(dut.clk, 1)
34+
dut.ui_in.value = 0
35+
await ClockCycles(dut.clk, 1)
3136

32-
# Wait for one clock cycle to see the output values
33-
await ClockCycles(dut.clk, 1)
37+
# test mode
38+
dut.uio_in.value = 1
39+
dut.ui_in.value = 255
40+
await ClockCycles(dut.clk, 1) # arming cycle
41+
await ClockCycles(dut.clk, 1) # measuring cycle
42+
43+
# scan out
44+
dut.uio_in.value = 0
45+
46+
for p in range(0,12):
47+
dut._log.info(f"uo_out = {dut.uo_out.value}")
48+
await ClockCycles(dut.clk, 1)
49+
dut._log.info(f"uo_out = {dut.uo_out.value}")
50+
await ClockCycles(dut.clk, 1)
3451

35-
# The following assersion is just an example of how to check the output values.
36-
# Change it to match the actual expected output of your module:
37-
assert dut.uo_out.value == 50
52+
assert 1 == 1
3853

39-
# Keep testing the module by changing the input values, waiting for
40-
# one or more clock cycles, and asserting the expected output values.
54+

0 commit comments

Comments
 (0)