Fix vpiLeftRange on little-endian memories (#2696).

This commit is contained in:
Wilson Snyder 2021-01-02 22:00:13 -05:00
parent 83d978c2cd
commit 1a073fbf5e
4 changed files with 26 additions and 3 deletions

View File

@ -27,6 +27,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
**** Fix genblk naming to match IEEE (#2686). [tinshark]
**** Fix vpiLeftRange on little-endian memories (#2696). [Marlon James]
**** Fix vpi_release_handle to be called implicitly per IEEE (#2706).
**** Fix tracing empty sc module (#2729).

View File

@ -773,9 +773,9 @@ void EmitCSyms::emitSymImp() {
= dtypep->skipRefp(); // Skip AstRefDType/AstTypedef, or return same node
if (const AstNodeArrayDType* adtypep = VN_CAST(dtypep, NodeArrayDType)) {
bounds += " ,";
bounds += cvtToStr(adtypep->hi());
bounds += cvtToStr(adtypep->left());
bounds += ",";
bounds += cvtToStr(adtypep->lo());
bounds += cvtToStr(adtypep->right());
if (VN_IS(dtypep, PackArrayDType)) {
pdim++;
} else {

View File

@ -327,6 +327,25 @@ int _mon_check_var() {
CHECK_RESULT_CSTR(p, "vpiConstant");
}
TestVpiHandle vh5 = VPI_HANDLE("quads");
CHECK_RESULT_NZ(vh5);
{
TestVpiHandle vh10 = vpi_handle(vpiLeftRange, vh5);
CHECK_RESULT_NZ(vh10);
vpi_get_value(vh10, &tmpValue);
CHECK_RESULT(tmpValue.value.integer, 2);
p = vpi_get_str(vpiType, vh10);
CHECK_RESULT_CSTR(p, "vpiConstant");
}
{
TestVpiHandle vh10 = vpi_handle(vpiRightRange, vh5);
CHECK_RESULT_NZ(vh10);
vpi_get_value(vh10, &tmpValue);
CHECK_RESULT(tmpValue.value.integer, 3);
p = vpi_get_str(vpiType, vh10);
CHECK_RESULT_CSTR(p, "vpiConstant");
}
return 0;
}

View File

@ -29,7 +29,9 @@ extern "C" int mon_check();
reg [2:1] twoone /*verilator public_flat_rw @(posedge clk) */;
reg [2:1] fourthreetwoone[4:3] /*verilator public_flat_rw @(posedge clk) */;
reg [61:0] quads[3:2] /*verilator public_flat_rw @(posedge clk) */;
// verilator lint_off LITENDIAN
reg [0:61] quads[2:3] /*verilator public_flat_rw @(posedge clk) */;
// verilator lint_on LITENDIAN
reg [31:0] count /*verilator public_flat_rd */;
reg [31:0] half_count /*verilator public_flat_rd */;