From 4bf2d0d7559fd5dfb0d73fedce3df67587d53c44 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 31 Aug 2025 13:31:57 -0400 Subject: [PATCH] Tests: More uvm_dpi testing (#4566) --- test_regress/t/t_uvm_dpi.out | 13 +++++++------ test_regress/t/t_uvm_dpi.v | 7 +++++-- test_regress/t/uvm/uvm_pkg_todo.svh | 3 ++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/test_regress/t/t_uvm_dpi.out b/test_regress/t/t_uvm_dpi.out index c79bab699..e0fe18db4 100644 --- a/test_regress/t/t_uvm_dpi.out +++ b/test_regress/t/t_uvm_dpi.out @@ -1,3 +1,4 @@ +UVM Report t/t_uvm_dpi.v:42: id message uvm_dpi_get_tool_name_c() = Verilator = uvm_re = uvm_hdl_check_path @@ -5,7 +6,7 @@ uvm_dpi_get_tool_name_c() = Verilator = uvm_hdl_read not found (bad) === UVM Report expected on next line: -UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c: 54: UVM/DPI/HDL_SET set: unable to locate hdl path (t.__DEPOSIT_NOT_FOUND) +UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c:54: UVM/DPI/HDL_SET set: unable to locate hdl path (t.__DEPOSIT_NOT_FOUND) Either the name is incorrect, or you may not have PLI/ACC visibility to that name = uvm_hdl_deposit simple variable = uvm_hdl_read single bit @@ -15,22 +16,22 @@ UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c: 54: UVM/DPI/HDL_SET set: = uvm_hdl_deposit bad ranges === UVM Report expected on next line: -UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c: 54: UVM/DPI/HDL_SET set: unable to locate hdl path (t.exposed[10:3]) +UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c:54: UVM/DPI/HDL_SET set: unable to locate hdl path (t.exposed[10:3]) Either the name is incorrect, or you may not have PLI/ACC visibility to that name === UVM Report expected on next line: -UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c: 54: UVM/DPI/HDL_SET set: unable to locate hdl path (t.exposed[99:15]) +UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c:54: UVM/DPI/HDL_SET set: unable to locate hdl path (t.exposed[99:15]) Either the name is incorrect, or you may not have PLI/ACC visibility to that name = uvm_hdl_force === UVM Report expected on next line: -UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c: 54: UVM/DPI/VLOG_GET Unsupported: uvh_hdl_force/uvm_hdl_release on hdl path 't.exposed' +UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c:54: UVM/DPI/VLOG_GET Unsupported: uvh_hdl_force/uvm_hdl_release on hdl path 't.exposed' = uvm_hdl_release === UVM Report expected on next line: -UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c: 54: UVM/DPI/VLOG_GET Unsupported: uvh_hdl_force/uvm_hdl_release on hdl path 't.exposed' +UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c:54: UVM/DPI/VLOG_GET Unsupported: uvh_hdl_force/uvm_hdl_release on hdl path 't.exposed' = uvm_hdl_release_and_read === UVM Report expected on next line: -UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c: 54: UVM/DPI/VLOG_GET Unsupported: uvh_hdl_force/uvm_hdl_release on hdl path 't.exposed' +UVM Report ../../t/uvm/dpi/uvm_hdl_verilator.c:54: UVM/DPI/VLOG_GET Unsupported: uvh_hdl_force/uvm_hdl_release on hdl path 't.exposed' *-* All Finished *-* diff --git a/test_regress/t/t_uvm_dpi.v b/test_regress/t/t_uvm_dpi.v index b747562d2..75661bbff 100644 --- a/test_regress/t/t_uvm_dpi.v +++ b/test_regress/t/t_uvm_dpi.v @@ -20,8 +20,8 @@ package uvm_pkg; export "DPI-C" function m__uvm_report_dpi; function void m__uvm_report_dpi(int severity, string id, string message, int verbosity, string filename, int line); - $display("UVM Report %s:%d: %s %s", filename, line, id, message); - endfunction : m__uvm_report_dpi + $display("UVM Report %s:%0d: %s %s", filename, line, id, message); + endfunction endpackage module t; @@ -38,6 +38,9 @@ module t; // TODO TEST: // extern const char* uvm_dpi_get_next_arg_c(int init); + //===== Exports + uvm_pkg::m__uvm_report_dpi(1, "id", "message", 1, `__FILE__, `__LINE__); + //===== Tool s = uvm_dpi_get_tool_name_c(); $display("uvm_dpi_get_tool_name_c() = %s", s); diff --git a/test_regress/t/uvm/uvm_pkg_todo.svh b/test_regress/t/uvm/uvm_pkg_todo.svh index b61cd8332..a79288b9e 100644 --- a/test_regress/t/uvm/uvm_pkg_todo.svh +++ b/test_regress/t/uvm/uvm_pkg_todo.svh @@ -4,10 +4,11 @@ // To recreate: // Using verilator_ext_tests // t/t_uvm_parse.py --debug --no-dump-tree -// Copy to here t/obj_vlt/Vt_uvm_parse/Vt_uvm_parse__inputs.vpp +// Insert to here obj_vlt/t_uvm_parse/Vt_uvm_parse__inputs.vpp // M-x untabify // (global-replace-regexp "[ ]+$" "") // (global-replace-regexp ", +" ", ") +// (global-replace-regexp (concat "\"[^\" ]*" "/uvm/src") "\"t/uvm/src") // Add this header //------------------------------------------------------------------------------ // Copyright 2007-2011 Mentor Graphics Corporation