From 24243f319a34496fe34dc81bca6b5213e0721fcd Mon Sep 17 00:00:00 2001 From: TroySharples Date: Tue, 5 Dec 2023 22:34:01 +0000 Subject: [PATCH 1/6] Added support for invoking the GUI for Riviera --- cocotb_test/simulator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cocotb_test/simulator.py b/cocotb_test/simulator.py index f95b82d..11fd11e 100644 --- a/cocotb_test/simulator.py +++ b/cocotb_test/simulator.py @@ -986,7 +986,8 @@ def build_command(self): do_file.write(do_script.encode()) do_file.close() - return [["vsimsa"] + ["-do"] + ["do"] + [do_file.name]] + command = "riviera" if self.gui else "vsimsa" + return [[command] + ["-do"] + ["do"] + [do_file.name]] class Activehdl(Simulator): From fa7b0e599548558b6992d9fb1065e9985c49a467 Mon Sep 17 00:00:00 2001 From: TroySharples <100970209+TroySharples@users.noreply.github.com> Date: Wed, 6 Dec 2023 08:48:57 +0000 Subject: [PATCH 2/6] Fixed the test from running immediately in GUI-mode --- cocotb_test/simulator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cocotb_test/simulator.py b/cocotb_test/simulator.py index 11fd11e..4f2e3db 100644 --- a/cocotb_test/simulator.py +++ b/cocotb_test/simulator.py @@ -980,7 +980,10 @@ def build_command(self): if self.waves: do_script += "trace -recursive /*;" - do_script += "run -all \nexit" + if self.gui: + do_script += "wave -rec *\n" + else: + do_script += "run -all \nexit" do_file = tempfile.NamedTemporaryFile(delete=False) do_file.write(do_script.encode()) From 8688f78277b708f0050cecd3dfee9a3a343c9891 Mon Sep 17 00:00:00 2001 From: TroySharples <100970209+TroySharples@users.noreply.github.com> Date: Wed, 6 Dec 2023 08:55:53 +0000 Subject: [PATCH 3/6] Update simulator.py Disabled the automatic logging of all signals in GUI mode --- cocotb_test/simulator.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cocotb_test/simulator.py b/cocotb_test/simulator.py index 4f2e3db..e3e7054 100644 --- a/cocotb_test/simulator.py +++ b/cocotb_test/simulator.py @@ -980,9 +980,7 @@ def build_command(self): if self.waves: do_script += "trace -recursive /*;" - if self.gui: - do_script += "wave -rec *\n" - else: + if not self.gui: do_script += "run -all \nexit" do_file = tempfile.NamedTemporaryFile(delete=False) From 25d9f4864bf478f38940cbf97f9d419f9a53376a Mon Sep 17 00:00:00 2001 From: TroySharples <100970209+TroySharples@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:09:27 +0100 Subject: [PATCH 4/6] Added option to define external libraries to Riviera PRO Needed for adding pre-compiled libraries (I don't think this mechanism existed previously). --- cocotb_test/simulator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cocotb_test/simulator.py b/cocotb_test/simulator.py index acf6f7d..ea45ebd 100644 --- a/cocotb_test/simulator.py +++ b/cocotb_test/simulator.py @@ -39,6 +39,7 @@ def __init__( toplevel_lang="verilog", verilog_sources=None, vhdl_sources=None, + external_libraries=None, includes=None, defines=None, parameters=None, @@ -101,6 +102,10 @@ def __init__( vhdl_sources = [] self.vhdl_sources = self.get_abs_paths(vhdl_sources) + if external_libraries is None: + external_libraries = [] + self.vhdl_sources = self.get_abs_paths(external_libraries) + if includes is None: includes = [] @@ -931,6 +936,9 @@ def build_command(self): do_script += f"alib {as_tcl_value(self.rtl_library)} \n" + for path in self.external_libraries: + do_script += f"alib {as_tcl_value(path)} \n" + if self.vhdl_sources: compile_args = self.compile_args + self.vhdl_compile_args do_script += "acom -work {RTL_LIBRARY} {EXTRA_ARGS} {VHDL_SOURCES}\n".format( From c57d08700190ac2f556ad8afd605504dade95bb6 Mon Sep 17 00:00:00 2001 From: TroySharples <100970209+TroySharples@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:15:16 +0100 Subject: [PATCH 5/6] Switched order of simulator arguments --- cocotb_test/simulator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocotb_test/simulator.py b/cocotb_test/simulator.py index ea45ebd..487697f 100644 --- a/cocotb_test/simulator.py +++ b/cocotb_test/simulator.py @@ -39,7 +39,6 @@ def __init__( toplevel_lang="verilog", verilog_sources=None, vhdl_sources=None, - external_libraries=None, includes=None, defines=None, parameters=None, @@ -59,6 +58,7 @@ def __init__( timescale=None, gui=False, simulation_args=None, + external_libraries=None, **kwargs, ): From 5aa04bc24455f3e97f261f7bd25cbce4cb91c76b Mon Sep 17 00:00:00 2001 From: TroySharples <100970209+TroySharples@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:25:01 +0100 Subject: [PATCH 6/6] Fixed typo in simulator.py introduced in first commit --- cocotb_test/simulator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocotb_test/simulator.py b/cocotb_test/simulator.py index 487697f..7e29bdb 100644 --- a/cocotb_test/simulator.py +++ b/cocotb_test/simulator.py @@ -104,7 +104,7 @@ def __init__( if external_libraries is None: external_libraries = [] - self.vhdl_sources = self.get_abs_paths(external_libraries) + self.external_libraries = self.get_abs_paths(external_libraries) if includes is None: includes = []