HDLUtils / hdlregression

MIT License
15 stars 5 forks source link

Current working directory is different in gui mode. #3

Open drowzie opened 1 year ago

drowzie commented 1 year ago

In the vhdl testbench i want to open an external file. But when i run it in gui mode(-g arg), the current working directory seems to be from the where script is run.

When i run it without gui mode(-g arg) i need to go up directories as such: constant c_proj_path : string := "../../../../"; whereas gui mode requires constant c_proj_path : string := "";

drowzie commented 1 year ago

Searched a bit through the code. I believe the difference is due to the path selected in the run command for GUI mode differs. Gui run command is not using the path argument. https://github.com/HDLUtils/hdlregression/blob/main/hdlregression/run/tcl_runner.py#L116 I guess it should be something like this?

rc = self.runner.gui_run(command=command, path=test.get_test_path())
HDLUtils commented 1 year ago

Hi Christoffer,

Just to be clear for any other users wondering about the GUI and test folder structure:

There are several ways to solve this challenge; add a load/save wave.do command to the GUI menu, change the path generics when run in GUI mode, or do the path change in the regression script when GUI mode is enabled. Are you hard coding the project path (C_PROJ_PATH) inside your testbench? I recommend that you set this as a generic from the regression script.

Br.

drowzie commented 1 year ago

Yep, it is hardcoded as a constant and i guess the generic can do the same task to alter between gui mode and not.

HDLUtils commented 1 year ago

We will add functionality that allows for loading and saving other files (e.g. TCL- and Wave-files).