sort out jtag clock/reset interchange
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 30 Jul 2018 10:00:55 +0000 (11:00 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 30 Jul 2018 10:00:55 +0000 (11:00 +0100)
src/bsv/peripheral_gen/base.py
src/bsv/peripheral_gen/jtag.py

index 397c1c06e683c2a4d16f0366d52cdbbe67db74d0..1892fc1ce94a6567a4143f47de1246f4575a2fc9 100644 (file)
@@ -253,10 +253,10 @@ else"""
         if ck == PBase.get_clock_reset(self, name, count):
             return ''
         if ctype == 'slow':
-            spc = "sp_clock, sp_reset"
+            spc = self.get_clk_spc(ctype)
         else:
             spc = ck
-            ck = "core_clock, core_reset"
+            ck = self.get_clk_spc(ctype)
         template = """\
 Ifc_sync#({0}) {1}_sync <-mksyncconnection(
             {2}, {3});"""
@@ -285,15 +285,21 @@ Ifc_sync#({0}) {1}_sync <-mksyncconnection(
                 ret.append(template.format("Bit#(1)", n_, spc, ck))
         return '\n'.join(ret)
 
+    def get_clk_spc(self, ctype):
+        if ctype == 'slow':
+            return "sp_clock, sp_reset"
+        else:
+            return "core_clock, core_reset"
+
     def _mk_clk_vcon(self, name, count, ctype, typ, pname, bitspec):
         ck = self.get_clock_reset(name, count)
         if ck == PBase.get_clock_reset(self, name, count):
             return ''
         if ctype == 'slow':
-            spc = "sp_clock, sp_reset"
+            spc = self.get_clk_spc(ctype)
         else:
             spc = ck
-            ck = "core_clock, core_reset"
+            ck = self.get_clk_spc(ctype)
         template = """\
 Ifc_sync#({0}) {1}_sync <-mksyncconnection(
             {2}, {3});"""
index c0891fddf7693d3eb757127cd49931169f1396dd..c62b009e54e3d1530b0c314464fb16d2ba42168d 100644 (file)
@@ -13,9 +13,12 @@ class jtag(PBase):
         # YUK!
         return "interface Ifc_jtagdtm jtag{0}_out;".format(count)
 
-    def get_clock_reset(self, name, count):
+    def get_clk_spc(self, typ):
         return "tck, trst"
 
+    def get_clock_reset(self, name, count):
+        return "slow_clock,  slow_reset"
+
     def pinname_in(self, pname):
         return {'tms': 'tms',
                 'tdi': 'tdi',