From abba163df4d0b3a5b8adf0ab23152a2993e25e9c Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 4 Aug 2020 22:57:00 +0100 Subject: [PATCH] read/set pc outside of FSM so that DMI interface can get at it --- src/soc/simple/issuer.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/soc/simple/issuer.py b/src/soc/simple/issuer.py index 910598ea..3d168da6 100644 --- a/src/soc/simple/issuer.py +++ b/src/soc/simple/issuer.py @@ -114,19 +114,29 @@ class TestIssuer(Elaboratable): comb += self.pc_o.eq(cur_state.pc) ilatch = Signal(32) - # MSR (temp and latched) + # 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) + # read the PC + pc = Signal(64, reset_less=True) + with m.If(self.pc_i.ok): + # incoming override (start from pc_i) + comb += pc.eq(self.pc_i.data) + with m.Else(): + # otherwise read FastRegs regfile for PC + comb += self.fast_r_pc.ren.eq(1<