put jtag interface straight out, not with bscan etc
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 25 Jul 2018 12:04:48 +0000 (13:04 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 25 Jul 2018 12:04:48 +0000 (13:04 +0100)
src/bsv/peripheral_gen/base.py
src/bsv/peripheral_gen/jtag.py

index 0cc11df529aca7517115ab82434e4655443b3244..23adfb687cc295e2e9cd677a7e633a2aeb7a38cd 100644 (file)
@@ -210,11 +210,18 @@ class PBase(object):
     def extfastifinstance(self, name, count):
         return ''
 
-    def extifinstance(self, name, count):
-        sname = self.peripheral.iname().format(count)
+    def _extifinstance(self, name, count, suffix, prefix, samename=False):
         pname = self.get_iname(count)
-        template = "        interface {0} = pinmux.peripheral_side.{1};"
-        return template.format(pname, sname)
+        if samename:
+            sname = pname
+        else:
+            sname = self.peripheral.iname().format(count)
+        template = "        interface {0}{3} = {2}{1};"
+        return template.format(pname, sname, prefix, suffix)
+
+    def extifinstance(self, name, count):
+        return self._extifinstance(name, count, "",
+                                            "pinmux.peripheral_side.")
 
 
 mkplic_rule = """\
index 04d4481cbd29c3d08b6a261be1aa0dd4c81bf3c7..042d8028fcbb0c0885cd0340bc9554d103b88117 100644 (file)
@@ -7,47 +7,13 @@ class jtag(PBase):
         return "    import jtagtdm::*;\n"
 
     def extfastifinstance(self, name, count):
-        # YUK!
-        print "jtag", name, count
-        return """\
-            method Action tms_i(Bit#(1) tms);
-                {0}.tms_i(tms);
-            endmethod
-            method Action tdi_i(Bit#(1) tdi);
-                {0}.tdi_i(tdi);
-            endmethod
-            method Action bs_chain_i(Bit#(1) bs_chain);
-                {0}.bs_chain_i(bs_chain);
-            endmethod
-            method Bit#(1) shiftBscan2Edge={0}.shiftBscan2Edge;
-            method Bit#(1) selectJtagInput={0}.selectJtagInput;
-            method Bit#(1) selectJtagOutput={0}.selectJtagOutput;
-            method Bit#(1) updateBscan={0}.updateBscan;
-            method Bit#(1) bscan_in={0}.bscan_in;
-            method Bit#(1) scan_shift_en={0}.scan_shift_en;
-            method Bit#(1) tdo={0}.tdo;
-            method Bit#(1) tdo_oe={0}.tdo_oe;
-""".format(self.name, count)
+        return self._extifinstance(name, count, "_out", "", True)
 
 
 
     def fastifdecl(self, name, count):
         # YUK!
-        template = """ \
-         (*always_ready,always_enabled*) method Action tms_i(Bit#(1) tms);
-         (*always_ready,always_enabled*) method Action tdi_i(Bit#(1) tdi);
-         (*always_ready,always_enabled*)
-                                 method Action bs_chain_i(Bit#(1) bs_chain);
-         (*always_ready,always_enabled*) method Bit#(1) shiftBscan2Edge;
-         (*always_ready,always_enabled*) method Bit#(1) selectJtagInput;
-         (*always_ready,always_enabled*) method Bit#(1) selectJtagOutput;
-         (*always_ready,always_enabled*) method Bit#(1) updateBscan;
-         (*always_ready,always_enabled*) method Bit#(1) bscan_in;
-         (*always_ready,always_enabled*) method Bit#(1) scan_shift_en;
-         (*always_ready,always_enabled*) method Bit#(1) tdo;
-         (*always_ready,always_enabled*) method Bit#(1) tdo_oe;
-"""
-        return template
+        return "          Ifc_jtagdtm jtag{0}_out;".format(count);
 
     def mkfast_peripheral(self):
         return """\