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.

28 lines
661 B

import itertools
import cocotb
from cocotb.clock import Clock
from cocotb.triggers import Timer
def test_and8_reg_arst(dut):
cocotb.fork(Clock(dut.clk, 10, units='ns').start())
yield Timer(5, units='ns')
dut.rst = True
yield Timer(10, units='ns')
dut.rst = False
assert dut.z == False
for h, g, f, e, d, c, b, a in itertools.product((False, True), repeat=8):
dut.a = a
dut.b = b
dut.c = c
dut.d = d
dut.e = e
dut.f = f
dut.g = g
dut.h = h
yield Timer(10, units='ns')
z = a & b & c & d & e & f & g & h
assert z == dut.z