# Use examples with native UVMC

**URL:** <https://verificationacademy.com/forums/t/use-examples-with-native-uvmc/36735>\
**Category:** UVM\
**Tags:** UVMC-Compilation, UVM, native, kit-examples\
**Created:** [October 28, 2019, 5:54pm UTC](https://verificationacademy.com/forums/t/use-examples-with-native-uvmc/36735 "2019-10-28T17:54:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elmar](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@elmar](https://verificationacademy.com/forums/u/elmar)\
**Post date:** [October 28, 2019, 5:54pm UTC](https://verificationacademy.com/forums/t/use-examples-with-native-uvmc/36735/1 "2019-10-28T17:54:28Z")

</div>

Hi,

Some tools (such as Questa Ultrasim 2019.3\_2) have UVMC 2.3.1 already compiled natively with the factory installation.

UVMC 2.3.1 comes with a lot of examples.

However, I was not able to run neither the examples in the UVMC 2.3.1 Kit nor the examples contained in the factory installation using the native precompiled UVMC library of the tool. Using run\_questa or Makefile.questa, the UVMC library is compiled again and the native precompiled tool library is not used.

My environment variables are:

```auto
export MENTOR=/usr/local/mentor
export BITS=64
export QUESTA_HOME=$MENTOR/questa_sim-2019.3_2/questasim
export MGC_HOME=$QUESTA_HOME
export MTI_HOME=$MGC_HOME
export MTI_VCO_MODE=$BITS
export MTI_BYPASS_SC_PLATFORM_CHECK=1
export UVM_HOME=$MGC_HOME/verilog_src/uvm-1.1d
export UVM_LIB=$MGC_HOME/uvm-1.1d
export UVMC_HOME=$MGC_HOME/verilog_src/uvmc-2.3.1
export UVMC_LIB=$MGC_HOME/uvmc-2.3.1
export PATH=$QUESTA_HOME/bin:$PATH

```

However, using modified files run\_questa\_native and Makefile.questa\_native, I was able to use the precompiled native tool library.

File examples/commands/run\_questa\_native reads as:

```auto
# . . . 
rm -rf work
vlib work

# Compile example ...
vlog -sv -L $UVM_LIB -L $UVMC_LIB +define+QUESTA sv_main.sv
sccom -DSC_INCLUDE_DYNAMIC_PROCESSES -DQUESTA -I$UVMC_HOME/src/connect/sc ex_phase_control.cpp
sccom -uvmc -link

# Run example ...
vsim -c -do "run -all; quit -f" -t 1ps -L $UVM_LIB -L $UVMC_LIB -l questa.log +PHASING_ONE sc_main sv_main
# . . .

```

File examples/commands/Makefile.questa\_native has two lines changed with respect to Makefile.questa:

```auto
MAKE_CMD = $(MAKE) -f Makefile.questa_native
include ../common/Makefile.questa_native

```

The files in the remaining directories are changed in a similar manner.

File examples/common/Makefile.questa\_native has two lines changed with respect to Makefile.questa:

```auto
VLOG = vlog -$(BITS) $(OPT_C) -sv -L $(UVM_LIB) -L $(UVMC_LIB) +define+QUESTA
LINK = sccom -$(BITS) $(OPT_L) -uvmc -link

```

A tarball containing only the examples with all native run\_questa and Makefile can be found here:  
[Your text to link here…](http://lad.dsc.ufcg.edu.br/lad/uploads/Lad/uvmc-2.3.1_mgc.tgz)

A tarball containing all the files of the UVMC 2.3.1 kit and all run\_questa\_native and Makefile.questa\_native files can be found here:  
[Your text to link here…](http://lad.dsc.ufcg.edu.br/lad/uploads/Lad/uvmc-2.3.1_native.tgz)

Best Regards,  
Elmar

---

<div class="post-metadata">

**Author:** ![jstickle](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@jstickle](https://verificationacademy.com/forums/u/jstickle)\
**Post date:** [October 28, 2019, 10:50pm UTC](https://verificationacademy.com/forums/t/use-examples-with-native-uvmc/36735/2 "2019-10-28T22:50:22Z")

</div>

Elmar,

Thank-you for your input.

By and large, the UVMC examples are designed to be allowed to re-target to  
different gcc compilers so they are primarily based on the assumption  
that the user will first build the $UVMC\_LIB using the compiler of choice  
then run the examples using the $UVMC\_LIB just compiled.

However I’ve downloaded your tarballs and reviewed them. For the uvmc-2.3.2  
release we will consider some simplifications that will allow the examples  
to be run either using the pre-built libraries or explicitly compiling  
them to a separate $UVMC\_LIB using the selected ambient gcc compiler.

– johnS

_In reply to [elmar](https://verificationacademy.com/forums/t/use-examples-with-native-uvmc/36735):_
