From 942300f4370f1b201a8c532f69c80aa1b0a05880 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 9 Aug 2020 16:25:24 +0100 Subject: [PATCH] get rid of MSR read combinatorial loop --- src/soc/simple/issuer.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/soc/simple/issuer.py b/src/soc/simple/issuer.py index cfc0be48..31bd5ab7 100644 --- a/src/soc/simple/issuer.py +++ b/src/soc/simple/issuer.py @@ -114,9 +114,6 @@ class TestIssuer(Elaboratable): comb += self.pc_o.eq(cur_state.pc) ilatch = Signal(32) - # MSR - msr = Signal(64, reset_less=True) - # next instruction (+4 on current) nia = Signal(64, reset_less=True) comb += nia.eq(cur_state.pc + 4) @@ -149,6 +146,9 @@ class TestIssuer(Elaboratable): insn_type = core.pdecode2.e.do.insn_type insn_state = core.pdecode2.state + # don't read msr every cycle + sync += self.fast_r_msr.ren.eq(0) + # actually use a nmigen FSM for the first time (w00t) # this FSM is perhaps unusual in that it detects conditions # then "holds" information, combinatorially, for the core @@ -168,6 +168,11 @@ class TestIssuer(Elaboratable): comb += self.imem.a_valid_i.eq(1) comb += self.imem.f_valid_i.eq(1) sync += cur_state.pc.eq(pc) + + # read MSR, latch it, and put it in decode "state" + sync += self.fast_r_msr.ren.eq(1<