fix gpio enable
[pinmux.git] / src / parse.py
index 9c45944f76f0650de180f4fe2cc91fcc53fc0049..7a42f577744cadb15cd2db86fef8d6b84254c2bc 100644 (file)
@@ -14,8 +14,8 @@ class Parse(object):
     N_IO = 0
     N_MUX_IO = 0
     Addressing = 'WORD'
-    ADDR_WIDTH = 32
-    DATA_WIDTH = 32
+    ADDR_WIDTH = 32  # TODO parameterise
+    DATA_WIDTH = 64  # TODO parameterise
     # ================ #
 
     # Generating the number of bits for memory map #
@@ -52,6 +52,10 @@ class Parse(object):
                 if len(line1) == 2:  # dedicated
                     self.dedicated_cells.append(line1)
                 else:
+                    for i in range(1, len(line1)):
+                        # XXX HORRIBLE HACK!!
+                        if line1[i].startswith('pwm'):
+                            line1[i] = 'pwm%s_out' % line1[i][4:]
                     self.muxed_cells.append(line1)
 
         self.pinnumbers = sorted(self.pinnumbers)
@@ -110,7 +114,6 @@ class Parse(object):
         return int(math.log(max_num_cells + 1, 2))
 
 
-
 if __name__ == '__main__':
     p = Parse()
     print (p.N_IO)