Installation of UVM

Hi all,

I am installing UVM 1.1d. I followed all the steps in the README text file. But I am unable to run a example. when i do irun for example component.sv it gives the following error “searching for import subroutine uvm_hdl_deposit in default library libdpi. unable to load the default library”. I thought this was something to do withuvm_dpi.cc file. when i try to compile the file using gcc it is giving me errors saying “vpi_user.h: no such file or directory”.
Could anyone tell me how do i proceed with the installation.

Thanks & Regards,
Leela

Hi,

I’m also new to this, but as I understand it, the uvm_hdl_deposit should, indeed, be imported from the uvm_dpi shared lib. (being an imported DPI-C function)
Regarding using GCC in order to compile uvm_dpi.cc: you can just use make on “makefile.questa”, for example, assuming that you are using Questa, have MTI_HOME set in your environment variables and that you are running it from the examples directory (from within the uvm-1.1d dir). This is what the readme suggests.
If you still prefer to use GCC directly, you can inspect the above mentioned makefile for the required parameters. (or create your own makefile)

For example:

gcc -m32 -fPIC -DQUESTA -g -W -shared -x c -I $SIMULATOR_DIR/include $UVM_DPI_SOURCE -o $UVM_1_1d_DIR/lib/uvm_dpi.so

Remarks:

  • $SIMULATOR_DIR can be substituted (or defined in a script) with whatever the path to your simulator/sv_compiler directory might be.
  • $UVM_DPI_SOURCE is the path to the uvm_dpi.cc file.
  • $UVM_1_1d_DIR is the path to your uvm-1.1d dir.

Also, please note that:

  1. $SIMULATOR_DIR/include has (or should have) the vpi_user.h file inside it which solves your compile error
  2. you have to create the above lib directory manually before running the compiler

Regards,
Florin

In reply to florin.h:

If you have an up to date version of your simulator, there is usually no reason to compile the UVM package and DPI code yourself because it has already done for you. See http://go.mentor.com/uvm1-0-questa

In reply to dave_59:

But I am installing UVM for Cadence. In Questa UVM is in built. But for Cadence we need to exclusively install it right?

In reply to leela:

Hi Florin,

Thanks for the detailed steps… Will try and will get back to you if I have any problems.
I hope it works for Cadence.

Regards,
Leela

In reply to leela:

Hi Leela,

I would like to point out that, in fact, if you using an up-to-date simulator (as dave_59 suggested), you should have access to the UVM library immediately.

I haven’t, personally, used Cadence Incisive but the documentation for the irun command suggests 2 interesting options:

  • uvm which uses the default UVM library
  • uvmhome $PATH which uses the uvm library location specified by $PATH

It’s also worth noting that, even though I suggested looking in makefile.questa, there is also a makefile.ius which is for the Cadence simulator.

Thus, this should run the specified top file with the default UVM library:

irun -uvm my_top.sv

And this should run the specified top file with the UVM library of your choice:

irun -uvmhome $UVM_HOME my_top.sv

Note: $UVM_HOME is, of course, the path to the UVM lib you wish to use.

If you are using an older version of the simulator, there are 2 things that I can think of right now that need taking into account:

  1. you have to compile the shared lib and include the uvm packages manually (obviously)
  2. there is always the possibility that the simulator’s compiler does not implement enough of the current SystemVerilog LRM in order to successfully compile UVM (which is a game breaker)

I hope this helps.

Regards,
Florin

In reply to florin.h:

Hi Florin,

Thanks for the detailed explanation. Kind of tried all the steps but for some reason it is not working in Cadence incisive. I have switched the simulator to questa for now. Since UVM is inbuilt there was not much to worry about. Thanks for ur help.

Regards,
Leela