-
Notifications
You must be signed in to change notification settings - Fork 502
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
Questa: start simulation from PWD, not PWD/sim_build #1063
Conversation
For what it's worth, here is a very simple example project where simulation successfully starts with Cadence and Icarus but fails with Questa for this issue. |
Hard to say what should be a desirable way. VCS and aldec makefile seem also different. In cocotb-test I decided to run all simulators form sim_build. One alternative (maybe in any case) would be to make an absolute path for sources in Makefile (maybe here: https://github.com/cocotb/cocotb/blob/master/cocotb/share/makefiles/Makefile.sim) before giving this to the simulator (I do this in cocotb-test). In makefile can call python to do this or In any case, if we change should change everywhere the same way. Touching those Makefiles is always "controversial". |
I like this idea, it seems much more elegant than just moving the location the simulator starts from around. (I briefly wondered if this could be done by passing an argument to vsim/vlog but didn't think to try changing it in Makefile.sim). For the makefile approach, perhaps we could have some new parameter ( I can try to put that together and submit a new PR. Separately, I'm still wondering whether or not it would be good to be consistent about where the simulators start from, but as you say it'd be better to fix that across all the simulators rather than one at a time. (I only have access to questa, ius, and icarus at the moment, which is why I only looked at those). |
@TC01 in cocotb-test I did different/simple compatibility/adoption (https://github.com/themperek/cocotb-test/blob/master/cocotb_test/Makefile.inc) so we do not have to maintain 2 systems. We need @imphil to help on this. |
Thanks for this PR and your quest for consistency @TC01! I'd say the current behavior of how relative paths in VERILOG_SOURCES/VHDL_SOURCES is somewhat "undefined behavor"; all our examples and our documentation use absolute paths. To push this forward,
My thinking on this:
|
Sure! I'll push a new commit here to update the documentation. |
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 for your update @TC01! I have left a couple comments inline.
440e413
to
2a3e191
Compare
09c57ac
to
115c4f7
Compare
I also just noticed that these changes moved sim.log from Let me know how I should proceed here: if this looks okay as is or if we want to take a different approach in making the simulators consistent. |
Related: #838 |
PIng @imphil? |
The Icarus and Cadence (ius) simulator targets run the simulation relative to PWD; i.e. the location of the Makefile. The Questa one, though, seems to run everything out of the sim_build directory. This commit changes the questa Makefile to run from ${PWD}, while keeping the "work" library and the run script in sim_build, for better compatibility with the other simulators. In particular, I just tried to port a project from Cadence to Questa and found that, because my Makefile didn't say ${PWD} but instead just provided source paths relative to the current working directory, the simulation would not start. Hence this change. Hopefully this does not break anything: it would be great if people with Questa projects could test!
If the paths are relative, then they will be interpreted as relative to the Makefile location (i.e. the file that they are defined in). This may not be true for all simulators at the moment, in which case that should be fixed.
8c4f796
to
777f772
Compare
@TC01 sorry for the significant delay. I've rebased this PR on top of master, and will merge it once CI passes. |
The Icarus and Cadence (ius) simulator targets run the simulation relative to
${PWD}
; i.e. the location of the Makefile. The Questa one, though, seems to run everything out of the${PWD}/sim_build
directory.This commit changes the questa Makefile to run from
${PWD}
, while keeping the "work" library and the run script in sim_build, for better compatibility with the other simulators.In particular, I just tried to port a project from Cadence to Questa and found that, because my Makefile didn't explicitly refer to
${PWD}
but instead just provided source paths relative to the current working directory, the simulation would not start. Hence this change.Hopefully this does not break anything: it would be great if people with more mature Questa projects could test!
I should say: it's possible that this isn't desired behavior. In which case, maybe the other simulators should be changed instead for consistency? (This all also may be immaterial if the makefile approach to cocotb is replaced with the purer-Python cocotb-test approach, but assuming we keep some kind of compatibility layer with the Makefiles, it would probably still be good to fix this).