# Usage of configdb

**URL:** <https://verificationacademy.com/forums/t/usage-of-configdb/31187>\
**Category:** UVM\
**Tags:** UVM, configdb\
**Created:** [November 4, 2015, 11:50am UTC](https://verificationacademy.com/forums/t/usage-of-configdb/31187 "2015-11-04T11:50:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![srinu](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@srinu](https://verificationacademy.com/forums/u/srinu)\
**Post date:** [November 4, 2015, 11:50am UTC](https://verificationacademy.com/forums/t/usage-of-configdb/31187/1 "2015-11-04T11:50:57Z")

</div>

please explain and differentiate the below statements iam at my basic stage of understanding UVM

1. uvm\_config\_db#(virtual ahb\_if)::set(uvm\_root::get(), “\*”, “ahb\_if”, vif);  
2)uvm\_config\_db#(virtual ahb\_if)::get(this, “”, “ahb\_if”, vif);

3)assert(uvm\_config\_db#(int)::get(null, get\_full\_name(), “no\_txn”, no\_txn));

---

<div class="post-metadata">

**Author:** ![chitlesh](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/c/a4c791/32.png) [@chitlesh](https://verificationacademy.com/forums/u/chitlesh)\
**Post date:** [November 4, 2015, 12:04pm UTC](https://verificationacademy.com/forums/t/usage-of-configdb/31187/2 "2015-11-04T12:04:12Z")

</div>

_In reply to [srinu](https://verificationacademy.com/forums/t/usage-of-configdb/31187):_

> 1. uvm\_config\_db#(virtual ahb\_if)::set(uvm\_root::get(), “\*”, “ahb\_if”, vif);

This is “pushing” the virtual interface “vif” of name “ahb\_if” to every “\*” components from the top level module.

> 2)uvm\_config\_db#(virtual ahb\_if)::get(this, “”, “ahb\_if”, vif);

This is “retrieving” interface “ahb\_if” and assigning it to “vif”.

> 3)assert(uvm\_config\_db#(int)::get(null, get\_full\_name(), “no\_txn”, no\_txn));

This is a basic assert which notifies when no transaction is retrieved.

---

<div class="post-metadata">

**Author:** ![bmorris](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/bmorris/32/2097_2.png) [@bmorris](https://verificationacademy.com/forums/u/bmorris)\
**Post date:** [November 4, 2015, 3:38pm UTC](https://verificationacademy.com/forums/t/usage-of-configdb/31187/3 "2015-11-04T15:38:46Z")

</div>

_In reply to [srinu](https://verificationacademy.com/forums/t/usage-of-configdb/31187/2):_

dont use assert for #3; they should be used for design checking not testbench

use this instead  
if( !uvm\_config\_db #( type )::get( this, “”, “name”, var ))  
`uvm\_fatal(report\_id, “cannot find resource name” )

---

<div class="post-metadata">

**Author:** ![srinu](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@srinu](https://verificationacademy.com/forums/u/srinu)\
**Post date:** [November 5, 2015, 4:23am UTC](https://verificationacademy.com/forums/t/usage-of-configdb/31187/4 "2015-11-05T04:23:29Z")

</div>

thanks mr chitlesh and mr bmorris
