需要维持派生字段自动赋值时,在派生 FIFO 中 override virtual function bit use_automatic_config() 并返回 1;已有 build_phase 仍须保留业务逻辑和所需的 super 调用。未依赖派生字段自动配置的普通 FIFO 传输无需为本条改写。字段 FLAG 的使能方式另按 M09-002 核对。
endfunction//turn off auto configfunctionvoidbuild_phase(uvm_phasephase);build();//for backward compat, won't cause auto-configreturn;endfunctionvirtualfunctionvoidflush();uvm_report_error("flush",`UVM_TLM_FIFO_FUNCTION_ERROR,UVM_NONE);endfunctionvirtualfunctionintsize();uvm_report_error("size",`UVM_TLM_FIFO_FUNCTION_ERROR,UVM_NONE);return0;endfunctionvirtualtaskput(Tt);uvm_report_error("put",`UVM_TLM_FIFO_TASK_ERROR,UVM_NONE);
// Backward compatibility build functionfunctionvoiduvm_component::build();uvm_rootr_obj;m_build_done=1;r_obj=uvm_root::get();if(!(r_obj.disable_apply_cfg_settings))apply_config_settings(print_config_matches);// else `uvm_info("NO_APPLY_CFG","apply_config_settings disabled by +UVM_DISABLE_APPLY_CFG_SETTINGS",UVM_DEBUG)if(m_phasing_active==0)beginuvm_report_warning("UVM_DEPRECATED","build()/build_phase() has been called explicitly, outside of the phasing system. This usage of build is deprecated and may lead to unexpected behavior.");endendfunction// these phase methods are common to all components in UVM. For backward// compatibility, they call the old style name (without the _phse)functionvoiduvm_component::connect_phase(uvm_phasephase);
// @uvm-ieee 1800.2-2020 auto 12.2.8.1.1virtualclassuvm_tlm_fifo_base#(typeT=int)extendsuvm_component;`uvm_component_abstract_param_utils(uvm_tlm_fifo_base#(T))typedefuvm_tlm_fifo_base#(T)this_type;// Port -- NODOCS -- put_export//// The ~put_export~ provides both the blocking and non-blocking put interface// methods to any attached port:////| task put (input T t)//| function bit can_put ()//| function bit try_put (input T t)//// Any ~put~ port variant can connect and send transactions to the FIFO via this// export, provided the transaction types match. See <uvm_tlm_if_base #(T1,T2)>// for more information on each of the above interface methods.
endfunction//turn off auto configvirtualfunctionbituse_automatic_config();return0;endfunction:use_automatic_config// @uvm-ieee 1800.2-2020 auto 12.2.8.2.6virtualfunctionvoidflush();uvm_report_error("flush",`UVM_TLM_FIFO_FUNCTION_ERROR,UVM_NONE);endfunction// @uvm-ieee 1800.2-2020 auto 12.2.8.2.2virtualfunctionintsize();uvm_report_error("size",`UVM_TLM_FIFO_FUNCTION_ERROR,UVM_NONE);return0;endfunction// @uvm-ieee 1800.2-2020 auto 12.2.8.1.3
returnbegin_tr(tr,stream_name,label,desc,begin_time,parent_handle);endfunction// contains default behavior for build_phase()functionvoiduvm_component::build();m_build_done=1;if(use_automatic_config())apply_config_settings(get_print_config_matches());endfunction// These are the old style phase names for backward compatibility. functionvoiduvm_component::connect();return;endfunctionfunctionvoiduvm_component::start_of_simulation();return;endfunctionfunctionvoiduvm_component::end_of_elaboration();return;endfunctiontaskuvm_component::run();return;endtaskfunctionvoiduvm_component::extract();return;endfunctionfunctionvoiduvm_component::check();return;endfunctionfunctionvoiduvm_component::report();return;endfunction
// Backward compatibility build functionfunctionvoiduvm_component::build();m_build_done=1;apply_config_settings(print_config_matches);if(m_phasing_active==0)beginuvm_report_warning("UVM_DEPRECATED","build()/build_phase() has been called explicitly, outside of the phasing system. This usage of build is deprecated and may lead to unexpected behavior.");endendfunction// these phase methods are common to all components in UVM. For backward// compatibility, they call the old style name (without the _phse)functionvoiduvm_component::connect_phase(uvm_phasephase);connect();return;endfunctionfunctionvoiduvm_component::start_of_simulation_phase(uvm_phasephase);
endfunction// contains default behavior for build_phase()functionvoiduvm_component::build();m_build_done=1;if(use_automatic_config())apply_config_settings(get_print_config_matches());endfunction// These are the old style phase names for backward compatibility. functionvoiduvm_component::connect();return;endfunctionfunctionvoiduvm_component::start_of_simulation();return;endfunctionfunctionvoiduvm_component::end_of_elaboration();return;endfunctiontaskuvm_component::run();return;endtaskfunctionvoiduvm_component::extract();return;endfunctionfunctionvoiduvm_component::check();return;endfunctionfunctionvoiduvm_component::report();return;endfunction