From 516352a6c0904b1c2dd62bd0a5a5efce1e678710 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 26 Feb 2021 13:40:22 +0000 Subject: [PATCH] moving new_svstate and update_svstate into issue FSM TestIssuer --- src/soc/simple/issuer.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/soc/simple/issuer.py b/src/soc/simple/issuer.py index 6d1bcf7d..5998feed 100644 --- a/src/soc/simple/issuer.py +++ b/src/soc/simple/issuer.py @@ -286,6 +286,11 @@ class TestIssuerInternal(Elaboratable): # temporaries dec_opcode_i = pdecode2.dec.raw_opcode_in # raw opcode + # for updating svstate (things like srcstep etc.) + update_svstate = Signal() # set this (below) if updating + new_svstate = SVSTATERec("new_svstate") + comb += new_svstate.eq(cur_state.svstate) + with m.FSM(name="issue_fsm"): # go fetch the instruction at the current PC @@ -319,7 +324,8 @@ class TestIssuerInternal(Elaboratable): with m.State("EXECUTE_WAIT"): comb += exec_pc_ready_i.eq(1) with m.If(exec_pc_valid_o): - # TODO: update SRCSTEP here + # TODO: update SRCSTEP here (in new_svstate) + # and set update_svstate to True. # TODO: loop into INSN_EXECUTE if it's a vector instruction # and SRCSTEP != VL-1 and PowerDecoder.no_out_vec # is True @@ -327,6 +333,12 @@ class TestIssuerInternal(Elaboratable): # go back to INSN_FETCH. m.next = "INSN_FETCH" + # check if svstate needs updating: if so, write it to State Regfile + with m.If(update_svstate): + comb += self.state_w_sv.wen.eq(1<