Backdoor entry for 32 Bit Register
How do we set offset address here
Error-[TFAFTC] Too few arguments to function/task call
uvm_pkg, “port_buf_ctl1_usbc1.set_offset('h0016f2c0)”
The above function/task call is not done with sufficient arguments.
Here it says I’m missing some arguments.
reg_port_buf port_buf_ctl1_usbc1;
reg_port_buf port_buf_ctl1_a;
logic [31:0] regmap_array [3:0] ;
$readmemh("path/to/hex_port_buf_ctl1_usbc1.hex", regmap_array);
// Initialize the register instances with their respective addresses
port_buf_ctl1_usbc1 = port_buf_ctl1_reg::type_id::create("port_buf_ctl1_usbc1");
port_buf_ctl1_usbc1.configure(null, "hdl_path1.generic_rw_cr32_ndb_port_buf_ctl1");
port_buf_ctl1_usbc1.set_offset('h0016F2C0);
// Initialize the register instances with their respective addresses
port_buf_ctl1_a = port_buf_ctl1_reg::type_id::create("port_buf_ctl1_a");
port_buf_ctl1_a.configure(null, "hdl_path2.generic_rw_cr32_ndb_port_buf_ctl1" );
port_buf_ctl1_a.set_offset('h0016FA00);
// Perform backdoor write
port_buf_ctl1_usbc1.write(null, regmap_array[0], UVM_BACKDOOR);
port_buf_ctl1_a.write(null, regmap_array[1], UVM_BACKDOOR);
Did you look at the reference manual to see how many arguments set_offset()
requires and what they are used for?
Here’s the update on attempt to try backdoor access-
instantiate -
display_reg_block disp_reg1;
port_buf_ctl1_reg port_buf_ctl1_usbc1;
build phase -
//Create the register model for use in the Register Abstraction Layer
disp_reg1 = display_reg_block::type_id::create("disp_reg1");
//Model needs to have build explicitly called
disp_reg1.build();
// 1. Create register instance correctly within the existing reg_block
port_buf_ctl1_usbc1 = port_buf_ctl1_reg::type_id::create("port_buf_ctl1_usbc1", , get_full_name());
if (port_buf_ctl1_usbc1 == null) begin
`uvm_fatal("NULL_OBJ", "Failed to create port_buf_ctl1_usbc1")
end
// 2. Add register to existing register block's address map
disp_reg1.default_map.add_reg(port_buf_ctl1_usbc1, 'h0016F2C0, "RW");
// 3. Configure HDL path using the block's existing map
port_buf_ctl1_usbc1.add_hdl_path_slice(
"hdl_path.generic_rw_cr32_ndb_port_buf_ctl1",
0, // offset
32 // size
);
// 4. Verify HDL path configuration
if (!port_buf_ctl1_usbc1.has_hdl_path("RTL")) begin
`uvm_error("HDL_PATH", "HDL path not properly configured for port_buf_ctl1_usbc1")
end
Next the run_phase -
Assume hex file has 4 lines of 32 bit data & the first pattern is “DEADBEEF”
$readmemh("path_to/hex_port_buf_ctl1_usbc1.hex", regmap_array);
// Backdoor write
port_buf_ctl1_usbc1.write(
.status(status), .value(regmap_array[0]), .path(UVM_BACKDOOR)
);
I’m expecting port_buf_ctl1_usbc1 to pick the 'hDEADBEEF Value. Instead, I’m seeing simulation time Error - Seeing Error -
UVM_ERROR uvm-1.2/reg/uvm_reg_map.svh(783) @ 0.000ns: reporter [RegModel] Register 'port_buf_ctl1_usbc1' may not be added to address map 'disp_reg1.display_reg_map' : they are not in the same block maybe try replacing disp_reg1 with dummy_reg_map