sigh have to allow external clocks and reset mess even in microwatt-compat
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 3 Jan 2022 22:33:39 +0000 (22:33 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 3 Jan 2022 22:33:39 +0000 (22:33 +0000)
mode.  soc.vhdl still needs to be able to pull an external reset OR
DMI needs to be able to instruct the core to do it. hardly surprising

src/soc/simple/issuer.py
src/soc/simple/issuer_verilog.py

index 682e899d7430700c7d1d7f5764a0281790d4cb66..088fa6e7b2205fadb77862cf348a7ffc2c5b19b6 100644 (file)
@@ -335,16 +335,24 @@ class TestIssuerBase(Elaboratable):
         # LoadStore1 and is already a submodule of LoadStore1
         if not isinstance(self.imem, ICache):
             m.submodules.imem = imem = csd(self.imem)
-        if self.microwatt_compat:
-            m.submodules.dbg = dbg = self.dbg
-        else:
-            m.submodules.dbg = dbg = dbd(self.dbg)
+        m.submodules.dbg = dbg = dbd(self.dbg)
         if self.jtag_en:
             m.submodules.jtag = jtag = dbd(self.jtag)
             # TODO: UART2GDB mux, here, from external pin
             # see https://bugs.libre-soc.org/show_bug.cgi?id=499
             sync += dbg.dmi.connect_to(jtag.dmi)
 
+        # fixup the clocks in microwatt-compat mode (but leave resets alone
+        # so that microwatt soc.vhdl can pull a reset on the core or DMI
+        # can do it, just like in TestIssuer)
+        if self.microwatt_compat:
+            intclk = ClockSignal(self.core_domain)
+            dbgclk = ClockSignal(self.dbg_domain)
+            if self.core_domain != 'sync':
+                comb += intclk.eq(ClockSignal())
+            if self.dbg_domain != 'sync':
+                comb += dbgclk.eq(ClockSignal())
+
         cur_state = self.cur_state
 
         # 4x 4k SRAM blocks.  these simply "exist", they get routed in litex
index 0ff83d691807799ae2c86d5a69fa06f6e8e1af5b..7eb75f9321833ad01ddeab5b595f8a57e6c2e55d 100644 (file)
@@ -124,8 +124,8 @@ if __name__ == '__main__':
                          microwatt_compat=args.mwcompat, # microwatt compatible
                          units=units,
                          msr_reset=msr_reset)
-    if args.mwcompat:
-        pspec.core_domain = 'sync'
+    #if args.mwcompat:
+    #    pspec.core_domain = 'sync'
 
     print("mmu", pspec.__dict__["microwatt_mmu"])
     print("nocore", pspec.__dict__["nocore"])