add mkfast_peripherals fn
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 25 Jul 2018 08:03:02 +0000 (09:03 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 25 Jul 2018 08:03:02 +0000 (09:03 +0100)
src/bsv/peripheral_gen/base.py
src/bsv/peripheral_gen/jtag.py
src/bsv/peripheral_gen/rgbttl.py
src/bsv/pinmux_generator.py

index a8e15f39c3cbed60d8feaf498a1b3e3ce3357561..642557d0ab62fb098c60be13db27ff9562cdf95a 100644 (file)
@@ -114,6 +114,9 @@ class PBase(object):
     def mk_cellconn(self, *args):
         return ''
 
+    def mkfast_peripheral(self, size=0):
+        return ''
+
     def mkslow_peripheral(self, size=0):
         return ''
 
@@ -239,7 +242,9 @@ class PeripheralIface(object):
         for fname in ['slowimport',
                       'extifinstance', 'extifdecl',
                       'slowifdecl', 'slowifdeclmux',
-                      'mkslow_peripheral', 'mk_plic', 'mk_ext_ifacedef',
+                      'mkslow_peripheral', 
+                      'mkfast_peripheral',
+                      'mk_plic', 'mk_ext_ifacedef',
                       'mk_connection', 'mk_cellconn', 'mk_pincon']:
             fn = CallFn(self, fname)
             setattr(self, fname, types.MethodType(fn, self))
@@ -352,13 +357,26 @@ class PeripheralInterfaces(object):
                 ret.append(self.data[name].axi_addr_map(i))
         return '\n'.join(list(filter(None, ret)))
 
+    def mkfast_peripheral(self, *args):
+        ret = []
+        for (name, count) in self.ifacecount:
+            for i in range(count):
+                if self.is_on_fastbus(name, i):
+                    continue
+                #print "mkfast", name, count
+                x = self.data[name].mkfast_peripheral()
+                print name, count, x
+                suffix = self.data[name].mksuffix(name, i)
+                ret.append(x.format(suffix))
+        return '\n'.join(list(filter(None, ret)))
+
     def mkslow_peripheral(self, *args):
         ret = []
         for (name, count) in self.ifacecount:
             for i in range(count):
                 if self.is_on_fastbus(name, i):
                     continue
-                print "mkslow", name, count
+                #print "mkslow", name, count
                 x = self.data[name].mkslow_peripheral()
                 print name, count, x
                 suffix = self.data[name].mksuffix(name, i)
index 1f381f4e524cc2c01b5cadc4aff2195ac9da087f..3ccf6adc2001221e7ae11141146077bb80c0e1cf 100644 (file)
@@ -6,16 +6,16 @@ class jtag(PBase):
     def slowimport(self):
         return "    import jtagtdm::*;\n"
 
-    def mkslow_peripheral(self):
+    def mkfast_peripheral(self):
         return """\
-            Ifc_jtagdtm {0} <-mkjtagdtm(clocked_by tck, reset_by trst);
-         rule drive_tmp_scan_outs;
-             {0}.scan_out_1_i(1'b0);
-             {0}.scan_out_2_i(1'b0);
-             {0}.scan_out_3_i(1'b0);
-             {0}.scan_out_4_i(1'b0);
-             {0}.scan_out_5_i(1'b0);
-         endrule
+        Ifc_jtagdtm jtag{0} <-mkjtagdtm(clocked_by tck, reset_by trst);
+        rule drive_tmp_scan_outs;
+            jtag{0}.scan_out_1_i(1'b0);
+            jtag{0}.scan_out_2_i(1'b0);
+            jtag{0}.scan_out_3_i(1'b0);
+            jtag{0}.scan_out_4_i(1'b0);
+            jtag{0}.scan_out_5_i(1'b0);
+        endrule
 """
     def axi_slave_name(self, name, ifacenum):
         return ''
index e875bebeb7d225b59c161caaf171afd9d619802b..6f69d7bed208137e89ef4d4f99f3f3703b5b424f 100644 (file)
@@ -9,7 +9,7 @@ class rgbttl(PBase):
     def num_axi_regs32(self):
         return 10
 
-    def mkslow_peripheral(self):
+    def mkfast_peripheral(self):
         sz = len(self.peripheral.pinspecs) - 4  # subtract CK, DE, HS, VS
         return "        Ifc_rgbttl_dummy lcd{0} <-  mkrgbttl_dummy();"
 
index c4f675ca217309c53692c69b1646b66bd092687e..7def4f88d1eccc751e7b503c72a90eb8430a5d45 100644 (file)
@@ -136,7 +136,7 @@ def write_soc(soc, soct, p, ifaces, iocells):
     regdef = ifaces.axi_reg_def()
     slavedecl = ifaces.axi_slave_idx()
     fnaddrmap = ifaces.axi_addr_map()
-    mkfast = ifaces.mkslow_peripheral()
+    mkfast = ifaces.mkfast_peripheral()
     mkcon = ifaces.mk_connection()
     mkcellcon = ifaces.mk_cellconn()
     pincon = ifaces.mk_pincon()