diff --git a/include/verilated_vpi.cpp b/include/verilated_vpi.cpp index 7bc965cc7..60f3984f3 100644 --- a/include/verilated_vpi.cpp +++ b/include/verilated_vpi.cpp @@ -2837,7 +2837,7 @@ bool vl_check_format(const VerilatedVpioVarBase* vop, const p_vpi_value valuep, } else { status = false; } - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) for %s", __func__, + VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) for '%s'", __func__, VerilatedVpiError::strFromVpiVal(valuep->format), vop->fullname()); return status; } @@ -3201,8 +3201,8 @@ void vl_vpi_get_value(const VerilatedVpioVarBase* vop, p_vpi_value valuep) { } else if (valuep->format == vpiSuppressVal) { return; } - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for %s", __func__, - VerilatedVpiError::strFromVpiVal(valuep->format), vop->fullname()); + VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for '%s'", + __func__, VerilatedVpiError::strFromVpiVal(valuep->format), vop->fullname()); } void vpi_get_value(vpiHandle object, p_vpi_value valuep) { @@ -3222,7 +3222,7 @@ void vpi_get_value(vpiHandle object, p_vpi_value valuep) { valuep->value.integer = vop->num(); return; } - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) for %s", __func__, + VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) for '%s'", __func__, VerilatedVpiError::strFromVpiVal(valuep->format), vop->fullname()); return; } @@ -3413,7 +3413,7 @@ vpiHandle vpi_put_value(vpiHandle object, p_vpi_value valuep, p_vpi_time /*time_ unsigned char digit = valuep->value.str[len - i - 1] - '0'; if (digit > 7) { // If str was < '0', then as unsigned, digit > 7 VL_VPI_WARNING_(__FILE__, __LINE__, - "%s: Non octal character '%c' in '%s' as value %s for %s", + "%s: Non octal character '%c' in '%s' as value %s for '%s'", __func__, digit + '0', valuep->value.str, VerilatedVpiError::strFromVpiVal(valuep->format), valueVop->fullname()); @@ -3428,15 +3428,15 @@ vpiHandle vpi_put_value(vpiHandle object, p_vpi_value valuep, p_vpi_time /*time_ const int success = std::sscanf(valuep->value.str, "%30llu%15s", // lintok-format-ll &val, remainder); if (success < 1) { - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Parsing failed for '%s' as value %s for %s", - __func__, valuep->value.str, - VerilatedVpiError::strFromVpiVal(valuep->format), + VL_VPI_ERROR_(__FILE__, __LINE__, + "%s: Parsing failed for '%s' as value %s for '%s'", __func__, + valuep->value.str, VerilatedVpiError::strFromVpiVal(valuep->format), valueVop->fullname()); return nullptr; } if (success > 1) { VL_VPI_WARNING_( - __FILE__, __LINE__, "%s: Trailing garbage '%s' in '%s' as value %s for %s", + __FILE__, __LINE__, "%s: Trailing garbage '%s' in '%s' as value %s for '%s'", __func__, remainder, valuep->value.str, VerilatedVpiError::strFromVpiVal(valuep->format), valueVop->fullname()); } @@ -3461,7 +3461,7 @@ vpiHandle vpi_put_value(vpiHandle object, p_vpi_value valuep, p_vpi_time /*time_ hex = digit - 'A' + 10; } else { VL_VPI_WARNING_(__FILE__, __LINE__, - "%s: Non hex character '%c' in '%s' as value %s for %s", + "%s: Non hex character '%c' in '%s' as value %s for '%s'", __func__, digit, valuep->value.str, VerilatedVpiError::strFromVpiVal(valuep->format), valueVop->fullname()); @@ -3501,16 +3501,16 @@ vpiHandle vpi_put_value(vpiHandle object, p_vpi_value valuep, p_vpi_time /*time_ vl_vpi_put_word(valueVop, (valuep->value.scalar == vpi1 ? 1 : 0), 1, 0); return object; } - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for %s", + VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for '%s'", __func__, VerilatedVpiError::strFromVpiVal(valuep->format), valueVop->fullname()); return nullptr; } else if (const VerilatedVpioParam* const vop = VerilatedVpioParam::castp(object)) { - VL_VPI_WARNING_(__FILE__, __LINE__, "%s: Ignoring vpi_put_value to vpiParameter: %s", + VL_VPI_WARNING_(__FILE__, __LINE__, "%s: Ignoring vpi_put_value to vpiParameter '%s'", __func__, vop->fullname()); return nullptr; } else if (const VerilatedVpioConst* const vop = VerilatedVpioConst::castp(object)) { - VL_VPI_WARNING_(__FILE__, __LINE__, "%s: Ignoring vpi_put_value to vpiConstant: %s", + VL_VPI_WARNING_(__FILE__, __LINE__, "%s: Ignoring vpi_put_value to vpiConstant '%s'", __func__, vop->fullname()); return nullptr; } @@ -3562,8 +3562,8 @@ bool vl_check_array_format(const VerilatedVar* varp, const p_vpi_arrayvalue arra } } - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for %s", __func__, - VerilatedVpiError::strFromVpiVal(arrayvalue_p->format), fullname); + VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for '%s'", + __func__, VerilatedVpiError::strFromVpiVal(arrayvalue_p->format), fullname); return false; } @@ -3876,8 +3876,9 @@ void vl_get_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, const P return; } - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for %s", __func__, - VerilatedVpiError::strFromVpiVal(arrayvalue_p->format), vop->fullname()); + VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for '%s'", + __func__, VerilatedVpiError::strFromVpiVal(arrayvalue_p->format), + vop->fullname()); } void vpi_get_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, PLI_INT32* index_p, @@ -4059,8 +4060,9 @@ void vl_put_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, const P return; } - VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for %s", __func__, - VerilatedVpiError::strFromVpiVal(arrayvalue_p->format), vop->fullname()); + VL_VPI_ERROR_(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for '%s'", + __func__, VerilatedVpiError::strFromVpiVal(arrayvalue_p->format), + vop->fullname()); } void vpi_put_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, PLI_INT32* index_p, @@ -4104,7 +4106,7 @@ void vpi_put_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, PLI_IN if (VL_UNLIKELY(!vop->varp()->isPublicRW())) { VL_VPI_ERROR_(__FILE__, __LINE__, "Ignoring vpi_put_value_array to signal marked read-only," - " use public_flat_rw instead: %s", + " use public_flat_rw instead: '%s'", vop->fullname()); return; } diff --git a/src/V3Task.cpp b/src/V3Task.cpp index f92d11c5b..d05e44254 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -819,7 +819,8 @@ class TaskVisitor final : public VNVisitor { if (name.end() != std::find_if(name.begin(), name.end(), [](char c) { return !std::isalnum(c) && c != '_'; })) { - nodep->v3error("DPI function has illegal characters in C identifier name: " << name); + nodep->v3error("DPI function has illegal characters in C identifier name '" << name + << '\''); } } diff --git a/test_regress/t/t_dist_warn_coverage.py b/test_regress/t/t_dist_warn_coverage.py index cc209bdbc..ea7e24054 100755 --- a/test_regress/t/t_dist_warn_coverage.py +++ b/test_regress/t/t_dist_warn_coverage.py @@ -29,13 +29,9 @@ for s in [ 'dynamic new() not expected in this context (expected under an assign)', # Instead get syntax error # 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: 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 + '%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\'', # Not yet analyzed '$VERILATOR_ROOT needs to be in environment', @@ -50,16 +46,16 @@ for s in [ '%%Warning: DPI svOpenArrayHandle function index 1', '%%Warning: DPI svOpenArrayHandle function index 2', '%%Warning: DPI svOpenArrayHandle function index 3', - '%s: Ignoring vpi_put_value to vpiConstant: %s', - '%s: Ignoring vpi_put_value to vpiParameter: %s', + '%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: 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', - '%s: Unsupported format (%s) for %s', + '%s: Unsupported format (%s) as requested for \'%s\'', + '%s: Unsupported format (%s) for \'%s\'', '%s: Unsupported p_vpi_value as requested for \'%s\' with vpiInertialDelay', '%s: Unsupported property %s, nothing will be returned', '%s: Unsupported type %s, ignoring', @@ -78,7 +74,6 @@ for s in [ 'Ignoring vpi_put_value_array to signal marked read-only,', 'Ignoring vpi_put_value_array with null index pointer', 'Ignoring vpi_put_value_array with null value pointer', - 'vpi_get_value with more than VL_VALUE_STRING_MAX_WORDS; increase and', 'vpi_put_value was used on signal marked read-only,', 'Can\'t find varpin scope of', 'Can\'t read annotation file:', @@ -108,12 +103,10 @@ for s in [ 'Signals inside functions/tasks cannot be marked forceable', 'Slice size cannot be zero.', 'Slices of arrays in assignments have different unpacked dimensions,', - 'String of', 'Symbol matching', 'Thread scheduler is unable to provide requested', 'Unexpected connection to arrayed port', 'Unsized numbers/parameters not allowed in streams.', - 'Unsupported (or syntax error): Foreach on this array\'s construct', 'Unsupported LHS node type in array assignment', 'Unsupported RHS tristate construct:', 'Unsupported or syntax error: Unsized range in instance or other declaration', @@ -130,15 +123,12 @@ for s in [ 'Unsupported: Creating tristate signal not underneath a module:', 'Unsupported: Default value on module inout/ref/constref:', 'Unsupported: Modport empty expression', - 'Unsupported: Modport export with prototype', - 'Unsupported: Modport import with prototype', 'Unsupported: Non-constant default value in missing argument', 'Unsupported: Non-constant index when passing interface to module', 'Unsupported: Only one PSL clock allowed per assertion', 'Unsupported: Per-bit array instantiations', 'Unsupported: Public functions with >64 bit outputs;', 'Unsupported: Public functions with return > 64 bits wide.', - 'Unsupported: Release statement argument is too complex array select', 'Unsupported: Replication to form', 'Unsupported: Shifting of by over 32-bit number isn\'t supported.', 'Unsupported: Size-changing cast on non-basic data type', @@ -154,7 +144,6 @@ for s in [ 'Unsupported: extern constraint definition with class-in-class', 'Unsupported: extern forkjoin', 'Unsupported: extern task', - 'Unsupported: modport export', 'Unsupported: no_inline for tasks', 'Unsupported: non-const assert directive type expression', 'Unsupported: property port \'local\'', diff --git a/test_regress/t/t_dpi_name_bad.out b/test_regress/t/t_dpi_name_bad.out index 785d68f59..cc32e5f7e 100644 --- a/test_regress/t/t_dpi_name_bad.out +++ b/test_regress/t/t_dpi_name_bad.out @@ -1,8 +1,8 @@ -%Error: t/t_dpi_name_bad.v:11:31: DPI function has illegal characters in C identifier name: badly.named +%Error: t/t_dpi_name_bad.v:11:31: DPI function has illegal characters in C identifier name 'badly.named' 11 | import "DPI-C" function int \badly.named (int i); | ^~~~~~~~~~~~ ... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance. -%Error: t/t_dpi_name_bad.v:14:16: DPI function has illegal characters in C identifier name: badly.expt +%Error: t/t_dpi_name_bad.v:14:16: DPI function has illegal characters in C identifier name 'badly.expt' 14 | function int \badly.expt ; | ^~~~~~~~~~~ %Error: Exiting due to diff --git a/test_regress/t/t_vpi_force.cpp b/test_regress/t/t_vpi_force.cpp index 0d6d2fd61..9165c5ce0 100644 --- a/test_regress/t/t_vpi_force.cpp +++ b/test_regress/t/t_vpi_force.cpp @@ -1894,36 +1894,37 @@ extern "C" int tryInvalidPutOperations() { "octString", {.format = vpiOctStrVal, .value = {.str = const_cast("123A")}}, vpiForceFlag, "vpi_put_value: Non octal character 'A' in '123A' as value " - "vpiOctStrVal for t.test.octString__VforceVal")); + "vpiOctStrVal for 't.test.octString__VforceVal'")); CHECK_RESULT_Z(expectVpiPutError( // NOLINT(concurrency-mt-unsafe) "decStringC", {.format = vpiDecStrVal, .value = {.str = const_cast("A123")}}, vpiForceFlag, "vpi_put_value: Parsing failed for 'A123' as value vpiDecStrVal for " - "t.test.decStringC__VforceVal")); + "'t.test.decStringC__VforceVal'")); CHECK_RESULT_Z(expectVpiPutError( // NOLINT(concurrency-mt-unsafe) "decStringC", {.format = vpiDecStrVal, .value = {.str = const_cast("123A")}}, vpiForceFlag, "vpi_put_value: Trailing garbage 'A' in '123A' as value vpiDecStrVal for " - "t.test.decStringC__VforceVal")); + "'t.test.decStringC__VforceVal'")); CHECK_RESULT_Z(expectVpiPutError( // NOLINT(concurrency-mt-unsafe) "hexString", {.format = vpiHexStrVal, .value = {.str = const_cast("12AG")}}, vpiForceFlag, "vpi_put_value: Non hex character 'G' in '12AG' as value vpiHexStrVal for " - "t.test.hexString__VforceVal")); + "'t.test.hexString__VforceVal'")); // vop was replaced with baseSignalVop in vpi_put_value, so these tests are required to hit // the test coverage target and ensure the error messages still work. CHECK_RESULT_Z(expectVpiPutError( // NOLINT(concurrency-mt-unsafe) "onebit", {.format = vpiRawFourStateVal, .value = {}}, vpiForceFlag, - "vl_check_format: Unsupported format (vpiRawFourStateVal) for t.test.onebit")); + "vl_check_format: Unsupported format (vpiRawFourStateVal) for " + "'t.test.onebit'")); CHECK_RESULT_Z(expectVpiPutError( // NOLINT(concurrency-mt-unsafe) "onebit", {.format = vpiSuppressVal, .value = {}}, vpiForceFlag, - "vpi_put_value: Unsupported format (vpiSuppressVal) as " - "requested for t.test.onebit__VforceVal")); + "vpi_put_value: Unsupported format (vpiSuppressVal) as requested for " + "'t.test.onebit__VforceVal'")); CHECK_RESULT_Z(expectVpiPutError( // NOLINT(concurrency-mt-unsafe) "onebit", {.format = vpiStringVal, .value = {}}, vpiInertialDelay,