Skip to content
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

Renaming AXI4 folder breaks static paths used by test cases #21

Open
weilanad opened this issue Jan 30, 2025 · 1 comment
Open

Renaming AXI4 folder breaks static paths used by test cases #21

weilanad opened this issue Jan 30, 2025 · 1 comment

Comments

@weilanad
Copy link

weilanad commented Jan 30, 2025

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

@JimLewis
Copy link
Member

JimLewis commented Jan 31, 2025

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 JimLewis changed the title Tests failing after renaming AXI4 folder Renaming AXI4 folder breaks static paths used by test cases Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants