Report errors when extra underscores used in meta-comments.
This commit is contained in:
parent
64719f3ace
commit
7c3048ab9c
2
Changes
2
Changes
|
|
@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks!
|
|||
|
||||
**** Improve error handling on slices of arrays, bug226. [by Bryon Bradley]
|
||||
|
||||
**** Report errors when extra underscores used in meta-comments.
|
||||
|
||||
**** Fix "make install" with configure outside srcdir. [Stefan Wallentowitz]
|
||||
|
||||
**** Fix trace files with empty modules crashing some viewers.
|
||||
|
|
|
|||
|
|
@ -323,9 +323,11 @@ void V3PreProcImp::comment(const string& text) {
|
|||
if ((cp[0]=='v' || cp[0]=='V')
|
||||
&& 0==(strncmp(cp+1,"erilator",8))) {
|
||||
cp+=strlen("verilator");
|
||||
if (*cp == '_') fileline()->v3error("Extra underscore in meta-comment; use /*verilator {...}*/ not /*verilator_{...}*/");
|
||||
} else if (0==(strncmp(cp,"synopsys",strlen("synopsys")))) {
|
||||
cp+=strlen("synopsys");
|
||||
synth = true;
|
||||
if (*cp == '_') fileline()->v3error("Extra underscore in meta-comment; use /*synopsys {...}*/ not /*synopsys_{...}*/");
|
||||
} else if (0==(strncmp(cp,"cadence",strlen("cadence")))) {
|
||||
cp+=strlen("cadence");
|
||||
synth = true;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
#!/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.
|
||||
|
||||
$Self->{vlt} or $Self->skip("Verilator only test");
|
||||
|
||||
compile (
|
||||
verilator_flags2 => ["--lint-only"],
|
||||
fails=>1,
|
||||
expect=>
|
||||
'%Error: t/t_pp_underline_bad.v:\d+: Extra underscore in meta-comment.*
|
||||
%Error: Exiting due to.*',
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty, 2004 by Wilson Snyder.
|
||||
|
||||
module t;
|
||||
// verilator_no_inline_module
|
||||
initial $stop; // Should have failed
|
||||
endmodule
|
||||
Loading…
Reference in New Issue