Internals: Fix some clang-tidy issues. No functional change.
This commit is contained in:
parent
98b89d0f2c
commit
ed1e3ec4a2
|
|
@ -919,6 +919,7 @@ void _vl_vsformat(std::string& output, const std::string& format, va_list ap) VL
|
||||||
}
|
}
|
||||||
case 'p': { // 'x' but parameter is string
|
case 'p': { // 'x' but parameter is string
|
||||||
const int lbits = va_arg(ap, int);
|
const int lbits = va_arg(ap, int);
|
||||||
|
(void)lbits;
|
||||||
const std::string* const cstr = va_arg(ap, const std::string*);
|
const std::string* const cstr = va_arg(ap, const std::string*);
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
for (unsigned char c : *cstr) oss << std::hex << static_cast<int>(c);
|
for (unsigned char c : *cstr) oss << std::hex << static_cast<int>(c);
|
||||||
|
|
|
||||||
|
|
@ -2574,8 +2574,8 @@ void vl_vpi_put_word(const VerilatedVpioVar* vop, QData word, size_t bitCount, s
|
||||||
}
|
}
|
||||||
|
|
||||||
void vl_vpi_get_value(const VerilatedVpioVarBase* vop, p_vpi_value valuep) {
|
void vl_vpi_get_value(const VerilatedVpioVarBase* vop, p_vpi_value valuep) {
|
||||||
const VerilatedVar* varp = vop->varp();
|
const VerilatedVar* const varp = vop->varp();
|
||||||
void* varDatap = vop->varDatap();
|
void* const varDatap = vop->varDatap();
|
||||||
const char* fullname = vop->fullname();
|
const char* fullname = vop->fullname();
|
||||||
|
|
||||||
if (!vl_check_format(varp, valuep, fullname, true)) return;
|
if (!vl_check_format(varp, valuep, fullname, true)) return;
|
||||||
|
|
@ -3118,7 +3118,7 @@ void vl_get_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, const P
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool leftIsLow = vop->rangep()->left() == vop->rangep()->low();
|
const bool leftIsLow = vop->rangep()->left() == vop->rangep()->low();
|
||||||
int index
|
const int index
|
||||||
= leftIsLow ? index_p[0] - vop->rangep()->left() : vop->rangep()->left() - index_p[0];
|
= leftIsLow ? index_p[0] - vop->rangep()->left() : vop->rangep()->left() - index_p[0];
|
||||||
|
|
||||||
if (arrayvalue_p->format == vpiShortIntVal) {
|
if (arrayvalue_p->format == vpiShortIntVal) {
|
||||||
|
|
@ -3309,9 +3309,8 @@ void vpi_get_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, PLI_IN
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lowRange = vop->rangep()->low();
|
const int lowRange = vop->rangep()->low();
|
||||||
int highRange = vop->rangep()->high();
|
const int highRange = vop->rangep()->high();
|
||||||
|
|
||||||
if ((index_p[0] > highRange) || (index_p[0] < lowRange)) {
|
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);
|
__func__, index_p[0], vop->fullname(), lowRange, highRange);
|
||||||
|
|
@ -3334,7 +3333,7 @@ void vl_put_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, const P
|
||||||
|
|
||||||
const VerilatedVar* const varp = vop->varp();
|
const VerilatedVar* const varp = vop->varp();
|
||||||
|
|
||||||
int size = vop->size();
|
const int size = vop->size();
|
||||||
if (VL_UNCOVERABLE(num > size)) {
|
if (VL_UNCOVERABLE(num > size)) {
|
||||||
VL_VPI_ERROR_(__FILE__, __LINE__,
|
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,
|
||||||
|
|
@ -3343,7 +3342,7 @@ void vl_put_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, const P
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool leftIsLow = vop->rangep()->left() == vop->rangep()->low();
|
const bool leftIsLow = vop->rangep()->left() == vop->rangep()->low();
|
||||||
int index
|
const int index
|
||||||
= leftIsLow ? index_p[0] - vop->rangep()->left() : vop->rangep()->left() - index_p[0];
|
= leftIsLow ? index_p[0] - vop->rangep()->left() : vop->rangep()->left() - index_p[0];
|
||||||
|
|
||||||
if (arrayvalue_p->format == vpiShortIntVal) {
|
if (arrayvalue_p->format == vpiShortIntVal) {
|
||||||
|
|
@ -3491,11 +3490,8 @@ void vpi_put_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p, PLI_IN
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VerilatedVar* const varp = vop->varp();
|
const int lowRange = vop->rangep()->low();
|
||||||
|
const int highRange = vop->rangep()->high();
|
||||||
int lowRange = vop->rangep()->low();
|
|
||||||
int highRange = vop->rangep()->high();
|
|
||||||
|
|
||||||
if ((index_p[0] > highRange) || (index_p[0] < lowRange)) {
|
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);
|
__func__, index_p[0], vop->fullname(), lowRange, highRange);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue