format rgbttl connections
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 30 Jul 2018 05:04:16 +0000 (06:04 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 30 Jul 2018 05:04:16 +0000 (06:04 +0100)
src/bsv/peripheral_gen/rgbttl.py

index f72c9bfa6921a21686d6617ca7495f8b0434e3b5..53bffa35a79b0e9915fab7fe2553b1211eeafebe 100644 (file)
@@ -24,15 +24,18 @@ class rgbttl(PBase):
             return pname
         return ''
 
-    def mk_pincon(self, name, count):
-        ret = [PBase.mk_pincon(self, name, count)]
-        # special-case for gpio in, store in a temporary vector
-        sname = self.peripheral.iname().format(count)
-        plen = len(self.peripheral.pinspecs)
-        template = "mkConnection({0}.{1},\n\t\t\t{2}.{1});"
+    def _mk_pincon(self, name, count, ptyp):
+        ret = [PBase._mk_pincon(self, name, count, ptyp)]
+        if ptyp == 'fast':
+            sname = self.get_iname(count)
+            ps = "slow_peripherals.%s" % sname
+        else:
+            sname = self.peripheral.iname().format(count)
+            ps = "pinmux.peripheral_side.%s" % sname
         name = self.get_iname(count)
-        ps = "pinmux.peripheral_side.%s" % sname
         n = "{0}".format(name)
         for ptype in ['data_out']:
-            ret.append(template.format(ps, ptype, n))
+            ps_ = "{0}.{1}".format(ps, ptype)
+            ret += self._mk_actual_connection('out', name, count, 'out',
+                                              ptype, ps_, n, ptype)
         return '\n'.join(ret)