import getopt
import os.path
import sys
+import json
from spec import modules, specgen, dummytest
+from spec.ifaceprint import create_sv
def printhelp():
module = modules[pinspec]
fname = os.path.join(output_dir or '', "%s.mdwn" % pinspec)
+ pyname = os.path.join(output_dir or '', "%s_pins.py" % pinspec)
d = os.path.split(fname)[0]
if not os.path.exists(d):
os.makedirs(d)
with open(fname, "w") as of:
- ps = module.pinspec()
- pinout, bankspec, pinspec, fixedpins = ps.write(of)
- if testing:
- dummytest(ps, output_dir, output_type)
- else:
- specgen(of, output_dir, pinout,
- bankspec, ps.muxwidths, pinspec, fixedpins, ps.fastbus)
+ with open(pyname, "w") as pyf:
+ ps = module.pinspec()
+ pinout, bankspec, pin_spec, fixedpins = ps.write(of)
+ #chip['litex.map'] = litexmap
+ if testing:
+ dummytest(ps, output_dir, output_type)
+ else:
+ specgen(of, output_dir, pinout,
+ bankspec, ps.muxwidths, pin_spec, fixedpins,
+ ps.fastbus)
+ pm, chip = module.pinparse(ps, pinspec)
+ litexmap = ps.pywrite(pyf, pm)
+ jchip = json.dumps(chip)
+ with open("%s/litex_pinpads.json" % pinspec, "w") as f:
+ f.write(jchip)
+ create_sv("%s/%s.svg" % (pinspec, pinspec), chip)
else:
if output_type == 'bsv':
from bsv.pinmux_generator import pinmuxgen as gentypes