A collection of apps
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
410 B

2 years ago
  1. import itertools
  2. import cocotb
  3. from cocotb.clock import Clock
  4. from cocotb.triggers import Timer
  5. @cocotb.test()
  6. def test_adder4_reg(dut):
  7. cocotb.fork(Clock(dut.clk, 10, units='ns').start())
  8. yield Timer(5, units='ns')
  9. for b, a in itertools.product(range(2 ** 4), repeat=2):
  10. dut.a = a
  11. dut.b = b
  12. yield Timer(10, units='ns')
  13. z = a + b
  14. assert z == dut.z