write mux width and read back in
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 31 Jul 2018 06:37:47 +0000 (07:37 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 31 Jul 2018 06:37:47 +0000 (07:37 +0100)
src/parse.py
src/pinmux_generator.py
src/spec/gen.py

index 6ab3dd094230c4a3ce66f34f8f0f8228da78342c..12e20cadf72e04e7c996bc518129d6239033e74c 100644 (file)
@@ -25,14 +25,18 @@ class Parse(object):
         self.dedicated_cells = []
         self.pinnumbers = []
         self.bankwidths = {} 
+        self.banksize = {}
+        self.bankstart = {}
 
-        fname = 'bankwidths.txt'
+        fname = 'pinspec.txt'
         if pth:
             fname = os.path.join(pth, fname)
         with open(fname) as bankwidths:
             for lineno, line in enumerate(bankwidths):
                 line1 = line[:-1].split('\t')
-                self.bankwidths[line1[0]] = int(line1[1])
+                self.bankwidths[line1[0]] = int(line1[3])
+                self.banksize[line1[0]] = int(line1[2])
+                self.bankstart[line1[0]] = int(line1[1])
             
         # == capture the number of IO cells required == #
         fname = 'pinmap.txt'
index 2f04f34b08f638d60aec0b58a8a106a065e57695..b95377b4bad5d00485b4ed2c9fac5d56c8305b0a 100644 (file)
@@ -91,7 +91,7 @@ if __name__ == '__main__':
                 dummytest(ps, output_dir, output_type)
             else:
                 specgen(of, output_dir, pinout,
-                        bankspec, pinspec, fixedpins, ps.fastbus)
+                        bankspec, ps.muxwidths, pinspec, fixedpins, ps.fastbus)
     else:
         if output_type == 'bsv':
             from bsv.pinmux_generator import pinmuxgen as gentypes
index 8a54e9353505b5473ceb76fd9d2d316bba7f9087..e1dc561111b6ffa425aed312ebb30e5b2cc4877c 100644 (file)
@@ -3,7 +3,8 @@ import os.path
 from spec.interfaces import Pinouts
 
 
-def specgen(of, pth, pinouts, bankspec, pinbanks, fixedpins, fastbus):
+def specgen(of, pth, pinouts, bankspec, muxwidths, pinbanks, fixedpins,
+            fastbus):
     """ generates a specification of pinouts (tsv files)
         for reading in by pinmux.
 
@@ -28,7 +29,7 @@ def specgen(of, pth, pinouts, bankspec, pinbanks, fixedpins, fastbus):
     #print pinouts.ganged.items()
     if not os.path.exists(pth):
         os.makedirs(pth)
-    with open(os.path.join(pth, 'bankwidths.txt'), 'w') as f:
+    with open(os.path.join(pth, 'muxwidths.txt'), 'w') as f:
         for k, v in pinouts.muxwidths.items():
             f.write("%s\t%d\n" % (k, v))
     with open(os.path.join(pth, 'interfaces.txt'), 'w') as f:
@@ -93,5 +94,6 @@ def specgen(of, pth, pinouts, bankspec, pinbanks, fixedpins, fastbus):
         keys = sorted(bankspec.keys())
         for bank in keys:
             pinstart = bankspec[bank]
-            of.write("* %s %d %d\n" % (bank, pinstart, pinbanks[bank]))
-            g.write("%s\t%d\t%d\n" % (bank, pinstart, pinbanks[bank]))
+            wid = muxwidths[bank]
+            of.write("* %s %d %d %d\n" % (bank, pinstart, pinbanks[bank], wid))
+            g.write("%s\t%d\t%d\t%d\n" % (bank, pinstart, pinbanks[bank], wid))