merge redundant function params
[pinmux.git] / src / bsv / peripheral_gen / rgbttl.py
index fa7e49ab7773647dbe10e8c3dd87fe9e196bacd3..ca2fbad38d2f0b23a690c1aa20c8aebb16c04f69 100644 (file)
@@ -4,16 +4,21 @@ from bsv.peripheral_gen.base import PBase
 class rgbttl(PBase):
 
     def slowimport(self):
-        return "    import rgbttl_dummy              :: *;"
+        return "import rgbttl_dummy              :: *;"
+
+    def has_axi_master(self):
+        return True
 
     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();"
+        return "Ifc_rgbttl_dummy lcd{0} <-  mkrgbttl_dummy();"
 
-    def _mk_connection(self, name=None, count=0):
+    def _mk_connection(self, name=None, count=0, master=False):
+        if master:
+            return "lcd{0}.master"
         return "lcd{0}.slave"
 
     def pinname_out(self, pname):
@@ -21,26 +26,21 @@ 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});"
-        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))
-        return '\n'.join(ret)
+    def get_clock_reset(self, name, count):
+        return "slow_clock, slow_reset"
 
-    def slowifdeclmux(self, name, count):
-        sname = self.get_iname(count)
-        return "        interface PeripheralSideLCD %s_out;" % sname
+    def _mk_pincon(self, name, count, ptyp):
+        ret = [PBase._mk_pincon(self, name, count, ptyp)]
+        txt = self._mk_vpincon(name, count, ptyp, "out", "data_out")
+        ret.append(txt)
+        return '\n'.join(ret)
 
-    def slowifinstance(self, name, count):
-        sname = self.peripheral.iname().format(count)
-        pname = self.get_iname(count)
-        template = "        interface {0}_out = pinmux.peripheral_side.{1};"
-        return template.format(pname, sname)
+    def _mk_clk_con(self, name, count, ctype):
+        ret = [PBase._mk_clk_con(self, name, count, ctype)]
 
+        # data_out (hard-coded)
+        sz = len(self.peripheral.pinspecs) - 4  # subtract CK, DE, HS, VS
+        bitspec = "Bit#(%d)" % sz
+        txt = self._mk_clk_vcon(name, count, ctype, "out", "data_out", bitspec)
+        ret.append(txt)
+        return '\n'.join(ret)