Skip to content

Commit f108a2a

Browse files
pib88umarcor
authored andcommitted
Update rivierapro.py
Special string parameters like tb_path and output_path should be in quotes when used in verilog
1 parent 5d4fc21 commit f108a2a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vunit/sim_if/rivierapro.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def _create_load_function(self, test_suite_name, config, output_path): # pylint
279279
Create the vunit_load TCL function that runs the vsim command and loads the design
280280
"""
281281
set_generic_str = " ".join(
282-
(f"-g/{config.entity_name!s}/{name!s}={format_generic(value)!s}" for name, value in config.generics.items())
282+
(f"-g/{config.entity_name!s}/{name!s}={format_generic(name, value)!s}" for name, value in config.generics.items())
283283
)
284284
pli_str = " ".join(f'-pli "{fix_path(name)}"' for name in config.sim_options.get("pli", []))
285285

@@ -424,12 +424,13 @@ def merge_coverage(self, file_name, args=None):
424424
print("Done merging coverage files")
425425

426426

427-
def format_generic(value):
427+
def format_generic(name, value):
428428
"""
429429
Generic values with space in them need to be quoted
430+
We know that tb_path and output_path are strings - they also need to be in quote
430431
"""
431432
value_str = str(value)
432-
return f'"{value_str!s}"' if " " in value_str else value_str
433+
return f'"{value_str!s}"' if " " in value_str or name == "output_path" or name == "tb_path" else value_str
433434

434435

435436
class VersionConsumer(object):

0 commit comments

Comments
 (0)