Tests: Update t_uvm_dpi (#7097 test)

This commit is contained in:
Wilson Snyder 2026-02-19 07:11:36 -05:00
parent 2309d52fd6
commit d6f8425e16
3 changed files with 50 additions and 2 deletions

View File

@ -49,6 +49,9 @@ module t;
logic [4:83] wide_asc /* verilator public*/;
// verilator lint_on ASCRANGE
logic [31:0] mem1d[1:2] /* verilator public*/;
logic [31:0] mem2d[1:2][3:4] /* verilator public*/;
uvm_hdl_data_t lval;
initial begin
@ -175,6 +178,51 @@ module t;
`checkh(wide_asc, 80'h1234_56789abc_dcb0ffe5);
end
`ifndef VERILATOR // Unsupported
begin : memory_1d
$display("= uvm_hdl_read/deposit 1D memory");
i = uvm_hdl_check_path("t.mem1d[0]");
`checkh(i, 0);
i = uvm_hdl_check_path("t.mem1d[1]");
`checkh(i, 1);
i = uvm_hdl_check_path("t.mem1d[2]");
`checkh(i, 1);
i = uvm_hdl_check_path("t.mem1d[3]");
`checkh(i, 0);
mem1d[1] = 1;
mem1d[2] = 2;
lval = '0; // Upper bits not cleared by uvm_hdl_read
i = uvm_hdl_read("t.mem1d[2]", lval);
`checkh(i, 1);
`checkh(lval[31:0], 2);
lval = 1024'h200;
i = uvm_hdl_deposit("t.mem1d[2]", lval);
`checkh(i, 1);
`checkh(mem1d[2], 32'h200);
end
begin : memory_2d
$display("= uvm_hdl_read/deposit 2D memory");
i = uvm_hdl_check_path("t.mem2d[0][2]");
`checkh(i, 0);
i = uvm_hdl_check_path("t.mem2d[1][3]");
`checkh(i, 1);
i = uvm_hdl_check_path("t.mem2d[2][4]");
`checkh(i, 1);
i = uvm_hdl_check_path("t.mem2d[2][5]");
`checkh(i, 0);
mem2d = '{'{13, 14}, '{23, 24}};
lval = '0; // Upper bits not cleared by uvm_hdl_read
i = uvm_hdl_read("t.mem2d[2][3]", lval);
`checkh(i, 1);
`checkh(lval[31:0], 23);
lval = 1024'h2300;
i = uvm_hdl_deposit("t.mem2d[2][3]", lval);
`checkh(i, 1);
`checkh(mem2d[2][3], 32'h2300);
end
`endif
begin : t_deposit_bad
$display("= uvm_hdl_deposit bad ranges");
$display("===\nUVM Report expected on next line:");

View File

@ -1,4 +1,4 @@
UVM Report t/t_uvm_dpi.v:59: id message
UVM Report t/t_uvm_dpi.v:62: id message
uvm_dpi_get_tool_name_c() = Verilator
= uvm_re
= uvm_hdl_check_path

View File

@ -1,4 +1,4 @@
UVM Report t/t_uvm_dpi.v:59: id message
UVM Report t/t_uvm_dpi.v:62: id message
uvm_dpi_get_tool_name_c() = Verilator
= uvm_re
= uvm_hdl_check_path