当前位置: 首页>>代码示例>>Python>>正文


Python ostools.renew_path函数代码示例

本文整理汇总了Python中vunit.ostools.renew_path函数的典型用法代码示例。如果您正苦于以下问题:Python renew_path函数的具体用法?Python renew_path怎么用?Python renew_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了renew_path函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: simulate

    def simulate(self, output_path,  # pylint: disable=too-many-arguments
                 library_name, entity_name, architecture_name, config, elaborate_only):
        """
        Run a test bench
        """
        sim_output_path = abspath(join(output_path, self.name))
        common_file_name = join(sim_output_path, "common.tcl")
        batch_file_name = join(sim_output_path, "batch.tcl")
        gui_file_name = join(sim_output_path, "gui.tcl")

        write_file(common_file_name,
                   self._create_common_script(library_name,
                                              entity_name,
                                              architecture_name,
                                              config))
        write_file(gui_file_name,
                   self._create_gui_script(common_file_name))
        write_file(batch_file_name,
                   self._create_batch_script(common_file_name, elaborate_only))

        if self._gui:
            gui_path = join(sim_output_path, "gui")
            renew_path(gui_path)
            return self._run_batch_file(gui_file_name, gui=True,
                                        cwd=gui_path)
        else:
            return self._run_batch_file(batch_file_name, gui=False,
                                        cwd=dirname(self._library_cfg))
开发者ID:mark-newsam,项目名称:vunit,代码行数:28,代码来源:activehdl_interface.py

示例2: setUp

    def setUp(self):
        self.tmp_path = join(dirname(__file__), "test_ui_tmp")
        renew_path(self.tmp_path)
        self.cwd = os.getcwd()
        os.chdir(self.tmp_path)

        self._output_path = join(self.tmp_path, 'output')
        self._preprocessed_path = join(self._output_path, "preprocessed")
开发者ID:ludli505,项目名称:vunit,代码行数:8,代码来源:test_ui.py

示例3: _create_output_path

    def _create_output_path(self, clean):
        """
        Create or re-create the output path if necessary
        """
        if clean:
            ostools.renew_path(self._output_path)
        elif not exists(self._output_path):
            os.makedirs(self._output_path)

        ostools.renew_path(self._preprocessed_path)
开发者ID:varunnagpaal,项目名称:vunit,代码行数:10,代码来源:ui.py

示例4: _run_test_suite

    def _run_test_suite(self, test_suite, write_stdout, num_tests):
        """
        Run the actual test suite
        """
        start_time = ostools.get_time()

        output_path = join(self._output_path, test_suite.name)
        output_file_name = join(output_path, "output.txt")

        try:
            # If we could not clean output path, fail all tests
            ostools.renew_path(output_path)
            output_file = open(output_file_name, "w")
        except KeyboardInterrupt:
            raise
        except:  # pylint: disable=bare-except
            results = self._fail_suite(test_suite)
            with self._lock:
                traceback.print_exc()
                self._add_results(test_suite, results, start_time, num_tests)
            return

        try:
            if write_stdout:
                stdout = LogColorOverlay(
                    stream=self._stdout,
                    printer=self._printer,
                    vhdl_report_parser_callback=self.vhdl_report_parser_callback)
                self._local.output = TeeToFile([stdout, output_file])
            else:
                self._local.output = TeeToFile([output_file])

            results = test_suite.run(output_path)
        except KeyboardInterrupt:
            raise
        except:  # pylint: disable=bare-except
            traceback.print_exc()
            results = self._fail_suite(test_suite)
        finally:
            self._local.output = self._stdout
            output_file.flush()
            output_file.close()

        any_not_passed = any(value != PASSED for value in results.values())

        with self._lock:
            if (not write_stdout) and (any_not_passed or self._verbose):
                stdout = LogColorOverlay(
                    stream=sys.stdout,
                    printer=self._printer,
                    vhdl_report_parser_callback=self.vhdl_report_parser_callback)
                self._print_output(output_file_name, stdout)
            self._add_results(test_suite, results, start_time, num_tests)
开发者ID:suoto,项目名称:vunit,代码行数:53,代码来源:test_runner.py

示例5: __init__

    def __init__(self, path, new=False):
        """
        Create database in path
        - path is a directory
        - new create new database
        """
        self._path = path

        if new:
            renew_path(path)
        elif not exists(path):
            os.makedirs(path)

        # Map keys to nodes indexes
        self._keys_to_nodes = self._discover_nodes()
        if not self._keys_to_nodes:
            self._next_node = 0
        else:
            self._next_node = max(self._keys_to_nodes.values()) + 1
开发者ID:barri,项目名称:vunit,代码行数:19,代码来源:database.py

示例6: simulate

    def simulate(self, output_path, test_suite_name, config, elaborate_only):
        """
        Run a test bench
        """
        script_path = join(output_path, self.name)
        common_file_name = join(script_path, "common.tcl")
        batch_file_name = join(script_path, "batch.tcl")
        gui_file_name = join(script_path, "gui.tcl")

        write_file(common_file_name,
                   self._create_common_script(config, output_path))
        write_file(gui_file_name,
                   self._create_gui_script(common_file_name, config))
        write_file(batch_file_name,
                   self._create_batch_script(common_file_name, elaborate_only))

        if self._gui:
            gui_path = join(script_path, "gui")
            renew_path(gui_path)
            return self._run_batch_file(gui_file_name, gui=True,
                                        cwd=gui_path)

        return self._run_batch_file(batch_file_name, gui=False,
                                    cwd=dirname(self._library_cfg))
开发者ID:barri,项目名称:vunit,代码行数:24,代码来源:activehdl_interface.py

示例7: setUp

 def setUp(self):
     self._tests = []
     self.output_path = join(dirname(__file__), "test_runner_out")
     renew_path(self.output_path)
     self.report = TestReport()
     self.runner = TestRunner(self.report, self.output_path)
开发者ID:KevinKes,项目名称:vunit,代码行数:6,代码来源:test_test_runner.py

示例8: setUp

 def setUp(self):
     self.output_path = join(dirname(__file__), "test_modelsim_out")
     renew_path(self.output_path)
     self.project = Project()
     self.cwd = os.getcwd()
     os.chdir(self.output_path)
开发者ID:suoto,项目名称:vunit,代码行数:6,代码来源:test_modelsim_interface.py

示例9: setUp

 def setUp(self):
     self.simulator_if = 'simulator_if'
     self.configuration = TestConfiguration()
     self.test_scanner = TestScanner(self.simulator_if, self.configuration)
     self.output_path = join(dirname(__file__), "test_scanner_out")
     renew_path(self.output_path)
开发者ID:varunnagpaal,项目名称:vunit,代码行数:6,代码来源:test_test_scanner.py

示例10: setUp

 def setUp(self):
     self.tmp_dir = join(dirname(__file__), "test_ostools_tmp")
     renew_path(self.tmp_dir)
开发者ID:darwinbeing,项目名称:vunit,代码行数:3,代码来源:test_ostools.py

示例11: setUp

    def setUp(self):
        self.cfg = TestConfiguration()

        self.output_path = out()
        renew_path(self.output_path)
开发者ID:varunnagpaal,项目名称:vunit,代码行数:5,代码来源:test_test_configuration.py

示例12: setUp

 def setUp(self):
     self.output_path = join(dirname(__file__), "test_verilog_preprocessor_out")
     renew_path(self.output_path)
     self.cwd = os.getcwd()
     os.chdir(self.output_path)
开发者ID:KevinKes,项目名称:vunit,代码行数:5,代码来源:test_verilog_preprocessor.py

示例13: setUp

 def setUp(self):
     self.output_path = join(dirname(__file__), "test_verilog_preprocessor_out")
     renew_path(self.output_path)
开发者ID:varunnagpaal,项目名称:vunit,代码行数:3,代码来源:test_verilog_preprocessor.py


注:本文中的vunit.ostools.renew_path函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。