import getopt
import os.path
import sys
-from spec import modules, specgen
+from spec import modules, specgen, dummytest
from bsv.pinmux_generator import pinmuxgen as bsvgen
'o:vht:s:',
['output=',
'validate',
+ 'test',
'outputtype=',
'spec=',
'help',
validate = False
spec = None
pinspec = None
+ testing = False
for opt, arg in options:
if opt in ('-o', '--output'):
output_dir = arg
output_type = arg
elif opt in ('-v', '--validate'):
validate = True
+ elif opt in ('--test',):
+ testing = True
elif opt in ('-h', '--help'):
printhelp()
sys.exit(0)
if not os.path.exists(d):
os.makedirs(d)
with open(fname, "w") as of:
- pinout, bankspec, pinspec, fixedpins = module.pinspec(of)
- specgen(of, output_dir, pinout, bankspec, pinspec, fixedpins)
+ 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, pinspec, fixedpins)
else:
gentypes = {'bsv': bsvgen}
if output_type not in gentypes:
from spec import minitest
from spec import microtest
from spec.gen import specgen
+from spec.testing import dummytest
modules = {'m_class': m_class,
'c_class': c_class,
from spec.ifaceprint import display_fixed
-def pinspec(of):
+def pinspec():
pinbanks = {
'A': 4,
}
'ULPI1': 'dual USB2 Host ULPI PHY'
}
- ps.add_scenario("MiniTest", microtest, microtest_eint, microtest_pwm,
+ ps.add_scenario("MicroTest", microtest, microtest_eint, microtest_pwm,
descriptions)
- return ps.write(of)
+ return ps