Skip to content

Commit

Permalink
fvcs
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Nov 18, 2024
1 parent 37612dd commit 1978d53
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion edalize/tools/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class Vcs(Edatool):
description = "VCS simulator from Synopsys"

TOOL_OPTIONS = {
"default_options": {
"type": "str",
"desc": "Default options for vlogan/vhdlan/vcs. Defaults to '-full64'",
"list": True,
},
"vlogan_options": {
"type": "str",
"desc": "Additional options for analysis with vlogan",
Expand Down Expand Up @@ -56,6 +61,7 @@ def setup(self, edam):
user_files = []
commands = {}
libs = {}
has_sv = False
for f in unused_files.copy():
lib = f.get("logical_name", "work")

Expand All @@ -64,6 +70,9 @@ def setup(self, edam):
"systemVerilogSource"
):

if file_type.startswith("systemVerilogSource"):
has_sv = True

vlog_defines = self.vlogdefine.copy()
vlog_defines.update(f.get("define", {}))

Expand Down Expand Up @@ -96,6 +105,7 @@ def setup(self, edam):
commands[(cmd, lib, defines)].append(f["name"])
unused_files.remove(f)

default_options = self.tool_options.get("default_options", ["-full64"])
self.commands = EdaCommands()
for lib, files in libs.items():
cmds = {}
Expand All @@ -111,8 +121,10 @@ def setup(self, edam):
has_vlog = True
commands = [["mkdir", lib]]
for (cmd, defines), fnames in cmds.items():
options = []
options = default_options.copy()
if cmd == "vlogan":
if has_sv:
options.append("-sverilog")
options += self.tool_options.get("vlogan_options", [])
options += [defines]
options += ["+incdir+" + d for d in incdirs]
Expand All @@ -133,6 +145,7 @@ def setup(self, edam):

self.commands.add(
["vcs", "-o", self.name, "-top", self.toplevel]
+ default_options
+ self.tool_options.get("vcs_options", [])
+ parameters,
[self.name],
Expand Down

0 comments on commit 1978d53

Please sign in to comment.