add new PortInterfaceBase external_busy() option
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 8 Dec 2021 16:06:27 +0000 (16:06 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 8 Dec 2021 16:09:35 +0000 (16:09 +0000)
this allows e.g. instruction fault to stop LD/STs from being accepted

src/soc/experiment/pimem.py

index 03be6bcab3800f48221e91b2ad3096c0360e768d..44eaeebed7fee502d6011fe1d2e1bd002c135888 100644 (file)
@@ -321,7 +321,14 @@ class PortInterfaceBase(Elaboratable):
             comb += busy_l.r.eq(1)
 
         # busy latch outputs to interface
-        comb += pi.busy_o.eq(busy_l.q)
+        if hasattr(self, "external_busy"):
+            # when there is an extra (external) busy, include that here.
+            # this is used e.g. in LoadStore1 when an instruction fault
+            # is being processed (instr_fault) and stops Load/Store requests
+            # from being made until it's done
+            comb += pi.busy_o.eq(busy_l.q | self.external_busy(m))
+        else:
+            comb += pi.busy_o.eq(busy_l.q)
 
         return m