From 3f2ed63ccdeefdaa601ecedea9c663a7e446f607 Mon Sep 17 00:00:00 2001 From: Cesar Strauss Date: Fri, 26 Feb 2021 07:47:03 -0300 Subject: [PATCH] Implement a decode/issue FSM between fetch and execute The idea is for it to: * keep looping "fetch" while VL==0 on a vector instruction. * keep looping "execute" while SRCSTEP != VL-1. * unless PC/SVSTATE was modified by "execute", in that case do go back to "fetch". * update PC and SRCSTEP accordingly. --- src/soc/simple/issuer.py | 126 +++++++++++++++++++++++++++------------ 1 file changed, 87 insertions(+), 39 deletions(-) diff --git a/src/soc/simple/issuer.py b/src/soc/simple/issuer.py index 5ec00ca4..b15298cb 100644 --- a/src/soc/simple/issuer.py +++ b/src/soc/simple/issuer.py @@ -149,7 +149,7 @@ class TestIssuerInternal(Elaboratable): def fetch_fsm(self, m, core, dbg, pc, pc_changed, sv_changed, insn_done, core_rst, cur_state, fetch_pc_ready_o, fetch_pc_valid_i, - exec_insn_valid_o, exec_insn_ready_i, + fetch_insn_valid_o, fetch_insn_ready_i, fetch_insn_o): """fetch FSM this FSM performs fetch of raw instruction data, partial-decodes @@ -244,8 +244,8 @@ class TestIssuerInternal(Elaboratable): with m.State("INSN_READY"): # hand over the instruction, to be decoded - comb += exec_insn_valid_o.eq(1) - with m.If(exec_insn_ready_i): + comb += fetch_insn_valid_o.eq(1) + with m.If(fetch_insn_ready_i): m.next = "IDLE" # code-morph: moving the actual PC-setting out of "execute" @@ -259,59 +259,100 @@ class TestIssuerInternal(Elaboratable): comb += self.state_w_pc.wen.eq(1<