mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Fix missing error when parameter assigned to type, bug1575.
This commit is contained in:
parent
171960635e
commit
8ce60e955f
2
Changes
2
Changes
@ -25,7 +25,7 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
||||
**** Fix multithreaded yield behavior when no work. [Patrick Stewart]
|
||||
|
||||
**** Fix bad-syntax crashes, bug1548, bug1550-1553, bug1557-1560, bug1563,
|
||||
bug1573, bug1574. [Eric Rippey]
|
||||
bug1573-1575. [Eric Rippey]
|
||||
|
||||
**** Benchmark --protect-lib runtime, bug1519. [Todd Strader]
|
||||
|
||||
|
@ -3491,6 +3491,10 @@ private:
|
||||
} else if (expDTypep->isString() && !underp->dtypep()->isString()) {
|
||||
underp = spliceCvtString(underp);
|
||||
underp = userIterateSubtreeReturnEdits(underp, WidthVP(SELF, FINAL).p());
|
||||
} else if (VN_IS(underp, NodeDType)) { // Note the node itself, not node's data type
|
||||
underp->v3error(ucfirst(nodep->prettyOperatorName())
|
||||
<<" expected non-datatype "<<side
|
||||
<<" but '"<<underp->name()<<"' is a datatype.");
|
||||
} else {
|
||||
AstBasicDType* expBasicp = expDTypep->basicp();
|
||||
AstBasicDType* underBasicp = underp->dtypep()->basicp();
|
||||
|
4
test_regress/t/t_param_type_bad.out
Normal file
4
test_regress/t/t_param_type_bad.out
Normal file
@ -0,0 +1,4 @@
|
||||
%Error: t/t_param_type_bad.v:8: Parameter type's initial value isn't a type: 'bad2'
|
||||
localparam type bad2 = 2;
|
||||
^~~~
|
||||
%Error: Exiting due to
|
20
test_regress/t/t_param_type_bad.pl
Executable file
20
test_regress/t/t_param_type_bad.pl
Executable file
@ -0,0 +1,20 @@
|
||||
#!/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.
|
||||
|
||||
scenarios(vlt => 1);
|
||||
|
||||
lint(
|
||||
# Bug1575 required trace to crash
|
||||
verilator_flags2 => ["--trace"],
|
||||
fails => 1,
|
||||
expect_filename => $Self->{golden_filename},
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
9
test_regress/t/t_param_type_bad.v
Normal file
9
test_regress/t/t_param_type_bad.v
Normal file
@ -0,0 +1,9 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty, 2019 by Wilson Snyder.
|
||||
|
||||
module t;
|
||||
localparam type t = logic; // Fine
|
||||
localparam type bad2 = 2; // Bad
|
||||
endmodule
|
4
test_regress/t/t_param_type_bad2.out
Normal file
4
test_regress/t/t_param_type_bad2.out
Normal file
@ -0,0 +1,4 @@
|
||||
%Error: t/t_param_type_bad2.v:8: Parameter type's initial value isn't a type: 'bad2'
|
||||
localparam type bad2 = 2;
|
||||
^~~~
|
||||
%Error: Exiting due to
|
20
test_regress/t/t_param_type_bad2.pl
Executable file
20
test_regress/t/t_param_type_bad2.pl
Executable file
@ -0,0 +1,20 @@
|
||||
#!/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.
|
||||
|
||||
scenarios(vlt => 1);
|
||||
|
||||
lint(
|
||||
# Bug1575 required trace to crash
|
||||
verilator_flags2 => ["--trace"],
|
||||
fails => 1,
|
||||
expect_filename => $Self->{golden_filename},
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
9
test_regress/t/t_param_type_bad2.v
Normal file
9
test_regress/t/t_param_type_bad2.v
Normal file
@ -0,0 +1,9 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty, 2019 by Wilson Snyder.
|
||||
|
||||
module t;
|
||||
localparam type t = logic; // Fine
|
||||
localparam type bad2 = 2; // Bad
|
||||
endmodule
|
Loading…
Reference in New Issue
Block a user