def test_vivado_configure(): backend.configure(params) tcl_file = core.name.sanitized_name + '.tcl' compare_files(ref_dir, work_root, [tcl_file])
def test_xsim_configure(): backend.configure(sim_params) compare_files(ref_dir, work_root, [ 'config.mk', 'Makefile', core.sanitized_name + '.prj', 'run-gui.tcl', 'run.tcl' ])
def test_ghdl_run(): os.environ['PATH'] = os.path.join( tests_dir, 'mock_commands') + ':' + os.environ['PATH'] backend.run(sim_params) compare_files(ref_dir, work_root, ['run.cmd']) assert os.path.isfile(os.path.join(work_root, 'pre_run_script_executed')) assert os.path.isfile(os.path.join(work_root, 'post_run_script_executed'))
def test_xsim_run(): os.environ['PATH'] = os.path.join( tests_dir, 'mock_commands') + ':' + os.environ['PATH'] xsimkdir = os.path.join(work_root, 'xsim.dir', core.sanitized_name) os.makedirs(xsimkdir) with open(os.path.join(xsimkdir, 'xsimk'), 'w') as f: f.write("I am a compiled simulation kernel\n") backend.run(sim_params) compare_files(ref_dir, work_root, ['run.cmd']) assert os.path.isfile(os.path.join(work_root, 'pre_run_script_executed')) assert os.path.isfile(os.path.join(work_root, 'post_run_script_executed'))
def test_verilator_run(): import os.path import tempfile from fusesoc.main import _import ref_dir_cc = os.path.join(ref_dir, 'cc') dummy_exe = 'V'+core.verilator.top_module work_root = tempfile.mkdtemp() eda_api_file = os.path.join(ref_dir_cc, core.name.sanitized_name)+ '.eda.yml' backend = _import(tool)(eda_api_file=eda_api_file, work_root=work_root) shutil.copy(os.path.join(ref_dir, dummy_exe), os.path.join(work_root, dummy_exe)) backend.run(params) compare_files(ref_dir, work_root, ['run.cmd'])
def test_verilator_configure(): import os.path import tempfile from fusesoc.main import _import for mode in ['cc', 'sc', 'lint-only']: work_root = tempfile.mkdtemp() eda_api_file = os.path.join(ref_dir, mode, core.name.sanitized_name) + '.eda.yml' backend = _import(tool)(eda_api_file=eda_api_file, work_root=work_root) if mode is 'cc': _params = params else: _params = [] backend.configure(_params) compare_files(ref_dir, work_root, ['Makefile']) compare_files(os.path.join(ref_dir, mode), work_root, ['config.mk', core.sanitized_name+'.vc'])
def test_vivado_build(): os.environ['PATH'] = os.path.join( tests_dir, 'mock_commands') + ':' + os.environ['PATH'] backend.build() compare_files(ref_dir, work_root, ['run.cmd'])
def test_ghdl_configure(): backend.configure(sim_params) compare_files(ref_dir, work_root, ['Makefile'])