diff --git a/Changes b/Changes index 6db06004e..98b04053e 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,9 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix DETECTARRAY on packed structures, bug610. [Jeremy Bennett] +**** Fix 32-bit OS VPI scan issue, bug615. [Jeremy Bennett, Rich Porter] + + * Verilator 3.845 2013/02/04 *** Fix nested packed arrays and struct, bug600. [Jeremy Bennett] diff --git a/include/verilated_vpi.h b/include/verilated_vpi.h index fadf3e032..1cfe562c5 100644 --- a/include/verilated_vpi.h +++ b/include/verilated_vpi.h @@ -839,7 +839,7 @@ void vpi_get_value(vpiHandle object, p_vpi_value value_p) { case VLVT_UINT8 : snprintf(outStr, outStrSz+1, "%hhu", (unsigned int)*((CData*)(vop->varDatap()))); return; case VLVT_UINT16: snprintf(outStr, outStrSz+1, "%hu", (unsigned int)*((SData*)(vop->varDatap()))); return; case VLVT_UINT32: snprintf(outStr, outStrSz+1, "%u", (unsigned int)*((IData*)(vop->varDatap()))); return; - case VLVT_UINT64: snprintf(outStr, outStrSz+1, "%lu", (unsigned long)*((QData*)(vop->varDatap()))); return; + case VLVT_UINT64: snprintf(outStr, outStrSz+1, "%llu", (unsigned long long)*((QData*)(vop->varDatap()))); return; default: strcpy(outStr, "-1"); _VL_VPI_ERROR(__FILE__, __LINE__, "%s: Unsupported format (%s) for %s, maximum limit is 64 bits", @@ -1096,8 +1096,8 @@ vpiHandle vpi_put_value(vpiHandle object, p_vpi_value value_p, } } else if (value_p->format == vpiDecStrVal) { char remainder[16]; - unsigned long val; - int success = sscanf(value_p->value.str, "%30lu%15s", &val, remainder); + unsigned long long val; + int success = sscanf(value_p->value.str, "%30llu%15s", &val, remainder); if (success < 1) { _VL_VPI_ERROR(__FILE__, __LINE__, "%s: Parsing failed for '%s' as value %s for %s", VL_FUNC, value_p->value.str, VerilatedVpiError::strFromVpiVal(value_p->format), vop->fullname()); diff --git a/test_regress/t/t_dist_portability.pl b/test_regress/t/t_dist_portability.pl index b0ae117ac..99123d6e1 100755 --- a/test_regress/t/t_dist_portability.pl +++ b/test_regress/t/t_dist_portability.pl @@ -54,9 +54,12 @@ sub printfll { my %names; foreach my $line (split /\n/, $grep) { next if $line !~ /%[a-z0-9]*ll/; + next if $line !~ /\blong\S+long\b/; # Assume a cast + print "$line\n"; if ($line =~ /^([^:]+)/) { $names{$1} = 1; - print "$line\n"; + } else { + $names{UNKNOWN} = 1; } } if (keys %names) {