From bab0dc9d771b6c4b691fb0801cc0df6e908ac29a Mon Sep 17 00:00:00 2001 From: Olof Kindgren Date: Mon, 11 Nov 2024 10:13:28 +0100 Subject: [PATCH] wip: Add testcase --- tests/test_tool_vcs.py | 27 ++++++++++++++++++++++ tests/tools/vcs/basic/Makefile | 18 +++++++++++++++ tests/tools/vcs/basic/synopsys_sim.setup | 3 +++ tests/tools/vcs/minimal/Makefile | 18 +++++++++++++++ tests/tools/vcs/minimal/synopsys_sim.setup | 3 +++ 5 files changed, 69 insertions(+) create mode 100644 tests/test_tool_vcs.py create mode 100644 tests/tools/vcs/basic/Makefile create mode 100644 tests/tools/vcs/basic/synopsys_sim.setup create mode 100644 tests/tools/vcs/minimal/Makefile create mode 100644 tests/tools/vcs/minimal/synopsys_sim.setup diff --git a/tests/test_tool_vcs.py b/tests/test_tool_vcs.py new file mode 100644 index 00000000..97132eb8 --- /dev/null +++ b/tests/test_tool_vcs.py @@ -0,0 +1,27 @@ +from .edalize_tool_common import tool_fixture + + +def test_tool_vcs(tool_fixture): + + tool_options = { + "vlogan_options": ["a", "few", "vlogan", "options"], + "vlogan_options": ["also", "vhdlan", "options"], + "vcs_options": ["some", "vcs", "options"], + "run_options": ["and", "some", "run", "options"], + } + + tf = tool_fixture("vcs", tool_options=tool_options, ref_subdir="basic") + + name = "design" + + tf.tool.configure() + tf.compare_config_files(["synopsys_sim.setup"]) + + +def test_tool_vcs_minimal(tool_fixture): + tf = tool_fixture("vcs", ref_subdir="minimal") + + name = "design" + + tf.tool.configure() + tf.compare_config_files(["synopsys_sim.setup"]) diff --git a/tests/tools/vcs/basic/Makefile b/tests/tools/vcs/basic/Makefile new file mode 100644 index 00000000..3a349077 --- /dev/null +++ b/tests/tools/vcs/basic/Makefile @@ -0,0 +1,18 @@ +#Auto generated by Edalize + +all: design + +work: sv_file.sv vlog_file.v vlog05_file.v vhdl_file.vhd vhdl2008_file another_sv_file.sv vlog_incfile vlog_incfile + $(EDALIZE_LAUNCHER) mkdir work + $(EDALIZE_LAUNCHER) vlogan also vhdlan options +define+vlogdefine_bool=1 +define+vlogdefine_int=42 +define+vlogdefine_str=\"hello\" +incdir+. -work work sv_file.sv vlog_file.v vlog05_file.v another_sv_file.sv + $(EDALIZE_LAUNCHER) vhdlan -work work vhdl_file.vhd vhdl2008_file + +libx: vhdl_lfile + $(EDALIZE_LAUNCHER) mkdir libx + $(EDALIZE_LAUNCHER) vhdlan -work libx vhdl_lfile + +design: work libx user_file + $(EDALIZE_LAUNCHER) vcs -o design -top top_module some vcs options -pvalue+vlogparam_bool=1 -pvalue+vlogparam_int=42 -pvalue+vlogparam_str=hello + +run: design + $(EDALIZE_LAUNCHER) ./design diff --git a/tests/tools/vcs/basic/synopsys_sim.setup b/tests/tools/vcs/basic/synopsys_sim.setup new file mode 100644 index 00000000..07124e38 --- /dev/null +++ b/tests/tools/vcs/basic/synopsys_sim.setup @@ -0,0 +1,3 @@ +WORK > DEFAULT +DEFAULT : ./work +libx : ./libx diff --git a/tests/tools/vcs/minimal/Makefile b/tests/tools/vcs/minimal/Makefile new file mode 100644 index 00000000..4a39653d --- /dev/null +++ b/tests/tools/vcs/minimal/Makefile @@ -0,0 +1,18 @@ +#Auto generated by Edalize + +all: design + +work: sv_file.sv vlog_file.v vlog05_file.v vhdl_file.vhd vhdl2008_file another_sv_file.sv + $(EDALIZE_LAUNCHER) mkdir work + $(EDALIZE_LAUNCHER) vlogan +define+vlogdefine_bool=1 +define+vlogdefine_int=42 +define+vlogdefine_str=\"hello\" -work work sv_file.sv vlog_file.v vlog05_file.v another_sv_file.sv + $(EDALIZE_LAUNCHER) vhdlan -work work vhdl_file.vhd vhdl2008_file + +libx: vhdl_lfile + $(EDALIZE_LAUNCHER) mkdir libx + $(EDALIZE_LAUNCHER) vhdlan -work libx vhdl_lfile + +design: work libx user_file + $(EDALIZE_LAUNCHER) vcs -o design -top top_module -pvalue+vlogparam_bool=1 -pvalue+vlogparam_int=42 -pvalue+vlogparam_str=hello + +run: design + $(EDALIZE_LAUNCHER) ./design diff --git a/tests/tools/vcs/minimal/synopsys_sim.setup b/tests/tools/vcs/minimal/synopsys_sim.setup new file mode 100644 index 00000000..07124e38 --- /dev/null +++ b/tests/tools/vcs/minimal/synopsys_sim.setup @@ -0,0 +1,3 @@ +WORK > DEFAULT +DEFAULT : ./work +libx : ./libx