From 421adb4821a4e990a04d7b63d6fc610d7ed5fbba Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 16 May 2019 05:22:07 +0100 Subject: [PATCH] sync function unit src/dest --- src/experiment/compalu.py | 2 +- src/experiment/cscore.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/experiment/compalu.py b/src/experiment/compalu.py index cd781603..12e6a92f 100644 --- a/src/experiment/compalu.py +++ b/src/experiment/compalu.py @@ -54,7 +54,7 @@ class ComputationUnitNoDelay(Elaboratable): m.d.comb += self.busy_o.eq(opc_l.q) # busy out with m.If(src_l.q & (self.counter == 0)): - m.d.sync += self.counter.eq(3) + m.d.sync += self.counter.eq(2) with m.If(self.counter > 0): m.d.sync += self.counter.eq(self.counter - 1) with m.If((self.counter == 1) | (self.counter == 0)): diff --git a/src/experiment/cscore.py b/src/experiment/cscore.py index 4faa049a..ae44fb72 100644 --- a/src/experiment/cscore.py +++ b/src/experiment/cscore.py @@ -147,9 +147,9 @@ class Scoreboard(Elaboratable): fn_issue_l.append(fu.issue_i) fn_busy_l.append(fu.busy_o) m.d.sync += fu.issue_i.eq(issueunit.i.fn_issue_o[i]) - m.d.comb += fu.dest_i.eq(self.int_dest_i) - m.d.comb += fu.src1_i.eq(self.int_src1_i) - m.d.comb += fu.src2_i.eq(self.int_src2_i) + m.d.sync += fu.dest_i.eq(self.int_dest_i) + m.d.sync += fu.src1_i.eq(self.int_src1_i) + m.d.sync += fu.src2_i.eq(self.int_src2_i) # XXX sync, so as to stop a simulation infinite loop m.d.comb += issueunit.i.busy_i[i].eq(fu.busy_o) @@ -186,6 +186,7 @@ class Scoreboard(Elaboratable): with m.If(if_l[0].go_wr_i | if_l[1].go_wr_i): m.d.comb += int_dest.wen.eq(g_int_wr_pend_v.g_pend_o) #with m.If(intpick1.go_rd_o): + #with m.If(if_l[0].go_rd_i | if_l[1].go_rd_i): m.d.comb += int_src1.ren.eq(g_int_src1_pend_v.g_pend_o) m.d.comb += int_src2.ren.eq(g_int_src2_pend_v.g_pend_o) @@ -342,7 +343,7 @@ def scoreboard_sim(dut, alusim): dest = 7 #op = (i+1) % 2 - op = 0 + op = i print ("random %d: %d %d %d %d\n" % (i, op, src1, src2, dest)) yield from int_instr(dut, alusim, op, src1, src2, dest) -- 2.30.2