From: Luke Kenneth Casson Leighton Date: Tue, 8 Sep 2020 13:09:35 +0000 (+0100) Subject: pass in state into PowerDecode2, save on eqs and wires X-Git-Tag: semi_working_ecp5~124 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94e6f244eb178771b8755914c1eada89702c3d0e;p=soc.git pass in state into PowerDecode2, save on eqs and wires --- diff --git a/src/soc/simple/issuer.py b/src/soc/simple/issuer.py index 215a6a98..eec9bc50 100644 --- a/src/soc/simple/issuer.py +++ b/src/soc/simple/issuer.py @@ -63,7 +63,8 @@ class TestIssuer(Elaboratable): # instruction decoder pdecode = create_pdecode() - self.pdecode2 = PowerDecode2(pdecode) # decoder + self.cur_state = CoreState("cur") # current state (MSR/PC/EINT) + self.pdecode2 = PowerDecode2(pdecode, state=self.cur_state) # Test Instruction memory self.imem = ConfigFetchUnit(pspec).fu @@ -107,8 +108,7 @@ class TestIssuer(Elaboratable): m.submodules.imem = imem = self.imem m.submodules.dbg = dbg = self.dbg - # current state (MSR/PC at the moment - cur_state = CoreState("cur") + cur_state = self.cur_state # XICS interrupt handler if self.xics: @@ -203,7 +203,6 @@ class TestIssuer(Elaboratable): dec_opcode_i = pdecode2.dec.raw_opcode_in # raw opcode insn_type = core.e.do.insn_type - dec_state = pdecode2.state # actually use a nmigen FSM for the first time (w00t) # this FSM is perhaps unusual in that it detects conditions @@ -255,7 +254,6 @@ class TestIssuer(Elaboratable): else: insn = f_instr_o.word_select(cur_state.pc[2], 32) comb += dec_opcode_i.eq(insn) # actual opcode - comb += dec_state.eq(cur_state) sync += core.e.eq(pdecode2.e) sync += core.state.eq(cur_state) sync += core.raw_insn_i.eq(dec_opcode_i)