From: Luke Kenneth Casson Leighton Date: Thu, 30 May 2019 21:31:53 +0000 (+0100) Subject: leave off number being subtracted from "ready_o" calculation X-Git-Tag: div_pipeline~1920 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a3626c21002512a60a92d6b4a0a27d41622b5c8;p=soc.git leave off number being subtracted from "ready_o" calculation --- diff --git a/src/scoreboard/instruction_q.py b/src/scoreboard/instruction_q.py index f3be7669..f32a91ac 100644 --- a/src/scoreboard/instruction_q.py +++ b/src/scoreboard/instruction_q.py @@ -91,9 +91,9 @@ class InstructionQ(Elaboratable): 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 diff --git a/src/scoreboard/test_iq.py b/src/scoreboard/test_iq.py index 6bbb26db..3f1f9964 100644 --- a/src/scoreboard/test_iq.py +++ b/src/scoreboard/test_iq.py @@ -35,10 +35,10 @@ class IQSim: 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 @@ -62,6 +62,9 @@ class IQSim: def rcv(self): i = 0 + yield + yield + yield while i < len(self.iq): rcvlen = randint(1, self.n_out) #print ("outreq", rcvlen) @@ -92,7 +95,7 @@ def test_iq(): 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)