From 211961ea9911c60e3e3e04d4a8843670941ce8d8 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 9 Nov 2021 12:38:25 +0000 Subject: [PATCH] create function core conect_satellite_decoders just moving code from elaborate to make it clearer --- src/soc/simple/core.py | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/soc/simple/core.py b/src/soc/simple/core.py index 00e351cb..936dbfe2 100644 --- a/src/soc/simple/core.py +++ b/src/soc/simple/core.py @@ -221,6 +221,28 @@ class NonProductionCore(ControlBase): fus = self.fus.fus # connect decoders + self.connect_satellite_decoders(m) + + # ssh, cheat: trap uses the main decoder because of the rewriting + self.des[self.trapunit] = self.i.e.do + + # connect up Function Units, then read/write ports + fu_bitdict = self.connect_instruction(m) + 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_satellite_decoders(self, m): + comb = m.d.comb for k, v in self.decoders.items(): # connect each satellite decoder and give it the instruction. # as subset decoders this massively reduces wire fanout given @@ -243,24 +265,6 @@ class NonProductionCore(ControlBase): comb += v.use_svp64_ldst_dec.eq( self.i.use_svp64_ldst_dec) - # ssh, cheat: trap uses the main decoder because of the rewriting - self.des[self.trapunit] = self.i.e.do - - # connect up Function Units, then read/write ports - fu_bitdict = self.connect_instruction(m) - 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): """connect_instruction -- 2.30.2