uvm中寄存器模型中set_check_on_read和get_check_on_read的用法
set_check_on_read
// Function: set_check_on_read
//
// Sets the check-on-read mode for his map
// and all of its submaps.
//
// When ~on~ is ~TRUE~,
// the register model will automatically check any value read back from a register or field against the current value in its mirror
//当参数为真,这个寄存器模型将自动检查从寄存器或寄存器域读回的值与mirror的值;
// and report any discrepancy.
// This effectively combines the functionality of the
// <uvm_reg::read()> and <uvm_reg::mirror(UVM_CHECK)> method.
// This mode is useful when the register model is used passively.
//
// When ~on~ is ~FALSE~, no check is made against the mirrored value.
//
// At the end of the read operation, the mirror value is updated based
// on the value that was read reguardless of this mode setting.
//
// By default, auto-prediction is turned off.
//
function void set_check_on_read(bit on=1);
m_check_on_read = on;
foreach (m_submaps[submap]) begin
submap.set_check_on_read(on);
end
endfunction
get_check_on_read
// Function: get_check_on_read
//
// Gets the check-on-read mode setting for this map.
//
function bit get_check_on_read();
return m_check_on_read;
endfunction
uvm_reg_map
class uvm_reg_map extends uvm_object;
`uvm_object_utils(uvm_reg_map)
// info that is valid only if top-level map
local uvm_reg_addr_t m_base_addr;
local int unsigned m_n_bytes;
local uvm_endianness_e m_endian;
local bit m_byte_addressing;
local uvm_object_wrapper m_sequence_wrapper;
local uvm_reg_adapter m_adapter;
local uvm_sequencer_base m_sequencer;
local bit m_auto_predict;
local bit m_check_on_read; //////
local uvm_reg_block m_parent;
local int unsigned m_system_n_bytes;
local uvm_reg_map m_parent_map;
local uvm_reg_addr_t m_parent_maps[uvm_reg_map]; // value=offset of this map at parent level
local uvm_reg_addr_t m_submaps[uvm_reg_map]; // value=offset of submap at this level
local string m_submap_rights[uvm_reg_map]; // value=rights of submap at this level
local uvm_reg_map_info m_regs_info[uvm_reg];
local uvm_reg_map_info m_mems_info[uvm_mem];
local uvm_reg m_regs_by_offset[uvm_reg_addr_t];
// Use only in addition to above if a RO and a WO
// register share the same address.
local uvm_reg m_regs_by_offset_wo[uvm_reg_addr_t];
local uvm_mem m_mems_by_offset[uvm_reg_map_addr_range];
extern /*local*/ function void Xinit_address_mapX();
static local uvm_reg_map m_backdoor;
// Function: backdoor
// Return the backdoor pseudo-map singleton
//
// This pseudo-map is used to specify or configure the backdoor
// instead of a real address map.
//
static function uvm_reg_map backdoor();
if (m_backdoor == null)
m_backdoor = new("Backdoor");
return m_backdoor;
endfunction
......
浙公网安备 33010602011771号