mirror of
https://github.com/verilator/verilator.git
synced 2024-12-29 10:47:34 +00:00
Support optional cell parenthesis, bug179
This commit is contained in:
parent
4281690021
commit
376147911f
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@
|
||||
*.info
|
||||
*.log
|
||||
*.1
|
||||
.*.swp
|
||||
*.tmp
|
||||
*.tex
|
||||
/Makefile
|
||||
|
6
Changes
6
Changes
@ -14,11 +14,13 @@ indicates the contributor was also the author of the fix; Thanks!
|
||||
|
||||
*** Support "reg [1:0][1:0][1:0]" and "reg x [3][2]", bug176. [Byron Bradley]
|
||||
|
||||
*** Support declarations in loop initializers, bug172. [by Bryon Bradley]
|
||||
*** Support declarations in loop initializers, bug172. [by Byron Bradley]
|
||||
|
||||
*** Add VARHIDDEN warning when signal name hides module name.
|
||||
|
||||
**** Fix Verilator core dump on wide integer divides, bug178. [Bryon Bradley]
|
||||
**** Support optional cell parenthesis, bug179. [by Byron Bradley]
|
||||
|
||||
**** Fix Verilator core dump on wide integer divides, bug178. [Byron Bradley]
|
||||
|
||||
* Verilator 3.720 2009/10/26
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
\.tar\.
|
||||
.*\.tgz
|
||||
.*\.log
|
||||
\..*\.swp
|
||||
.*\.tmp
|
||||
.*\.tex
|
||||
.*\.key
|
||||
|
@ -22,8 +22,7 @@ Generally what would you do to add a new feature?
|
||||
|
||||
File a bug (if there isn't already) so others know what you're working on.
|
||||
|
||||
Make a testcase in the test_regress/t/t_EXAMPLE format, there's notes on
|
||||
this in the forum and in the verilator.txt manual.
|
||||
Make a testcase in the test_regress/t/t_EXAMPLE format, see TESTING Below.
|
||||
|
||||
If grammar changes are needed, look at the git version of VerilogPerl's
|
||||
src/VParseGrammar.y, as this grammar supports the full SystemVerilog
|
||||
@ -95,6 +94,13 @@ variable is an output.
|
||||
|
||||
=back
|
||||
|
||||
=head1 TESTING
|
||||
|
||||
To write a test see notes in the forum and in the verilator.txt manual.
|
||||
|
||||
Note you can run the regression tests in parallel; see the
|
||||
test_regress/driver.pl script -j flag.
|
||||
|
||||
=head1 VISITOR FUNCTIONS
|
||||
|
||||
=head2 Passing Variables
|
||||
|
@ -644,6 +644,9 @@ modFront<modulep>:
|
||||
parameter_value_assignmentE<pinp>: // IEEE: [ parameter_value_assignment ]
|
||||
/* empty */ { $$ = NULL; }
|
||||
| '#' '(' cellpinList ')' { $$ = $3; }
|
||||
// // Parentheses are optional around a single parameter
|
||||
| '#' yaINTNUM { $$ = new AstPin($1,1,"",new AstConst($1,*$2)); }
|
||||
| '#' idClassSel { $$ = new AstPin($1,1,"",$2); }
|
||||
// // Not needed in Verilator:
|
||||
// // Side effect of combining *_instantiations
|
||||
// // '#' delay_value { UNSUP }
|
||||
|
18
test_regress/t/t_param_no_parentheses.pl
Executable file
18
test_regress/t/t_param_no_parentheses.pl
Executable file
@ -0,0 +1,18 @@
|
||||
#!/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 (
|
||||
);
|
||||
|
||||
execute (
|
||||
check_finished=>1,
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
74
test_regress/t/t_param_no_parentheses.v
Normal file
74
test_regress/t/t_param_no_parentheses.v
Normal file
@ -0,0 +1,74 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty, 2003 by Wilson Snyder.
|
||||
//
|
||||
// This is a copy of t_param.v with the parentheses around the module parameters
|
||||
// removed.
|
||||
|
||||
module t (/*AUTOARG*/
|
||||
// Inputs
|
||||
clk
|
||||
);
|
||||
parameter PAR = 3;
|
||||
|
||||
m1 #PAR m1();
|
||||
m3 #PAR m3();
|
||||
mnooverride #10 mno();
|
||||
|
||||
input clk;
|
||||
integer cyc=1;
|
||||
reg [4:0] bitsel;
|
||||
|
||||
always @ (posedge clk) begin
|
||||
cyc <= cyc + 1;
|
||||
if (cyc==0) begin
|
||||
bitsel = 0;
|
||||
if (PAR[bitsel]!==1'b1) $stop;
|
||||
bitsel = 1;
|
||||
if (PAR[bitsel]!==1'b1) $stop;
|
||||
bitsel = 2;
|
||||
if (PAR[bitsel]!==1'b0) $stop;
|
||||
end
|
||||
if (cyc==1) begin
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
||||
module m1;
|
||||
localparam PAR1MINUS1 = PAR1DUP-2-1;
|
||||
localparam PAR1DUP = PAR1+2; // Check we propagate parameters properly
|
||||
parameter PAR1 = 0;
|
||||
m2 #PAR1MINUS1 m2 ();
|
||||
endmodule
|
||||
|
||||
module m2;
|
||||
parameter PAR2 = 10;
|
||||
initial begin
|
||||
$display("%x",PAR2);
|
||||
if (PAR2 !== 2) $stop;
|
||||
end
|
||||
endmodule
|
||||
|
||||
module m3;
|
||||
localparam LOC = 13;
|
||||
parameter PAR = 10;
|
||||
initial begin
|
||||
$display("%x %x",LOC,PAR);
|
||||
if (LOC !== 13) $stop;
|
||||
if (PAR !== 3) $stop;
|
||||
end
|
||||
endmodule
|
||||
|
||||
module mnooverride;
|
||||
localparam LOC = 13;
|
||||
parameter PAR = 10;
|
||||
initial begin
|
||||
$display("%x %x",LOC,PAR);
|
||||
if (LOC !== 13) $stop;
|
||||
if (PAR !== 10) $stop;
|
||||
end
|
||||
endmodule
|
Loading…
Reference in New Issue
Block a user