fix eint
authorNeel <neelgala@gmail.com>
Sat, 21 Jul 2018 10:20:43 +0000 (15:50 +0530)
committerNeel <neelgala@gmail.com>
Sat, 21 Jul 2018 10:20:43 +0000 (15:50 +0530)
src/bsv/peripheral_gen.py
src/spec/pinfunctions.py

index 693a79215fc4d31fd5cc4781c13e1c56171d2b9a..7da27a5b5cda5b211232494e20984aca793d188e 100644 (file)
@@ -102,7 +102,9 @@ class PBase(object):
                         "    rule con_%s%d_%s_in;" %
                         (name, count, pname))
                     n_ = "{0}{1}".format(n, count)
-                    ret.append("      {1}.{2}({0});".format(ps_, n_, fname))
+                    n_ = '{0}.{1}'.format(n_, fname)
+                    n_ = self.ifname_tweak(pname, 'in', n_) 
+                    ret.append("      {1}({0});".format(ps_, n_))
                     ret.append("    endrule")
         return '\n'.join(ret)
 
@@ -147,6 +149,9 @@ class PBase(object):
     def pinname_outen(self, pname):
         return ''
 
+    def ifname_tweak(self, pname, typ, txt):
+        return txt
+
     def pinname_tweak(self, pname, typ, txt):
         return txt
 
@@ -296,35 +301,27 @@ class eint(PBase):
     def axi_addr_map(self, name, ifacenum):
         return ''
 
-    def _pinname_out(self, pname):
-        return {'sda': 'out.sda_out',
-                'scl': 'out.scl_out'}.get(pname, '')
-
-    def _pinname_in(self, pname):
-        return {'sda': 'out.sda_in',
-                'scl': 'out.scl_in'}.get(pname, '')
-
-    def _pinname_outen(self, pname):
-        return {'sda': 'out.sda_out_en',
-                'scl': 'out.scl_out_en'}.get(pname, '')
+    def ifname_tweak(self, pname, typ, txt):
+        if typ != 'in':
+            return txt
+        print "ifnameweak", pname, typ, txt
+        return "wr_interrupt[{0}] <= ".format(pname)
 
     def mk_pincon(self, name, count):
+        ret = [PBase.mk_pincon(self, name, count)]
         size = len(self.peripheral.pinspecs)
-        ret = []
         ret.append(eint_pincon_template.format(size))
-
-        ret.append("    rule con_%s%d_io_out;" % (name, count))
-        for idx, p in enumerate(self.peripheral.pinspecs):
+        ret.append("    rule con_%s%d_io_in;" % (name,  count))
+        ret.append("    wr_interrupt({")
+        for idx,  p in enumerate(self.peripheral.pinspecs):
             pname = p['name']
             sname = self.peripheral.pname(pname).format(count)
-            ps = "pinmux.peripheral_side.%s_out" % sname
-            ret.append("        wr_interrupt[{0}] <= {1};".format(idx, ps))
-        for idx, p in enumerate(self.peripheral.pinspecs):
-            pname = p['name']
-            sname = self.peripheral.pname(pname).format(count)
-            ps = "pinmux.peripheral_side.%s_out_en" % sname
-            ret.append("        {0} <= 1'b1;".format(ps))
+            ps = "pinmux.peripheral_side.%s" % sname
+            comma = '' if idx == size-1 else ','
+            ret.append("             {0}{1}".format(ps,  comma))
+        ret.append("        });")
         ret.append("    endrule")
+
         return '\n'.join(ret)
 
 
index bab960b0b7a5df4d9d34e14fa0f0108cde69cbaf..1a4b8fe325768e90dacc286517823a912c97791d 100644 (file)
@@ -211,7 +211,7 @@ class RangePin(object):
 
 
 def eint(suffix, bank):
-    return (RangePin("*"), [])
+    return (RangePin("-"), [])
 
 
 def pwm(suffix, bank):