From 68551f2867076d730cf926cc46e162c41771e42a Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 23 May 2019 12:07:03 +0100 Subject: [PATCH] make shadow inputs/good/fail arrays (actual matrix now) --- src/scoreboard/shadow.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/scoreboard/shadow.py b/src/scoreboard/shadow.py index b35ed9e6..42e7823a 100644 --- a/src/scoreboard/shadow.py +++ b/src/scoreboard/shadow.py @@ -115,9 +115,12 @@ class ShadowMatrix(Elaboratable): # inputs self.issue_i = Signal(n_fus, 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) + self.shadow_i = Array(Signal(shadow_wid, name="sh_i", reset_less=True) \ + for f in range(n_fus)) + self.s_fail_i = Array(Signal(shadow_wid, name="f_i", reset_less=True) \ + for f in range(n_fus)) + self.s_good_i = Array(Signal(shadow_wid, name="g_i", reset_less=True) \ + for f in range(n_fus)) # outputs self.go_die_o = Signal(n_fus, reset_less=True) @@ -130,12 +133,10 @@ class ShadowMatrix(Elaboratable): sh = Shadow(self.shadow_wid) setattr(m.submodules, "sh%d" % i, sh) shadows.append(sh) - - # connect shadow/fail/good to all shadows - for l in shadows: - m.d.comb += l.s_fail_i.eq(self.s_fail_i) - m.d.comb += l.s_good_i.eq(self.s_good_i) - m.d.comb += l.shadow_i.eq(self.shadow_i) + # connect shadow/fail/good to all shadows + m.d.comb += sh.s_fail_i.eq(self.s_fail_i[i]) + m.d.comb += sh.s_good_i.eq(self.s_good_i[i]) + m.d.comb += sh.shadow_i.eq(self.shadow_i[i]) # connect all shadow outputs and issue input issue_l = [] @@ -153,9 +154,9 @@ class ShadowMatrix(Elaboratable): def __iter__(self): yield self.issue_i - yield self.shadow_i - yield self.s_fail_i - yield self.s_good_i + yield from self.shadow_i + yield from self.s_fail_i + yield from self.s_good_i yield self.go_die_o yield self.shadown_o -- 2.30.2