From 1dd80996cd38af5123c9b465a5d4a12bd236a088 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 3 Feb 2026 19:57:23 -0500 Subject: [PATCH] Fix some error capitalization --- include/verilated_vpi.cpp | 14 +++++++------- test_regress/t/t_dist_warn_coverage.py | 12 ++++++------ test_regress/t/t_vpi_force.cpp | 12 ++++++------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/verilated_vpi.cpp b/include/verilated_vpi.cpp index 40192773d..029b7bd65 100644 --- a/include/verilated_vpi.cpp +++ b/include/verilated_vpi.cpp @@ -1308,7 +1308,7 @@ auto VerilatedVpiImp::getForceControlSignals(const VerilatedVpioVarBase* const v VerilatedVpioVar* forceValueSignalVop = VerilatedVpioVar::castp(forceValueSignalp); if (VL_UNLIKELY(!forceEnableSignalVop)) { VL_VPI_ERROR_(__FILE__, __LINE__, - "%s: vpi force or release requested for '%s', but vpiHandle '%p' of enable " + "%s: VPI force or release requested for '%s', but vpiHandle '%p' of enable " "signal '%s' could not be cast to VerilatedVpioVar*. Ensure signal is " "marked as forceable", __func__, signalName.c_str(), forceEnableSignalp, @@ -1316,7 +1316,7 @@ auto VerilatedVpiImp::getForceControlSignals(const VerilatedVpioVarBase* const v } if (VL_UNLIKELY(!forceValueSignalVop)) { VL_VPI_ERROR_(__FILE__, __LINE__, - "%s: vpi force or release requested for '%s', but vpiHandle '%p' of value " + "%s: VPI force or release requested for '%s', but vpiHandle '%p' of value " "signal '%s' could not be cast to VerilatedVpioVar*. Ensure signal is " "marked as forceable", __func__, signalName.c_str(), forceValueSignalp, @@ -2100,7 +2100,7 @@ vpiHandle vpi_register_cb(p_cb_data cb_data_p) { VL_VPI_ERROR_RESET_(); // cppcheck-suppress nullPointer if (VL_UNLIKELY(!cb_data_p)) { - VL_VPI_WARNING_(__FILE__, __LINE__, "%s : callback data pointer is null", __func__); + VL_VPI_WARNING_(__FILE__, __LINE__, "%s: VPI callback data pointer is null", __func__); return nullptr; } const PLI_INT32 reason = cb_data_p->reason; @@ -3413,7 +3413,7 @@ void vl_get_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, const P const unsigned size = vop->size(); if (VL_UNCOVERABLE(num > size)) { - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: requested elements (%u) exceed array size (%u)", + VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Requested elements (%u) exceed array size (%u)", __func__, num, size); return; } @@ -3613,7 +3613,7 @@ void vpi_get_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, PLI_IN const int lowRange = vop->rangep()->low(); const int highRange = vop->rangep()->high(); if ((index_p[0] > highRange) || (index_p[0] < lowRange)) { - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: index %u for object %s is out of bounds [%u,%u]", + VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Index %u for object '%s' is out of bounds [%u,%u]", __func__, index_p[0], vop->fullname(), lowRange, highRange); return; } @@ -3637,7 +3637,7 @@ void vl_put_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, const P const int size = vop->size(); if (VL_UNCOVERABLE(num > size)) { VL_VPI_ERROR_(__FILE__, __LINE__, - "%s: requested elements to set (%u) exceed array size (%u)", __func__, num, + "%s: Requested elements to set (%u) exceed array size (%u)", __func__, num, size); return; } @@ -3794,7 +3794,7 @@ void vpi_put_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, PLI_IN const int lowRange = vop->rangep()->low(); const int highRange = vop->rangep()->high(); if ((index_p[0] > highRange) || (index_p[0] < lowRange)) { - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: index %u for object %s is out of bounds [%u,%u]", + VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Index %u for object '%s' is out of bounds [%u,%u]", __func__, index_p[0], vop->fullname(), lowRange, highRange); return; } diff --git a/test_regress/t/t_dist_warn_coverage.py b/test_regress/t/t_dist_warn_coverage.py index e2696ba51..900f7b2da 100755 --- a/test_regress/t/t_dist_warn_coverage.py +++ b/test_regress/t/t_dist_warn_coverage.py @@ -31,11 +31,11 @@ for s in [ # Tested in t_vpi_force.cpp, but not picked up by pattern matching in this script yet '%s: Signal \'%s\' is marked forceable, but force', '%s: Signal \'%s\' with vpiHandle \'%p\' is marked forceable, but force', - '%s: vpi force or release requested for \'%s\', but vpiHandle \'%p\' of enable', # Emitted as part of a different error message because this is thrown by a nested function - '%s: vpi force or release requested for \'%s\', but vpiHandle \'%p\' of value', # Emitted as part of a different error message because this is thrown by a nested function '%s: Trailing garbage \'%s\' in \'%s\' as value %s for %s', '%s: Non hex character \'%c\' in \'%s\' as value %s for %s', '%s: Non octal character \'%c\' in \'%s\' as value %s for %s', + '%s: VPI force or release requested for \'%s\', but vpiHandle \'%p\' of enable', # Emitted as part of a different error message because this is thrown by a nested function + '%s: VPI force or release requested for \'%s\', but vpiHandle \'%p\' of value', # Emitted as part of a different error message because this is thrown by a nested function # Not yet analyzed '$VERILATOR_ROOT needs to be in environment', @@ -50,10 +50,12 @@ for s in [ '%%Warning: DPI svOpenArrayHandle function index 1', '%%Warning: DPI svOpenArrayHandle function index 2', '%%Warning: DPI svOpenArrayHandle function index 3', - '%s : callback data pointer is null', '%s: Ignoring vpi_put_value to vpiConstant: %s', '%s: Ignoring vpi_put_value to vpiParameter: %s', + '%s: Index %u for object \'%s\' is out of bounds [%u,%u]', '%s: Parsing failed for \'%s\' as value %s for %s', + '%s: Requested elements (%u) exceed array size (%u)', + '%s: Requested elements to set (%u) exceed array size (%u)', '%s: Unsupported callback type %s', '%s: Unsupported flags (%x)', '%s: Unsupported format (%s) as requested for %s', @@ -68,9 +70,7 @@ for s in [ '%s: Unsupported vpiHandle (%p)', '%s: Unsupported vpiHandle (%p) for type %s, nothing will be returned', '%s: Unsupported vpiUserAllocFlag (%x)', - '%s: index %u for object %s is out of bounds [%u,%u]', - '%s: requested elements (%u) exceed array size (%u)', - '%s: requested elements to set (%u) exceed array size (%u)', + '%s: VPI callback data pointer is null', 'Ignoring vpi_get_time with nullptr value pointer', 'Ignoring vpi_get_value_array with null index pointer', 'Ignoring vpi_get_value_array with null value pointer', diff --git a/test_regress/t/t_vpi_force.cpp b/test_regress/t/t_vpi_force.cpp index a46312326..949f0d075 100644 --- a/test_regress/t/t_vpi_force.cpp +++ b/test_regress/t/t_vpi_force.cpp @@ -364,7 +364,7 @@ int checkValue(const std::string& scopeName, const std::string& testSignalName, signalHandle, signalFormat, {scopeName, testSignalName + "__VforceEn"}, "vl_vpi_get_value: Signal '" + testSignalFullName + "' is marked forceable, but force control signals could not be retrieved. Error " - "message: getForceControlSignals: vpi force or release requested for '" + "message: getForceControlSignals: VPI force or release requested for '" + testSignalFullName + "', but vpiHandle '(nil)' of enable signal '" + testSignalFullName + "__VforceEn' could not be cast to VerilatedVpioVar*. Ensure signal is marked as " @@ -375,7 +375,7 @@ int checkValue(const std::string& scopeName, const std::string& testSignalName, signalHandle, signalFormat, {scopeName, testSignalName + "__VforceVal"}, "vl_vpi_get_value: Signal '" + testSignalFullName + "' is marked forceable, but force control signals could not be retrieved. Error " - "message: getForceControlSignals: vpi force or release requested for '" + "message: getForceControlSignals: VPI force or release requested for '" + testSignalFullName + "', but vpiHandle '(nil)' of value signal '" + testSignalFullName + "__VforceVal' could not be cast to VerilatedVpioVar*. Ensure signal is marked " @@ -418,7 +418,7 @@ int forceSignal(const std::string& scopeName, const std::string& testSignalName, {"vpi_put_value: Signal '" + testSignalFullName + "' with vpiHandle ", // Exact handle address does not matter " is marked forceable, but force control signals could not be retrieved. Error " - "message: getForceControlSignals: vpi force or release requested for '" + "message: getForceControlSignals: VPI force or release requested for '" + testSignalFullName + "', but vpiHandle '(nil)' of enable signal '" + testSignalFullName + "__VforceEn' could not be cast to VerilatedVpioVar*. Ensure signal is marked " @@ -431,7 +431,7 @@ int forceSignal(const std::string& scopeName, const std::string& testSignalName, {"vpi_put_value: Signal '" + testSignalFullName + "' with vpiHandle ", // Exact handle address does not matter " is marked forceable, but force control signals could not be retrieved. Error " - "message: getForceControlSignals: vpi force or release requested for '" + "message: getForceControlSignals: VPI force or release requested for '" + testSignalFullName + "', but vpiHandle '(nil)' of value signal '" + testSignalFullName + "__VforceVal' could not be cast to VerilatedVpioVar*. Ensure signal is marked " @@ -472,7 +472,7 @@ int releaseSignal(const std::string& scopeName, const std::string& testSignalNam {"vpi_put_value: Signal '" + testSignalFullName + "' with vpiHandle ", // Exact handle address does not matter " is marked forceable, but force control signals could not be retrieved. Error " - "message: getForceControlSignals: vpi force or release requested for '" + "message: getForceControlSignals: VPI force or release requested for '" + testSignalFullName + "', but vpiHandle '(nil)' of enable signal '" + testSignalFullName + "__VforceEn' could not be cast to VerilatedVpioVar*. Ensure signal is marked " @@ -485,7 +485,7 @@ int releaseSignal(const std::string& scopeName, const std::string& testSignalNam {"vpi_put_value: Signal '" + testSignalFullName + "' with vpiHandle ", // Exact handle address does not matter " is marked forceable, but force control signals could not be retrieved. Error " - "message: getForceControlSignals: vpi force or release requested for '" + "message: getForceControlSignals: VPI force or release requested for '" + testSignalFullName + "', but vpiHandle '(nil)' of value signal '" + testSignalFullName + "__VforceVal' could not be cast to VerilatedVpioVar*. Ensure signal is marked "