# note if an exception happened. in a pipelined or OoO design
# this needs to be accompanied by "shadowing" (or stalling)
- el = []
- for exc in core.fus.excs.values():
- el.append(exc.happened)
- exc_happened = Signal()
- if len(el) > 0: # at least one exception
- comb += exc_happened.eq(Cat(*el).bool())
+ exc_happened = self.core.o.exc_happened
with m.FSM(name="issue_fsm"):
pdecode2 = self.pdecode2
# temporaries
- core_busy_o = ~core.p.o_ready # core is busy
+ core_busy_o = ~core.p.o_ready | core.n.o_data.busy_o # core is busy
core_ivalid_i = core.p.i_valid # instruction is valid
- core_issue_i = core.i.issue_i # instruction is issued
- insn_type = core.i.e.do.insn_type # instruction MicroOp type
with m.FSM(name="exec_fsm"):
with m.State("INSN_START"):
comb += exec_insn_o_ready.eq(1)
with m.If(exec_insn_i_valid):
- comb += core_ivalid_i.eq(1) # instruction is valid
- comb += core_issue_i.eq(1) # and issued
+ comb += core_ivalid_i.eq(1) # instruction is valid/issued
sync += sv_changed.eq(0)
sync += pc_changed.eq(0)
m.next = "INSN_ACTIVE" # move to "wait completion"
# instruction started: must wait till it finishes
with m.State("INSN_ACTIVE"):
- with m.If(insn_type != MicrOp.OP_NOP):
- comb += core_ivalid_i.eq(1) # instruction is valid
# note changes to PC and SVSTATE
with m.If(self.state_nia.wen & (1<<StateRegs.SVSTATE)):
sync += sv_changed.eq(1)
comb += dbg_rst.eq(ResetSignal())
# busy/halted signals from core
- core_busy_o = ~core.p.o_ready # core is busy
+ core_busy_o = ~core.p.o_ready | core.n.o_data.busy_o # core is busy
comb += self.busy_o.eq(core_busy_o)
comb += pdecode2.dec.bigendian.eq(self.core_bigendian_i)