Fix test that relied on old setup() structure
# Copyright 2020 Silicon Compiler Authors. All Rights Reserved.
+import importlib
import siliconcompiler
+import sys
import os
@@ -83,8 +85,14 @@ def test_check_missing_file_param():
chip.set('arg', 'step', 'syn')
chip.set('arg', 'index', '0')
- setup_tool = chip.find_function('yosys', 'setup', 'tools')
+
+ if not chip.scroot in sys.path:
+ sys.path.append(chip.scroot)
+ tool_module = importlib.import_module(f'tools.yosys.yosys')
+ setup_tool = getattr(tool_module, 'setup', None)
setup_tool(chip)
+ setup_step = getattr(tool_module, f'setup_syn', None)
+ setup_step(chip)
chip.set('tool', 'yosys', 'input', 'syn', '0', [])
chip.set('tool', 'yosys', 'output', 'syn', '0',[])
