由于有一大部分通过后门访问仿真的case都是因为hdl path定于不正确导致的,所以遇到这个error我首先会去比对我的bench中和dut中声明这块寄存器的hdl path。 通过add_hdl_path_slice我们可以向寄存器模型中的各个寄存器添加路径信息,在我的base test,这块mem的hdl path是这样定义的: m_addr_map_h.sj_test_mem_cfg_t...
首先寄存器模型将HDL路径以字符串的形式存储在队列中,这个队列又作为uvm_object_string_pool键值对中的值存储在hdl_paths_pool中,默认的键(key)是"RTL"。如图12所示。 图12 src/reg/uvm_reg_block.svh中存储HDL路径的键值对 我们可以通过调用add_hdl_path来添加寄存器模型的HDL路径,如图13所示,添加HDL路径可以指...
在reg_field中的task中,基本都调用uvm_reg的task,但是read、write根据是否支持individual可能会调用map中的task。 uvm_reg中还有一些hdl_path的function,add_hdl_path_slice,添加到field的path路径。这些路径,之后在map中会被集成起来。 形成一个full_name。 uvm_reg_frontdoor,从uvm_reg_sequence继承而来,本身是一...
chn12_ctrl_reg.add_hdl_path_slice($sformatf("regs[%0d]",`SLV2_RW_REG), 0, 32); chn10_stat_req.add_hdl_path_slice($sformatf("regs[%0d]",`SLV0_R_REG), 0, 32); chn11_stat_req.add_hdl_path_slice($sformatf("regs[%0d]",`SLV1_R_REG), 0, 32); chn12_stat_req.add...
add_hdl_path("tb.dut.ctrl_regs_inst"); //从tb开始找reg型变量所在的module chnls_ctrl_reg[0].add_hdl_path_slice($sformats("mem[%0d]",`SLV0_RW_REG),1,16); //即映射到mem[`SLV0_RW_REG][16:1] //... lock_model(); endfunction endclass 而在tb.dut.ctrl_regs_inst的module...
uvm_reg_sequence::read_reg()/write_reg()。参数path需要指定为UVM_FRONTDOOR; 2. 后门访问 在进行后门访问时,在寄存器模型建立时将各个寄存器映射到了DUT一侧的HDL路径。 uvm_reg_block::add_hdl_path( )将寄存器模型block关联到DUT一端; uvm_reg::add_hdl_path_slice( )将寄存器模型中各个寄存器成员与HDL...
function void add_hdl_path ( uvm_hdl_path_slice slices[], string kind = "RTL" ) Add an HDL path Add the specified HDL path to the register instance for the specified design abstraction. This method may be called more than once for the same design abstraction if the register is physica...
} uvm_hdl_path_slice; typedef uvm_resource_db#(uvm_reg_cvr_t) uvm_reg_cvr_rsrc_db;//---//Group: Enumerations//---//Enum: uvm_status_e///Return status for register operations///UVM_IS_OK - Operation completed successfully//UVM_NOT_OK - Operation completed with error//UVM_HAS_...
例码中通过 uvm_reg_ block: :add_ hdl _path()将寄存器模型关联到了 DUT一端,而通过uvm _reg: :add_ hdl _path_ slice 完成了将寄存器模型各个寄存器成员与 HDL一侧地址的映射。例如,稍后对寄存器 SLVO_RW_REG 进行后门访问时, UVM DPI 函数通过寄存器 HDL 路径 "reg_backdoor_access.dut.regs[0]" ...
源代码中的get_full_hdl_path函数负责获取寄存器的完整HDL路径,这涉及到uvm_hdl_path_concat和uvm_hdl_path_slice等结构,它们用于描述寄存器的物理信息。通过配置或add_hdl_path操作,可以在寄存器模型中存储和管理多个HDL路径,对应不同的寄存器实例。后门读写操作会调用uvm_hdl_read()函数,它是一个...