comb += self.n_sub_o.eq(self.n_sub_i)
# work out how many new items are going to be in the queue
- comb += left.eq(self.qlen_o - self.n_sub_o)
+ comb += left.eq(self.qlen_o )#- self.n_sub_o)
comb += spare.eq(mqlen - self.p_add_i)
- comb += qmaxed.eq(left < spare)
+ comb += qmaxed.eq(left <= spare)
comb += self.p_ready_o.eq(qmaxed & (self.p_add_i != 0))
# put q (flattened) into output
o_p_ready = yield self.dut.p_ready_o
yield
+ yield self.dut.p_add_i.eq(0)
print ("send", len(self.iq), i, sendlen)
- yield self.dut.p_add_i.eq(0)
# wait random period of time before queueing another value
for j in range(randint(0, 3)):
yield
def rcv(self):
i = 0
+ yield
+ yield
+ yield
while i < len(self.iq):
rcvlen = randint(1, self.n_out)
#print ("outreq", rcvlen)
wid = 8
opwid = 4
qlen = 5
- n_in = 2
+ n_in = 3
n_out = 3
dut = InstructionQ(wid, opwid, qlen, n_in, n_out)
insns = mk_insns(10, wid, opwid)