Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for empty macro issue in Riviera-PRO #681

Merged
merged 2 commits into from
Sep 23, 2020

Conversation

pib88
Copy link
Contributor

@pib88 pib88 commented Sep 22, 2020

When you add sources and create empty macro like following:
VU.add_library("tb_uart_lib").add_source_files(SRC_PATH / "test" / "*.sv", defines={"EMPTY_MACRO" : ""})

It adds to vlog command a following switch:
vlog +define+EMPTY_MACRO=

However in Riviera-PRO it ends with following error:
ERROR VCP0501 "Missing option argument in command line. Option -dv requires an argument."

To workaround this you need to remove '=' operator when macro has no value.

@@ -210,7 +210,10 @@ def compile_verilog_file_command(self, source_file):
for include_dir in source_file.include_dirs:
args += ["+incdir+%s" % include_dir]
for key, value in source_file.defines.items():
args += ["+define+%s=%s" % (key, value)]
if value != "":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about the following?

args += ["+define+%s" % key]
if value:
    args[-1] += "=%s" % value

Also, please, run tox -e py38-fmt for getting rid of CI errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated code with your solution. Seems like it passes in tox tests now

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Errors were produced because of an indentation issue. Your code was otherwise correct too. The change was just a style preference, since it had to be edited.

Thanks!

Workaround for empty macro issue in Riviera-PRO - more elegant solution
@eine eine merged commit f1dacbe into VUnit:master Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants