typedefclassuvm_tr_database;typedefclassuvm_text_tr_database;`ifndefUVM_CORESERVICE_TYPE`define UVM_CORESERVICE_TYPE uvm_default_coreservice_t`endiftypedefclass`UVM_CORESERVICE_TYPE;//----------------------------------------------------------------------// Class: uvm_coreservice_t//// The singleton instance of uvm_coreservice_t provides a common point for all central // uvm services such as uvm_factory, uvm_report_server, ...// The service class provides a static <::get> which returns an instance adhering to uvm_coreservice_t// the rest of the set_<facility> get_<facility> pairs provide access to the internal uvm services//// Custom implementations of uvm_coreservice_t can be included in uvm_pkg::*// and can selected via the define UVM_CORESERVICE_TYPE. They cannot reside in another package.
// returns the uvm_root instancepurevirtualfunctionuvm_rootget_root();localstatic`UVM_CORESERVICE_TYPEinst;// Function: get//// Returns an instance providing the uvm_coreservice_t interface.// The actual type of the instance is determined by the define `UVM_CORESERVICE_TYPE.////| `define UVM_CORESERVICE_TYPE uvm_blocking_coreservice//| class uvm_blocking_coreservice extends uvm_default_coreservice_t;//| virtual function void set_factory(uvm_factory f);//| `uvm_error("FACTORY","you are not allowed to override the factory")//| endfunction//| endclass//|staticfunctionuvm_coreservice_tget();if(inst==null)inst=new;
// @uvm-ieee 1800.2-2020 auto F.4.1.4.17purevirtualfunctionuvm_comparerget_default_comparer();purevirtualfunctionintunsignedget_global_seed();// @uvm-ieee 1800.2-2020 auto F.4.1.4.18purevirtualfunctionvoidset_default_copier(uvm_copiercopier);// @uvm-ieee 1800.2-2020 auto F.4.1.4.19purevirtualfunctionuvm_copierget_default_copier();// @uvm-ieee 1800.2-2020 auto F.4.1.4.25purevirtualfunctionbitget_uvm_seeding();// @uvm-ieee 1800.2-2020 auto F.4.1.4.26purevirtualfunctionvoidset_uvm_seeding(bitenable);// @uvm-ieee 1800.2-2020 auto F.4.1.4.21purevirtualfunctionvoidset_resource_pool(uvm_resource_poolpool);// @uvm-ieee 1800.2-2020 auto F.4.1.4.22purevirtualfunctionuvm_resource_poolget_resource_pool();// @uvm-ieee 1800.2-2020 auto F.4.1.4.23purevirtualfunctionvoidset_resource_pool_default_precedence(intunsignedprecedence);purevirtualfunctionintunsignedget_resource_pool_default_precedence();
// Returns the <uvm_phase_hopper> (singleton) instance for this environment//// @uvm-contrib For potential contribution to 1800.2purevirtualfunctionuvm_phase_hopperget_phase_hopper();localstaticuvm_coreservice_tinst;// @uvm-ieee 1800.2-2020 auto F.4.1.3staticfunctionuvm_coreservice_tget();if(inst==null)uvm_init(null);returninst;endfunction// getstaticfunctionvoidset(uvm_coreservice_tcs);inst=cs;endfunctionendclass// Class: uvm_default_coreservice_t// Implementation of the uvm_default_coreservice_t as defined in// section F.4.2.1 of 1800.2-2020.////| class uvm_default_coreservice_t extends uvm_coreservice_t//// @uvm-ieee 1800.2-2020 auto F.4.2.1classuvm_default_coreservice_textendsuvm_coreservice_t;localuvm_factoryfactory;
// @uvm-contrib This API represents a potential contribution to IEEE 1800.2// @uvm-ieee 1800.2-2020 auto F.3.1.3functionvoiduvm_init(uvm_coreservice_tcs=null);uvm_default_coreservice_tdcs;if(get_core_state()!=UVM_CORE_UNINITIALIZED)beginif(get_core_state()==UVM_CORE_PRE_INIT)begin// If we're in this state, something very strange has happened.// We've called uvm_init, and it is actively assigning the// core service, but the core service isn't actually set yet.// This means that either the library messed something up, or// we have a race occurring between two threads. Either way, // this is non-recoverable. We're going to setup using the default// core service, and immediately fatal out.dcs=new();uvm_coreservice_t::set(dcs);`uvm_fatal("UVM/INIT/MULTI","Non-recoverable race during uvm_init")end
`ifdefVCSfunctionvoidverdi_set_report_verbosity_level_hier(intverbosity);staticuvm_roottop=uvm_root::get();top.set_report_verbosity_level_hier(verbosity);endfunctionfunctionvoidverdi_set_verbosity(logic[115199:0]options_bv,bitfirst=0);// _ALL_ can be used for ids// +uvm_set_verbosity=<comp>,<id>,<verbosity>,<phase|time>,<offset>// +uvm_set_verbosity=uvm_test_top.env0.agent1.*,_ALL_,UVM_FULL,time,800stringargs[$];stringoptions;uvm_componentlist[$];staticuvm_cmdline_processorclp=uvm_cmdline_processor::get_inst();staticuvm_roottop=uvm_root::get();beginif(first)return;args.delete();options=uvm_bits_to_string(options_bv);uvm_string_split(options,",",args);beginsetting_comp=args[0];setting_id=args[1];void'(clp.m_convert_verb(args[2],setting_verbosity));setting_phase=args[3];setting_offset=0;if(args.size()==5)begin