OSVVM / OSVVM-Scripts

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

Use absolute path for CurrentWorkingDirectory #34

Closed f-markus closed 1 year ago

f-markus commented 1 year ago

I found that my wave.do is sourced twice, because the checks in proc SimulateRunScripts (OsvvmProjectScript.tcl) fail due to the fact that said variable is just set to '.' (currect directory), while the other paths are absolute. I thus suggest to use the absolute path for CurrentWorkingDirectory as well:

proc include {Path_Or_File} {
  ...
  set JoinName [file join ${StartingPath} ${Path_Or_File}]
  set NormName [file normalize $JoinName] # <--
  set RootDir  [file dirname $NormName]

Having said this, maybe the proc ReducePath can be removed entirely? I realize that you changed [file normalize] to [ReducePath] at some locations explicitly, but I don't know why. Most probably I am missing something, but maybe it's worth regarding anyway

f-markus commented 1 year ago

Now part of PR 35 (https://github.com/OSVVM/OSVVM-Scripts/pull/35)

JimLewis commented 1 year ago

This would be the easy way to handle paths. At one point OSVVM did it this way.

Unfortunately ModelSim/QuestaSim had a bug that caused them to crash when a testbench has a space in the path and you tried to simulate it.

On windows it is not uncommon for someone's design to be located in a directory that has space in the path at an upper level. So relative paths for these is a requirement.

OTOH, there is a place where we check whether to search CurrentWorkingDirectory or not - it will be addressed there.

JimLewis commented 1 year ago

A alternative fix for this is in dev branch