Thursday, 11 February 2016

uvm_config_db

The uvm_config_db class is the recommended way to access the resource database.
A resource is any piece of information that is shared between more than one component or object.
We use uvm_config_db::set to put something into the database and uvm_config_db::get to retrieve information from the database.
The uvm_config_db class is parameterized, so the database behaves as if it is partitioned into many type-specific "mini databases."
There are no limitations on the the type - it could be a class, a uvm_object, a built in type such as a bit, byte, or a virtual interface.
There are two typical uses for uvm_config_db. The first is to pass virtual interfaces from the DUT to the test, and the second is to pass configuration classes down through the testbench.

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------

/*****************ARGUMENTS*****************/
T is the type of the element being configured - usually a virtual interface or a configuration object.

cntxt and inst_name together form a scope that is used to locate the resource within the database.
The scope is formed by appending the instance name to the full hierarchical name of the context.
{cntxt, ".", inst_name}. or {cntxt.get_full_name(),".",inst_name}. //need to confirm
If cntxt is null then inst_name provides the complete scope information of the setting.

field_name supplies the name of the resource or thing. field_name is the key through which you can get that particular object.
field_name must be same during get & set, because while getting from uvm_databse it will find for field_name.

value is the thing or resource which is actually going to be put into the database.
value name can be different but value type must be same for get and set.
Both inst_name and field_name may be glob style or regular expression style expressions.

----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------

Precedence:

Build Phase:
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
Example1:
----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------
 Example2:

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

Run Phase:
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------

Example1:
----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------
 Example2:
----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------


/*********************Guideline**************************/
1. Before set anything into database first allocates memory to them and then put into database using set method.

No comments:

Post a Comment