forked from github/verilator
Fix bad code when tracing array of structs, bug1122.
This commit is contained in:
parent
663b2be065
commit
2f34132275
2
Changes
2
Changes
@ -13,6 +13,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
|||||||
|
|
||||||
**** Fix internal error on unique casez with --assert, bug1117. [Enzo Chi]
|
**** Fix internal error on unique casez with --assert, bug1117. [Enzo Chi]
|
||||||
|
|
||||||
|
**** Fix bad code when tracing array of structs, bug1122. [Andrew Bardsley]
|
||||||
|
|
||||||
|
|
||||||
* Verilator 3.890 2016-11-25
|
* Verilator 3.890 2016-11-25
|
||||||
|
|
||||||
|
@ -1435,7 +1435,12 @@ private:
|
|||||||
if (!m_selp) {
|
if (!m_selp) {
|
||||||
nodep->v3error("Illegal assignment of constant to unpacked array");
|
nodep->v3error("Illegal assignment of constant to unpacked array");
|
||||||
} else {
|
} else {
|
||||||
nodep->replaceWith(nodep->fromp()->unlinkFrBack());
|
AstNode* fromp = nodep->fromp()->unlinkFrBack();
|
||||||
|
nodep->replaceWith(fromp);
|
||||||
|
if (fromp->dtypep()->skipRefp()->castNodeArrayDType()) {
|
||||||
|
// Strip off array to find what array references
|
||||||
|
fromp->dtypeFrom(fromp->dtypep()->skipRefp()->castNodeArrayDType()->subDTypep());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_selp = NULL;
|
m_selp = NULL;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// please note it here, otherwise:**
|
// please note it here, otherwise:**
|
||||||
//
|
//
|
||||||
// This file ONLY is placed into the Public Domain, for any use,
|
// This file ONLY is placed into the Public Domain, for any use,
|
||||||
// without warranty, 2016 by ____YOUR_NAME_HERE____.
|
// without warranty, 2017 by ____YOUR_NAME_HERE____.
|
||||||
|
|
||||||
module t (/*AUTOARG*/
|
module t (/*AUTOARG*/
|
||||||
// Inputs
|
// Inputs
|
||||||
|
19
test_regress/t/t_trace_packed_struct.pl
Executable file
19
test_regress/t/t_trace_packed_struct.pl
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
||||||
|
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||||
|
#
|
||||||
|
# Copyright 2003 by Wilson Snyder. This program is free software; you can
|
||||||
|
# redistribute it and/or modify it under the terms of either the GNU
|
||||||
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
|
# Version 2.0.
|
||||||
|
|
||||||
|
compile (
|
||||||
|
v_flags2 => ["--trace"]
|
||||||
|
);
|
||||||
|
|
||||||
|
execute (
|
||||||
|
check_finished=>1,
|
||||||
|
);
|
||||||
|
|
||||||
|
ok(1);
|
||||||
|
1;
|
29
test_regress/t/t_trace_packed_struct.v
Normal file
29
test_regress/t/t_trace_packed_struct.v
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// DESCRIPTION: Verilator: Verilog Test module
|
||||||
|
//
|
||||||
|
// This file ONLY is placed into the Public Domain, for any use,
|
||||||
|
// without warranty, 2017 by Andrew Bardsley.
|
||||||
|
|
||||||
|
module t (/*AUTOARG*/
|
||||||
|
// Inputs
|
||||||
|
clk
|
||||||
|
);
|
||||||
|
|
||||||
|
input clk;
|
||||||
|
|
||||||
|
// This won't compile with tracing as an incorrect declaration is made for
|
||||||
|
// the temp variables used to represent the elements of localparam v
|
||||||
|
typedef struct packed {
|
||||||
|
logic [2:0][31:0] a;
|
||||||
|
} t;
|
||||||
|
|
||||||
|
localparam t v[2:0] = '{
|
||||||
|
'{'{32'h10000002, 32'h10000001, 32'h10000000}},
|
||||||
|
'{'{32'h20000002, 32'h20000001, 32'h20000000}},
|
||||||
|
'{'{32'h30000002, 32'h30000001, 32'h30000000}}
|
||||||
|
};
|
||||||
|
|
||||||
|
initial begin
|
||||||
|
$write("*-* All Finished *-*\n");
|
||||||
|
$finish;
|
||||||
|
end
|
||||||
|
endmodule
|
Loading…
Reference in New Issue
Block a user