-
Notifications
You must be signed in to change notification settings - Fork 73
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
simulator: Add support for NVC #248
Conversation
@nickg: If you have the time, I'd greatly appreciate it if you could review this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me apart from the ghw/fst thing.
cocotb_test/simulator.py
Outdated
cmd.append(cmd_elaborate) | ||
|
||
if self.waves: | ||
self.simulation_args.append(f"--wave={self.toplevel_module}.ghw") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extension should be .fst
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed!
ba17b59
to
892145a
Compare
Now that upstream support has been merged, I ran the simple DFF test case again and it passes, but throws some error messages along the way. Does anyone have some pointers on where I need to look or whether these are sort of expected? Here's the command output:
EDIT: I expect the cocotb.fork to be unrelated, but I'm worried about the |
If you update to the latest master branch of nvc those VHPI errors should be gone (actually they are hidden unless you pass the By default all diagnostic messages are printed to |
@cocotb-test maintainers: I have a question about argument handling. NVC has two types of arguments, before-COMMAND (general, e.g. --std=08 to set the language standard), and after-COMMAND (specific to the step, e.g. -g for settings generics during elaboration). And these two types must be places in different places in the command string. Now, in theory, cocotb-test has this as well in the form of Do you have a suggestions on how to handle this? I think to get support for NVC off the ground, it's OK to only support before-COMMAND arguments for now as those are the more important ones (such as setting the language revision), but I would like to hear your thoughts. EDIT: My implementation right now "abuses" compile_args as before-COMMAND and vhdl_compile_args as after-COMMAND, but that isn't really great either... |
I moved the I also "cleaned up" the initialization code with all of the Also, I rebased everything onto the latest master. |
Hmmm, the NVC CI run fails because the used cocotb version is too old. Probably because NVC support hasn't made it into a release yet (but it is merged). Any opinions on how to handle that for now? |
Seems like NVC support is not released yet. Would need to use the git/devel version for NVC somehow. |
Rebased onto latest master. Do you think it'd make sense to implement something like 8c7c060 to test NVC support against the latest master (v2.x.x) while the other tests run against the last official release? I guess the upside would be that we can merge this, but it would also mean that cocotb-test would show support for NVC for people running the old cocotb, which then breaks when trying to use it. My guess is we'll really just have to wait for cocotb 2.0.0... |
1.9 is realised with NVC support. I guess we can move to 1.9. |
@m42uko Can you force push to trigger CI? There is something wrong with CI. |
Done. |
I hope there are no other breaking changes in Cocotb 1.9. I recently built cocotb-test "against" Cocotb master (2.x) and there were various API changes that needed updating in cocotb-test (like change of environment variable names etc.). |
Should I edit cocotb-test/azure-pipelines.yml Line 123 in d2e70f5
|
I have updated it to 1.9 in master. PS. I will fix the cocotb version to 1.9 in the setup script for now. |
Rebased. EDIT: Sorry, just saw now that you ran it with the change already -- will investigate. |
This is required for NVC as it has positional arguments. Things like the VHDL revision must be placed before selecting the step (elaborate, run, etc.), whereas specific arguments (like waves) must be placed after the command. This commit also includes some refactoring to clean up the simulator class initialization, but does not change any functionality there besides not concatenating args with extra_args.
Two bugs fixed:
🤞 that it passes now :) |
Thank you for PR and refactoring. |
This PR adds support for the NVC VHDL simulator.
This PR is a ready for review: