return list(self)
def run_op(dut, a, b, op, inv_a=0):
+ from nmigen.back.pysim import Settle
yield dut.a.eq(a)
yield dut.b.eq(b)
yield dut.op.insn_type.eq(op)
yield dut.op.invert_a.eq(inv_a)
yield dut.n.ready_i.eq(0)
yield dut.p.valid_i.eq(1)
- yield
# if valid_o rose on the very first cycle, it is a
# zero-delay ALU
+ yield Settle()
vld = yield dut.n.valid_o
if vld:
# special case for zero-delay ALU
yield
return result
+ yield
+
# wait for the ALU to accept our input data
while True:
rdy = yield dut.p.ready_o
# wait for the ALU to present the output data
while True:
+ yield Settle()
vld = yield dut.n.valid_o
if vld:
break