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

UVM-related tests come with undefined package's import #5798

Open
ssmolov opened this issue Mar 14, 2024 · 1 comment
Open

UVM-related tests come with undefined package's import #5798

ssmolov opened this issue Mar 14, 2024 · 1 comment

Comments

@ssmolov
Copy link

ssmolov commented Mar 14, 2024

About 140 tests from chapter-16 and chapter-18 subdirectories start from importing the uvm_pkg package before it's definition. The include directive comes right after the import:

import uvm_pkg::*;
`include "uvm_macros.svh"

Both open-source (slang) and commercial (VCS) EDA tools report errors on such tests -- are these tests treated to be negative?
Here is a fragment of VCS log for chapter-16/16.2--assert-final-uvm.sv test:

Parsing design file '16.2--assert-final-uvm.sv'

Error-[SV-LCM-PND] Package not defined
16.2--assert-final-uvm.sv, 19
$unit, "uvm_pkg::"
  Package scope resolution failed. Token 'uvm_pkg' is not a package. 
  Originating module '$unit'.
  Move package definition before the use of the package.

Here is the complete list of such tests:
undefined-import-uvm-tests.txt

@jcurtiss8086
Copy link

jcurtiss8086 commented Mar 20, 2024

uvm_macros.svh is not what contains the definition of uvm_pkg. As the name implies, this svh file only contains `define statements for various helper macros, e.g. `uvm_info, `uvm_error

uvm_pkg.sv is a separate file that must be a part of the filelist in addition to the test-case file.

It does appear that the test-case in the repo is attempting to add the file to the command line. With git clone --recursive I do see that the surelog repo has the UVM directory shown below, but I suspect it is the relative hierarchies that are causing the files to not be found when being passed to other tools such as slang.

third_party/tools/Surelog/third_party/tests/Google/batch.txt
383:-cd chapter-16 -I../../../UVM/1800.2-2017-1.0/src/ ../../../UVM/1800.2-2017-1.0/src//uvm_pkg.sv -parse -nonote -noinfo -nouhdm -timescale=1ns/1ns 16.2--assert-final-uvm.sv -l 16.2--assert-final-uvm.sv.log

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