Skip to content

Commit 4a7afda

Browse files
committed
rivierapro: Add vcom_options
1 parent 9cdb876 commit 4a7afda

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

edalize/rivierapro.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class Rivierapro(Edatool):
1919

20-
argtypes = ["plusarg", "vlogdefine", "vlogparam"]
20+
argtypes = ["plusarg", "vlogdefine", "vlogparam", "generic"]
2121

2222
@classmethod
2323
def get_doc(cls, api_ver):
@@ -37,6 +37,11 @@ def get_doc(cls, api_ver):
3737
"type": "String",
3838
"desc": "Additional options for compilation with vlog",
3939
},
40+
{
41+
"name": "vcom_options",
42+
"type": "String",
43+
"desc": "Additional options for compilation with vcom",
44+
},
4045
{
4146
"name": "vsim_options",
4247
"type": "String",
@@ -90,6 +95,7 @@ def _write_build_rtl_tcl_file(self, tcl_main):
9095
args = ["-2008"]
9196
else:
9297
args = []
98+
args += self.tool_options.get("vcom_options", [])
9399
elif f.file_type == "tclSource":
94100
cmd = None
95101
tcl_main.write("do {}\n".format(f.name))
@@ -122,6 +128,9 @@ def _write_build_rtl_tcl_file(self, tcl_main):
122128
elif cmd == "vcom":
123129
if not common_compilation_vhdl:
124130
common_compilation_vhdl += ["vcom"]
131+
common_compilation_vhdl += self.tool_options.get(
132+
"vcom_options", []
133+
)
125134
common_compilation_vhdl += [f.name, "\\\n"]
126135
else:
127136
common_compilation_vhdl += [f.name, "\\\n"]
@@ -164,6 +173,8 @@ def _write_run_tcl_file(self):
164173
# Top-level parameters
165174
for key, value in self.vlogparam.items():
166175
args += ["-g{}={}".format(key, self._param_value_str(value))]
176+
for key, value in self.generic.items():
177+
args += ["-g{}={}".format(key, self._param_value_str(value))]
167178
tcl_launch.write(" ".join(args) + "\n")
168179
tcl_launch.close()
169180

tests/test_rivierapro.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
def test_rivierapro(make_edalize_test):
77
tool_options = {
88
"vlog_options": ["some", "vlog_options"],
9+
"vcom_options": ["have", "number", "of", "vcom_options"],
910
"vsim_options": ["a", "few", "vsim_options"],
1011
}
1112

tests/test_rivierapro/edalize_build_rtl.tcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ vlog some vlog_options -sv +define+vlogdefine_bool=1 +define+vlogdefine_int=42 +
33
vlog some vlog_options +define+vlogdefine_bool=1 +define+vlogdefine_int=42 +define+vlogdefine_str=hello +incdir+. -quiet -work work vlog_file.v
44
vlog some vlog_options +define+vlogdefine_bool=1 +define+vlogdefine_int=42 +define+vlogdefine_str=hello +incdir+. -quiet -work work vlog_with_define.v
55
vlog some vlog_options -v2k5 +define+vlogdefine_bool=1 +define+vlogdefine_int=42 +define+vlogdefine_str=hello +incdir+. -quiet -work work vlog05_file.v
6-
vcom -quiet -work work vhdl_file.vhd
6+
vcom have number of vcom_options -quiet -work work vhdl_file.vhd
77
vlib libx
8-
vcom -quiet -work libx vhdl_lfile
9-
vcom -2008 -quiet -work work vhdl2008_file
8+
vcom have number of vcom_options -quiet -work libx vhdl_lfile
9+
vcom -2008 have number of vcom_options -quiet -work work vhdl2008_file
1010
vlog some vlog_options -sv +define+vlogdefine_bool=1 +define+vlogdefine_int=42 +define+vlogdefine_str=hello +incdir+. -quiet -work work another_sv_file.sv

0 commit comments

Comments
 (0)