diff --git a/edalize/tools/vcs.py b/edalize/tools/vcs.py index 29097546..3b9d3958 100644 --- a/edalize/tools/vcs.py +++ b/edalize/tools/vcs.py @@ -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", @@ -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") @@ -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", {})) @@ -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 = {} @@ -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] @@ -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],