From 2a6fe372bce38df4ed3501ff114d7e4acf41262f Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 24 May 2019 07:55:06 +0100 Subject: [PATCH] cleanup, docstrings --- src/experiment/cscore.py | 2 -- src/experiment/score6600.py | 24 ++++++++---------------- src/scoreboard/shadow.py | 3 +++ 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/experiment/cscore.py b/src/experiment/cscore.py index ff66b91e..18b71c80 100644 --- a/src/experiment/cscore.py +++ b/src/experiment/cscore.py @@ -161,8 +161,6 @@ class Scoreboard(Elaboratable): # connect Function Units #--------- - # XXX sync, again to avoid an infinite loop. is it the right thing??? - # Group Picker... done manually for now. TODO: cat array of pick sigs m.d.comb += if_l[0].go_rd_i.eq(intpick1.go_rd_o[0]) # add rd m.d.comb += if_l[0].go_wr_i.eq(intpick1.go_wr_o[0]) # add wr diff --git a/src/experiment/score6600.py b/src/experiment/score6600.py index d67325cb..1ac6ec11 100644 --- a/src/experiment/score6600.py +++ b/src/experiment/score6600.py @@ -237,14 +237,12 @@ class Scoreboard(Elaboratable): # Shadow Matrix. currently n_int_fus shadows, to be used for # write-after-write hazards m.submodules.shadows = shadows = ShadowMatrix(n_int_fus, n_int_fus) + # combined go_rd/wr + go_die (go_die used to reset latches) go_rd_rst = Signal(n_int_fus, reset_less=True) go_wr_rst = Signal(n_int_fus, reset_less=True) - - # Write-after-Write grid: selects one shadow to enable, based - # on which unit(s) have writes pending and the current instruction - # also needing to write - m.submodules.wawgrid = wawgrid = WaWGrid(n_int_fus, n_int_fus) + # record previous instruction to cast shadow on current instruction fn_issue_prev = Signal(n_int_fus) + prev_shadow = Signal(n_int_fus) #--------- # ok start wiring things together... @@ -330,17 +328,11 @@ class Scoreboard(Elaboratable): with m.If(fn_issue_o): # only update prev bit if instruction issued m.d.sync += fn_issue_prev.eq(fn_issue_o) - # now the "2D-bit-array-linked-list" can be created, with the - # relationships of the previous and current instruction. - # *previous* instruction shadows *current* instruction - #m.d.comb += wawgrid.shadow_i.eq(fn_issue_prev & cu.busy_o & ~fn_issue_o) - #m.d.comb += wawgrid.fu_i.eq(fn_issue_o) - - # and now we can connect the wawgrid to the shadow matrix. whewww + # *previous* instruction shadows *current* instruction, and, obviously, + # if the previous is completed (!busy) don't cast the shadow! + m.d.comb += prev_shadow.eq(~fn_issue_o & fn_issue_prev & cu.busy_o) for i in range(n_int_fus): - m.d.comb += shadows.shadow_i[i].eq(\ - ~fn_issue_o & fn_issue_prev & cu.busy_o) - #m.d.comb += shadows.shadow_i[i].eq(wawgrid.waw_o[i]) + m.d.comb += shadows.shadow_i[i].eq(prev_shadow) #--------- # Connect Register File(s) @@ -448,7 +440,7 @@ def scoreboard_sim(dut, alusim): yield dut.int_store_i.eq(1) - for i in range(20): + for i in range(2): # set random values in the registers for i in range(1, dut.n_regs): diff --git a/src/scoreboard/shadow.py b/src/scoreboard/shadow.py index 8b6a1143..f0908c64 100644 --- a/src/scoreboard/shadow.py +++ b/src/scoreboard/shadow.py @@ -25,13 +25,16 @@ class Shadow(Elaboratable): self.shadow_wid = shadow_wid if shadow_wid: + # inputs self.issue_i = Signal(reset_less=True) self.shadow_i = Signal(shadow_wid, reset_less=True) self.s_fail_i = Signal(shadow_wid, reset_less=True) self.s_good_i = Signal(shadow_wid, reset_less=True) + # outputs self.go_die_o = Signal(reset_less=True) self.shadown_o = Signal(reset_less=True) else: + # outputs when no shadowing needed self.shadown_o = Const(1) self.go_die_o = Const(0) -- 2.30.2