# How can I print field value present in config\_db?

**URL:** <https://verificationacademy.com/forums/t/how-can-i-print-field-value-present-in-config-db/32246>\
**Category:** UVM\
**Tags:** get-set, UVM, uvm\_config\_db, print\
**Created:** [September 11, 2016, 10:24am UTC](https://verificationacademy.com/forums/t/how-can-i-print-field-value-present-in-config-db/32246 "2016-09-11T10:24:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakesh2learn](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/9e8a1a/32.png) [@rakesh2learn](https://verificationacademy.com/forums/u/rakesh2learn)\
**Post date:** [September 11, 2016, 10:24am UTC](https://verificationacademy.com/forums/t/how-can-i-print-field-value-present-in-config-db/32246/1 "2016-09-11T10:24:20Z")

</div>

Below code is part of top file. I SET and GET in the top file. I want to print what I get, i.e. the string ‘vlsi’. I don’t know how to refer to the field name so that I can print the field value from the uvm\_config\_db. Thank you.

```auto
initial begin

		uvm_config_db#(string)::set(uvm_root::get(),"*","string_name","vlsi");
		
	end
initial begin

		if (uvm_config_db#(string)::get(uvm_root::get(),"","string_name","vlsi")) begin 

			`uvm_info("In top file", "string_name", UVM_LOW);
			 $display("name = %s",string_name); // error here, unresolved reference to 'string_name'			
		end

		else begin 	
		
			`uvm_fatal("Top","cannot get string name in config_db");
		end 

	end

```

---

<div class="post-metadata">

**Author:** ![dhserfer](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/a9a28c/32.png) [@dhserfer](https://verificationacademy.com/forums/u/dhserfer)\
**Post date:** [September 12, 2016, 12:02am UTC](https://verificationacademy.com/forums/t/how-can-i-print-field-value-present-in-config-db/32246/2 "2016-09-12T00:02:18Z")

</div>

_In reply to [rakesh2learn](https://verificationacademy.com/forums/t/how-can-i-print-field-value-present-in-config-db/32246):_

In your “get” method, “vlsi” is a string literal, but you should be using a (string) variable. Assuming you know the difference between the two and it was a simple mistake, I would recommend reading this paper:

[http://www.verilab.com/files/configdb\_dvcon2014.pdf](http://www.verilab.com/files/configdb_dvcon2014.pdf)

page 3 discusses the “get” method. Otherwise see section 6 (Data Types) of the ieee 1800 standard.

Also you can use +UVM\_CONFIG\_DB\_TRACE to follow accesses to the config\_db (discussed in the paper above)
