-
Notifications
You must be signed in to change notification settings - Fork 194
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
Add cocotb verilator flow_tool option #409
Conversation
edalize/flows/sim.py
Outdated
@@ -23,6 +24,8 @@ class Sim(Generic): | |||
def configure_tools(self, flow): | |||
if self.flow_options.get("cocotb_module"): | |||
tool = self.flow_options.get("tool") | |||
share_dir = os.popen("cocotb-config --share").read().rstrip() \ |
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.
I wouild prefer evaluating cocotb-config --share
directly like we do with cocotb-config --libdir
. That makes the script more portable if we want to run it on a different machine than it was created on.
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.
fixed by changing the share directory evaluation to a direct call in tools/verilator.py rather than a system call. see commit aa7d8c3.
Many thanks. A very welcome addition and I'm hoping to find some time to try it myself. I just had a smaller comment above. Happy to merge if you could fix that. |
update cocotb specific verilator.cpp command to use local cocotb-config call rather than system call
update cocotb specific verilator.cpp command to use local cocotb-config call rather than system call
remove unused import call
Thanks. Code looks fine now, but regression tests are failing and there seems to be two reasons for that.
|
I fixed the format issue by following your suggestions. I agree with your assessment of using flow_options in the tool specific flow and I'm open to working on a permanent fix soon. I tested the verilator.py changes without flow_options and it looks like your suggested change fixed the crashing issue. |
There was still some formatting issues in sim.py, but I took the liberty to fix that locally. Squashed and pushed! Thank you for your contributions! |
This PR adds verilator as a cocotb flow_tool simulation option by adding the cocotb "extend an existing build flow" options in sim.py. It also adds a switch to the verilator makefile call to use "Vtop.mk" instead of "V 'cocotb-module'.mk".
A cocotb simulation running on verilator can then be run using just the following fusesoc simulation configuration