import getopt
import os.path
import sys
+from spec import modules, specgen
from bsv.pinmux_generator import pinmuxgen as bsvgen
try:
options, remainder = getopt.getopt(
sys.argv[1:],
- 'o:vht:',
+ 'o:vht:s:',
['output=',
'validate',
'outputtype=',
+ 'spec=',
'help',
'version=',
])
output_type = 'bsv'
output_dir = None
validate = False
+ spec = None
for opt, arg in options:
if opt in ('-o', '--output'):
output_dir = arg
+ elif opt in ('-s', '--spec'):
+ pinspec = arg
elif opt in ('-t', '--outputtype'):
output_type = arg
elif opt in ('-v', '--validate'):
printhelp()
sys.exit(0)
- gentypes = {'bsv': bsvgen}
- if not gentypes.has_key(output_type):
- print "ERROR: output type '%s' does not exist" % output_type
- printhelp()
- sys.exit(0)
- gentypes[output_type](output_dir, validate)
+ if pinspec:
+ if not modules.has_key(pinspec):
+ print "ERROR: spec type '%s' does not exist" % pinspec
+ printhelp()
+ sys.exit(1)
+ module = modules[pinspec]
+ pinout, bankspec, fixedpins = module.pinspec()
+ specgen(output_dir, pinout, bankspec, fixedpins)
+ else:
+ gentypes = {'bsv': bsvgen}
+ if not gentypes.has_key(output_type):
+ print "ERROR: output type '%s' does not exist" % output_type
+ printhelp()
+ sys.exit(0)
+ gentypes[output_type](output_dir, validate)
from interfaces import jtag, uart, ulpi, uartfull, rgbttl, rgmii
from interfaces import flexbus1, flexbus2, sdram1, sdram2, mcu8080
-from interfaces import eint, pwm, gpio
+from interfaces import eint, pwm, gpio, spi, i2c, emmc, sdmmc
+from interfaces import quadspi, i2s
from interfaces import display, display_fns, check_functions
from interfaces import pinmerge, display_fixed