pass over config in json format
[pinmux.git] / src / spec / gen.py
index 81226b305b4595ecc50d2f560f83fae602dbab97..492ba535074087c93ffb4a8d879082ba6b2c64d7 100644 (file)
@@ -1,10 +1,11 @@
 import os
+import json
 import os.path
 from spec.interfaces import Pinouts
 
 
 def specgen(of, pth, pinouts, bankspec, muxwidths, pinbanks, fixedpins,
-            fastbus):
+            configs):
     """ generates a specification of pinouts (tsv files)
         for reading in by pinmux.
 
@@ -29,13 +30,13 @@ def specgen(of, pth, pinouts, bankspec, muxwidths, pinbanks, fixedpins,
     #print pinouts.ganged.items()
     if not os.path.exists(pth):
         os.makedirs(pth)
+    with open(os.path.join(pth, 'configs.txt'), 'w') as f:
+        f.write("%s\n" % json.dumps(configs))
+
     with open(os.path.join(pth, 'interfaces.txt'), 'w') as f:
         for k in pinouts.fnspec.keys():
             s = pinouts.fnspec[k]
             line = [k.lower(), str(len(s))]
-            for b in fastbus:
-                if b.startswith(k.lower()):
-                    line.append(b)
             line = '\t'.join(line)
             f.write("%s\n" % line)
             s0 = s[list(s.keys())[0]]  # hack, take first