OSVVM / OSVVM-Scripts

OSVVM project simulation scripts. Scripts are tedious. These scripts simplify the steps to compile your project for simulation
Other
10 stars 14 forks source link

Possibly unintended return value #44

Closed riedel-ferringer closed 1 year ago

riedel-ferringer commented 1 year ago

https://github.com/OSVVM/OSVVM-Scripts/blob/ce28ff0ac38a3ca525786e8757d3187d467ec46e/VendorScripts_Siemens.tcl#L63

I stumbled upon something similar in my own code. The problem here is (as far as I understand) that exec vsim -version executes the vsim which is references in the system's PATH variable. Suppose you are using a specific vsim to execute the simulation: .../2023.2/bin/vsim -do "..." if your PATH=.../2021.2/bin then exec vsim -version would return ModelSim 2021.2, which is most probably not the intended result. Unfortunately, I don't know what to do about it. And the vsimVersionString method works fine anyway. I just wanted to point that out because it took me a while to figure it out :-)

BTW, it is not possible to remove the exec and just run vsim -version, because this somehow corrupts ModelSim, which throws an error "No design!" when trying to run the simulation.

JimLewis commented 1 year ago

vsimVersionString and vsimVersion work correctly if running from within the Questa/ModelSim gui.

However if you are running from the command line they do not exist (at least on the windows install), so the exec vsim -version is to catch those cases. This allows the scripts to return useful values when running Questa/ModelSim from tclsh.

riedel-ferringer commented 1 year ago

OK, thanks for the clarification.