Jump to content

uvm_config_db compile issues

Recommended Posts


I am a new user to UVM who is trying to convert Vera Test Bench to UVM.

I have a simple SV interface as

interface core_if (

input core_client_clk ,

input core_config_clk);

bit core_client_reset;

bit core_config_reset;





In my top_tb.sv file I am trying to register this interface (to be used in my tb_env)

core_if core_intf (

.core_client_clk (core_client_clk),

.core_config_clk (core_config_clk)


uvm_config_db#(virtual vmidmt_if)::set(null, "*core_if", "core_if", core_intf) ;

But I get compile error when using the "uvm_config_db" as described above

Importing package quvm_addons_pkg

** Error: ../top_tb.sv(94): near "(": syntax error, unexpected '(', expecting "::"

PLease advise, I tried to cross check my usage of uvm_config_db.. but could not figure out what I am doing wrong

Edited by rakeshanigundi
Link to comment
Share on other sites

1.In your top tb you need to declare you need to use you interface name to be associated with a virtual interface

interface core_if core_intf // is what you decleared

2. This is why you are getting an error around your set -- the compiler doesn't know what vmidmt_if is.

3. You configuration is wrong. The Path should be at the tb level not at the core_if (2nd argument)

uvm_config_db #(virtual interface core_if)::set( null, "*.tb.vmidmt.*","core_vif", core_intf); // I a made up your tb path

The 3rd argument should be reflective of a vif style name. This is for string look up purposes:

Path Field Value

"*tb.vmidmt.*" "core_vif" core_intf

The arguments work like this:

1. The first is context -- which is null , top_tb.sv is the parent

2. The second is an instance call to all the UVC sub-components (both the agent's driver and monitor need to get the vif from the database)

3. The third is vif field name.

4. the fourth is the actual instance of the interface.


Link to comment
Share on other sites

LKB, thanks a lot for the reply

My Bad.. I think I made a mistake while I was typing out the message, the line in my top_tb.sv which is giving the error looks like below

uvm_config_db#(virtual interface core_if)::set(null, "*core_if", "core_if", core_intf) ;


uvm_config_db#(virtual vmidmt_if)::set(null, "*core_if", "core_if", core_intf) ;

So by specifiying uvm_config_db#(virtual interface core_if) , the compiler should now know that core_if is virtual interface which has been included in my top_tb.sv

Snippet from my top_tb.sv

`include "uvm_macros.svh"

`include "core_if.sv"

`include "core_sv_defines.sv"

`timescale 1ns/1ps

module tb_top;

import uvm_pkg::*;

import quvm_addons_pkg::*;

import core_test_pkg::* ;



singal declarations



// core_if is a virtual interface which is included in the file core_if.sv

core_if core_intf (

.core_client_clk (core_client_clk),

.core_config_clk (core_config_clk)


// Register the interface with factory

uvm_config_db#(virtual interface core_if)::set(null, "*core_if", "core_vif", core_intf) ;

Above line is giving me the error as

../ top_tb.sv(82): near "(": syntax error, unexpected '(', expecting "::"

Regarding your comments on the parameters to uvm_config_db.. You notice that I have the second parameter as *core_if.. I was thinking "*" wild character takes care of actual path specification..

Could you please let me know what I am still missing.

Link to comment
Share on other sites

Hello there,

I think your "*core_if" is going to be an issue unless that is the name of a "component" in the TB. You may just want to use "*" for that argument. And as I mentioned, you will need to put the uvm_config_db() command inside an initial begin/end block. I've been doing this:

initial begin

uvm_config_db#(virtual core_if)::set(null, "*", "core_vif", core_intf);




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...