From aaddaac094fa5b744b43f343fed6bea7331dc142 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 8 Nov 2021 14:19:14 +0000 Subject: [PATCH] move "exception happened" detection from TestIssuer to Core --- src/soc/simple/core.py | 10 ++++++++++ src/soc/simple/issuer.py | 7 +------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/soc/simple/core.py b/src/soc/simple/core.py index a36fc92a..9343081c 100644 --- a/src/soc/simple/core.py +++ b/src/soc/simple/core.py @@ -113,9 +113,11 @@ class CoreOutput: def __init__(self): # start/stop and terminated signalling self.core_terminate_o = Signal(reset=0) # indicates stopped + self.exc_happened = Signal() # exception happened def eq(self, i): self.core_terminate_o.eq(i.core_terminate_o) + self.exc_happened.eq(i.exc_happened) # derive from ControlBase rather than have a separate Stage instance, @@ -236,6 +238,14 @@ class NonProductionCore(ControlBase): self.connect_rdports(m, fu_bitdict) self.connect_wrports(m, fu_bitdict) + # note if an exception happened. in a pipelined or OoO design + # this needs to be accompanied by "shadowing" (or stalling) + el = [] + for exc in self.fus.excs.values(): + el.append(exc.happened) + if len(el) > 0: # at least one exception + comb += self.o.exc_happened.eq(Cat(*el).bool()) + return m def connect_instruction(self, m): diff --git a/src/soc/simple/issuer.py b/src/soc/simple/issuer.py index e917756e..b5dc3784 100644 --- a/src/soc/simple/issuer.py +++ b/src/soc/simple/issuer.py @@ -604,12 +604,7 @@ class TestIssuerInternal(Elaboratable): # 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"): -- 2.30.2