def printhelp():
print ('''pinmux_generator.py [-o outputdir] [-v|--validate] [-h|--help]
- [-t outputtype]
+ [-t outputtype] [-s|--spec spec]
+ -s | spec : generate from spec (python module)
-t | outputtype : outputtype, defaults to bsv
-o outputdir : defaults to bsv_src. also location for reading pinmux.txt
interfaces.txt and *.txt
output_dir = None
validate = False
spec = None
+ pinspec = None
for opt, arg in options:
if opt in ('-o', '--output'):
output_dir = arg
sys.exit(0)
if pinspec:
- if not modules.has_key(pinspec):
+ if pinspec not in modules:
print "ERROR: spec type '%s' does not exist" % pinspec
printhelp()
sys.exit(1)
specgen(output_dir, pinout, bankspec, fixedpins)
else:
gentypes = {'bsv': bsvgen}
- if not gentypes.has_key(output_type):
+ if output_type not in gentypes:
print "ERROR: output type '%s' does not exist" % output_type
printhelp()
sys.exit(0)