Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Dec 6, 2024
1 parent 68fe7b3 commit 99fd1c0
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 31 deletions.
12 changes: 7 additions & 5 deletions edalize/tools/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def setup(self, edam):
self.commands = EdaCommands()
self.f_files = {}
self.workdirs = []
target_files = []
for lib, files in libs.items():
cmds = {}
has_vlog = False
Expand All @@ -130,9 +131,11 @@ def setup(self, edam):
options += self.tool_options.get("vlogan_options", [])
options += [defines]
options += ["+incdir+" + d for d in incdirs]
target_file = "AN.DB/make.vlogan"
elif cmd == "vhdlan":
options += self.tool_options.get("vhdlan_options", [])
suffix = f".{i}" if i else ""
target_file = "64/vhmra.sdb"
suffix = f"_{i}" if i else ""
f_file = f"{lib}{suffix}.f"
f_files[f_file] = options
workdir = lib + suffix
Expand All @@ -142,9 +145,10 @@ def setup(self, edam):
depfiles += include_files
self.commands.add(
[cmd] + full64 + ["-f", f_file, "-work", workdir] + fnames,
[workdir + "/AN.DB/make.vlogan"],
[workdir + "/" + target_file],
depfiles + [f_file],
)
target_files.append(workdir + "/" + target_file)
self.f_files.update(f_files)

self.edam = edam.copy()
Expand All @@ -158,9 +162,7 @@ def setup(self, edam):
+ full64
+ ["-o", self.name, "-file", "vcs.f", "-parameters", "parameters.txt"],
[self.name],
[x + "/AN.DB/make.vlogan" for x in self.workdirs]
+ user_files
+ ["vcs.f", "parameters.txt"],
target_files + user_files + ["vcs.f", "parameters.txt"],
)

self.commands.add(
Expand Down
16 changes: 8 additions & 8 deletions tests/test_tool_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def test_tool_vcs(tool_fixture):
tf.compare_config_files(
[
"synopsys_sim.setup",
"libx.1.f",
"libx.f",
"vcs.f",
"work.1.f",
"work.2.f",
"work.3.f",
"work.f",
"work_1.f",
"work_2.f",
"parameters.txt",
]
)
Expand All @@ -38,11 +38,11 @@ def test_tool_vcs_minimal(tool_fixture):
tf.compare_config_files(
[
"synopsys_sim.setup",
"libx.1.f",
"libx.f",
"vcs.f",
"work.1.f",
"work.2.f",
"work.3.f",
"work.f",
"work_1.f",
"work_2.f",
"parameters.txt",
]
)
20 changes: 11 additions & 9 deletions tests/tools/vcs/basic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

all: design

work/AN.DB: sv_file.sv vlog_file.v vlog_with_define.v vlog05_file.v vhdl_file.vhd vhdl2008_file another_sv_file.sv vlog_incfile work.1.f work.2.f work.3.f
$(EDALIZE_LAUNCHER) mkdir -p work
$(EDALIZE_LAUNCHER) vlogan -full64 -f work.1.f -work work sv_file.sv vlog_file.v vlog05_file.v another_sv_file.sv
$(EDALIZE_LAUNCHER) vlogan -full64 -f work.2.f -work work vlog_with_define.v
$(EDALIZE_LAUNCHER) vhdlan -full64 -f work.3.f -work work vhdl_file.vhd vhdl2008_file
work/AN.DB/make.vlogan: sv_file.sv vlog_file.v vlog05_file.v another_sv_file.sv vlog_incfile work.f
$(EDALIZE_LAUNCHER) vlogan -full64 -f work.f -work work sv_file.sv vlog_file.v vlog05_file.v another_sv_file.sv

libx/AN.DB: vhdl_lfile libx.1.f
$(EDALIZE_LAUNCHER) mkdir -p libx
$(EDALIZE_LAUNCHER) vhdlan -full64 -f libx.1.f -work libx vhdl_lfile
work_1/AN.DB/make.vlogan: vlog_with_define.v vlog_incfile work_1.f
$(EDALIZE_LAUNCHER) vlogan -full64 -f work_1.f -work work_1 vlog_with_define.v

design: work/AN.DB libx/AN.DB user_file vcs.f parameters.txt
work_2/64/vhmra.sdb: vhdl_file.vhd vhdl2008_file vlog_incfile work_2.f
$(EDALIZE_LAUNCHER) vhdlan -full64 -f work_2.f -work work_2 vhdl_file.vhd vhdl2008_file

libx/64/vhmra.sdb: vhdl_lfile libx.f
$(EDALIZE_LAUNCHER) vhdlan -full64 -f libx.f -work libx vhdl_lfile

design: work/AN.DB/make.vlogan work_1/AN.DB/make.vlogan work_2/64/vhmra.sdb libx/64/vhmra.sdb user_file vcs.f parameters.txt
$(EDALIZE_LAUNCHER) vcs -full64 -o design -file vcs.f -parameters parameters.txt

run: design
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/tools/vcs/basic/synopsys_sim.setup
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
WORK > DEFAULT
DEFAULT : ./work
work_1 : ./work_1
work_2 : ./work_2
libx : ./libx
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 11 additions & 9 deletions tests/tools/vcs/minimal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

all: design

work/AN.DB: sv_file.sv vlog_file.v vlog_with_define.v vlog05_file.v vhdl_file.vhd vhdl2008_file another_sv_file.sv vlog_incfile work.1.f work.2.f work.3.f
$(EDALIZE_LAUNCHER) mkdir -p work
$(EDALIZE_LAUNCHER) vlogan -full64 -f work.1.f -work work sv_file.sv vlog_file.v vlog05_file.v another_sv_file.sv
$(EDALIZE_LAUNCHER) vlogan -full64 -f work.2.f -work work vlog_with_define.v
$(EDALIZE_LAUNCHER) vhdlan -full64 -f work.3.f -work work vhdl_file.vhd vhdl2008_file
work/AN.DB/make.vlogan: sv_file.sv vlog_file.v vlog05_file.v another_sv_file.sv vlog_incfile work.f
$(EDALIZE_LAUNCHER) vlogan -full64 -f work.f -work work sv_file.sv vlog_file.v vlog05_file.v another_sv_file.sv

libx/AN.DB: vhdl_lfile libx.1.f
$(EDALIZE_LAUNCHER) mkdir -p libx
$(EDALIZE_LAUNCHER) vhdlan -full64 -f libx.1.f -work libx vhdl_lfile
work_1/AN.DB/make.vlogan: vlog_with_define.v vlog_incfile work_1.f
$(EDALIZE_LAUNCHER) vlogan -full64 -f work_1.f -work work_1 vlog_with_define.v

design: work/AN.DB libx/AN.DB user_file vcs.f parameters.txt
work_2/64/vhmra.sdb: vhdl_file.vhd vhdl2008_file vlog_incfile work_2.f
$(EDALIZE_LAUNCHER) vhdlan -full64 -f work_2.f -work work_2 vhdl_file.vhd vhdl2008_file

libx/64/vhmra.sdb: vhdl_lfile libx.f
$(EDALIZE_LAUNCHER) vhdlan -full64 -f libx.f -work libx vhdl_lfile

design: work/AN.DB/make.vlogan work_1/AN.DB/make.vlogan work_2/64/vhmra.sdb libx/64/vhmra.sdb user_file vcs.f parameters.txt
$(EDALIZE_LAUNCHER) vcs -full64 -o design -file vcs.f -parameters parameters.txt

run: design
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/tools/vcs/minimal/synopsys_sim.setup
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
WORK > DEFAULT
DEFAULT : ./work
work_1 : ./work_1
work_2 : ./work_2
libx : ./libx
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 99fd1c0

Please sign in to comment.