Professional Documents
Culture Documents
On Configuration
On Configuration
On Configuration
Presented by
Deepika p v v
• Definition(easily change the entire tb arch)
• Use(reusability)
• Class – this
Uvm_config_db methods
1. Set
2. Get
3.Exists
4.Wait_modified
Syntax for set method
• The full signature of the set method is void uvm_config_db
#( type T = int )::set( uvm_component cntxt , string
inst_name , string field_name , T value );
• 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, i.e.
• Field_name supplies the name of the resource
• value is the thing which is actually going to be put into the
database
Syntax for get method
Syntax for exists method
• Static function bit exists (uvm_component cntxt, string
inst_name,string field_name, bit spell_check);
6. DRIVER
function void ahb_driver::build_phase(uvm_phase phase);
super.build_phase(phase);
if(!uvm_config_db #(ahb_config):: get(this,"","ahb_config",h_cfg))
`uvm_fatal(get_full_name,"not getting from ahb_agent")
endfunction
7. Monitor
function void ahb_monitor::build_phase(uvm_phase phase);
super.build_phase(phase);
if(!uvm_config_db #(ahb_config):: get(this,"","ahb_config",h_cfg))
`uvm_fatal(get_full_name,"not getting from ahb_agent")
Endfunction
class base_test extends uvm_test;
`uvm_component_utils(base_test)
if(!uvm_config_db #(virtual
env_config tb_cfg; bridge_interface)::get(this,"","vif",h_
ahb_config h_cfg; cfg.vif))
apb_config p_cfg;
env tbh; uvm_fatal(get_full_name,"cannot
get interface")
int has_virtual_sequencer; h_cfg.is_active=UVM_ACTIVE;
int has_magent=1; tb_cfg.h_cfg = h_cfg;
int has_sagent=1; end
function void tb_cfg.has_magent = has_magent;
base_test::build_phase(uvm_phase tb_cfg.has_sagent =
phase); has_sagent;
super.build_phase(phase); uvm_config_db #(env_config) ::
tb_cfg=env_config::type_id::create(" set(this,"*","env_config",tb_cfg);
tb_cfg",this);
if(has_magent) tbh=env::type_id::create("tbh",this);
Begin endfunction
h_cfg=ahb_config::type_id::create("a
hb_config",this);
`
Uvm_config_db_options
1. Turn_on_tracing : turn tracing on for the configuration
database
syntax:
Static function void turn_on_tracing();
Syntax:
Static function bit is_tracing();
Environment config
class env_config extends uvm_object;
`uvm_object_utils(env_config)
int has_scoreboard=1;
int has_magent;
int has_sagent;
int has_virtual_sequencer=1;
ahb_config h_cfg;
apb_config p_cfg;
endclass
Example:
class pipe_agent extends uvm_agent;
Test:
Uvm_config_db #(int) ::set(this,”env.agent”,”my_param”,888);
Thank you