forked from M-Labs/artiq
testbench.embedding: use dmgr to get core and export it.
This commit is contained in:
parent
2bfc72fba9
commit
8527e306c3
@ -12,15 +12,16 @@ def main():
|
|||||||
else:
|
else:
|
||||||
compile_only = False
|
compile_only = False
|
||||||
|
|
||||||
|
ddb_path = os.path.join(os.path.dirname(sys.argv[1]), "device_db.pyon")
|
||||||
|
dmgr = DeviceManager(DeviceDB(ddb_path))
|
||||||
|
|
||||||
with open(sys.argv[1]) as f:
|
with open(sys.argv[1]) as f:
|
||||||
testcase_code = compile(f.read(), f.name, "exec")
|
testcase_code = compile(f.read(), f.name, "exec")
|
||||||
testcase_vars = {'__name__': 'testbench'}
|
testcase_vars = {'__name__': 'testbench', 'dmgr': dmgr}
|
||||||
exec(testcase_code, testcase_vars)
|
exec(testcase_code, testcase_vars)
|
||||||
|
|
||||||
ddb_path = os.path.join(os.path.dirname(sys.argv[1]), "device_db.pyon")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
core = DeviceManager(DeviceDB(ddb_path)).get("core")
|
core = dmgr.get("core")
|
||||||
if compile_only:
|
if compile_only:
|
||||||
core.compile(testcase_vars["entrypoint"], (), {})
|
core.compile(testcase_vars["entrypoint"], (), {})
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user