#310 UVM macros

v1.0_(example)
open
None
5
2014-01-27
2014-01-26
Tomer
No

Hi,

Hi,
I am working on a project with ~200 files, and from some reason UVM macro's are not recognized.
In some of the files, there is even an import of UVM package and the macros still unrecognized- unless I am manually adding for each file an include line for "uvm_macros.svh" (or to a file that includes uvm_macros).
My f file contains the following lines (among others..):
+incdir+${UVM_HOME}/src
+incdir+${UVM_HOME}/src/macros
+incdir+${UVM_HOME}/src/seq
+incdir+${UVM_HOME}/src/base
+incdir+${UVM_HOME}/src/comps
+incdir+${UVM_HOME}/src/deprecated
+incdir+${UVM_HOME}/src/dpi
+incdir+${UVM_HOME}/src/reg
+incdir+${UVM_HOME}/src/tlm1
+incdir+${UVM_HOME}/src/tlm2
${UVM_HOME}/src/uvm_macros.svh

I also can see this f file at each file include hirarchy, so the f file is properly declared in the project.
Thanks,
Tomer

Discussion

  • Hi Tomer,
    By default, SVEditor uses the 'single-file compilation unit' (SFCU) mode defined by the LRM to process SystemVerilog files. In SFCU mode, each root file specified in the argument file is independent in terms of macros and included files (ie the pre-processor state is clean at the beginning of each root file).
    SFCU mode is default for two reasons:
    From a methodology viewpoint, it is easier to track include and macro dependencies when there are no implicit dependencies on what has been defined previous to active root file
    From a tool standpoint, incremental re-parse is more efficient and reliable when each root file can be treated independently.

    From a UVM perspective, SFCU mode requires you to include uvm_macros.svh in each package file that includes classes that reference UVM macros.

    You can enable multi-file compilation unit mode if you're working with code that you can't easily change to fit the requirements of SFCU mode. With MFCU mode enabled, your argument file would look like this:

    -mfcu
    +incdir+${UVM_HOME}/src
    ${UVM_HOME}/src/uvm_macros.svh
    ...

    Hope this helps!

    Best Regards,
    Matthew

     
  • Tomer
    Tomer
    2014-01-27

    Hi Matthew,
    First- thanks for the quick and informative reply.
    I tried the above, but it still didn't help. Moreover, after adding -mfcu to my f file I can't see any error (even obvious ones I created) in the problem view.
    I think my project does fit SFCU, but it uses "import uvm_pkg::*;" to include all UVM objects. As much as I understand it suppose to include macros as well. Am I right? Does the editor supports this?
    Thanks,
    Tomer