AXI4 icon indicating copy to clipboard operation
AXI4 copied to clipboard

Renaming AXI4 folder breaks static paths used by test cases

Open weilanad opened this issue 11 months ago • 1 comments

Description

My project has multiple submodules inside the lib folder which are structured as shown below:

lib/osvvm
lib/OSVVM-AXI4           <- has been renamed from AXI4
lib/OSVVM-Common
lib/OSVVM-Scripts
lib/OSVVM-UART           <- has been renamed from UART
...

To avoid name collisions I renamed the AXI4 folder to OSVVM-AXI4 (and adjusted the .pro accordingly). This caused all tests to fail. Exemplary for this testcase:

%%   2350 ns    Log    PASSED    in Default,                      TryCount 32
%%   2370 ns    Alert  ERROR     in Default,                      File, C:/Projects/PoC/lib/AXI4/AxiStream/ValidatedResults//TbStream_AxiSetOptionsBurstCheckAsync3.log, did not open
%%   2370 ns    DONE   FAILED   TbStream_AxiSetOptionsBurstCheckAsync3  Total Error(s) = 1  Failures: 0  Errors: 1  Warnings: 0  Passed: 483  Affirmations Checked: 484

Root cause

Inside AxiStream/TestCases/OsvvmTestCommonPgk.vhd the path to the validated results is defined generically as follows:

constant OSVVM_VALIDATED_RESULTS_DIR : string := osvvm.OsvvmScriptSettingsPkg.OSVVM_HOME_DIRECTORY & "/AXI4/AxiStream/ValidatedResults/" ;

Previously this constant was defined relatively:

constant OSVVM_PATH_TO_TESTS : string := "../../OsvvmLibraries/" ;

Can this path constant be created without depending on the folder name?

Workaround

For now I just changed the path manually (and removed the extra "/"):

constant OSVVM_VALIDATED_RESULTS_DIR : string := osvvm.OsvvmScriptSettingsPkg.OSVVM_HOME_DIRECTORY & "/OSVVM-AXI4/AxiStream/ValidatedResults" ;

/cc @Paebbels

weilanad avatar Jan 30 '25 15:01 weilanad

OsvvmLibraries is commonly distributed as an entire library - with submodules under the OsvvmLibraries subdirectory. This helps you avoid conflicts with other IP you have in your library since all OSVVM IP is in a separate subdirectory. If you kept it organized this way, you should not have any problems running the test cases.

What the OSVVM AxiStream is doing is self-checking the current transcript with a previously run transcript. This means the "previously run and checked transcript" needs to be stored somewhere and the only place for it is within the AXI4 directory structure.

Unfortunately without VHDL-2019, there is no way to automatically find the files, so they are in a static path. So currently if you really want the OSVVM IP organized in a different directory structure than OsvvmLibraries and you want to run the OSVVM test cases (really only needed if you are making changes to the VC), you are going to have to hand edit paths.

With VHDL-2019, we could use FILE_PATH:

constant OSVVM_VALIDATED_RESULTS_DIR : string := FILE_PATH & "/../ValidatedResults/" ;

Since you are probably using a VHDL-2019 simulator, you could check this out if you like and report back on how well it works. We could then update the scripts to compile the VHDL-2019 version when a tool supports VHDL-2019 and otherwise compile the version with static paths.

I know Aldec has implemented features like this, I am not sure if GHDL and NVC have yet. I know Siemens has implemented a small amount of VHDL-2019, but I am not sure if this is one of them.

A side note about using '-' in a name, Within the OsvvmLibraries distribution we do not put '-' in directory names anywhere. I have the same concerns about this as I have about putting space in a path - hint a space in a directory name causes some EDA tools to crash. I don't want any part of issues of this sort - so I avoid doing things like this. When you are working in an environment that supports a single or a limited number of EDA tools you have the freedom to do things like this, however, OSVVM's goal is to easily work in as many environments as possible with minimal issues.

JimLewis avatar Jan 31 '25 07:01 JimLewis

Scripts now create the OsvvmTestCommonPkg. For VHDL-2019 simulators, it uses FILE_PATH, otherwise, it uses $::osvvm::CurrentWorkingDirectory from the scripts. This is now on dev and will be in the next release.

JimLewis avatar Jun 18 '25 04:06 JimLewis