Tests: Add t_udp_noname, bug468

This commit is contained in:
Wilson Snyder 2012-04-24 20:43:15 -04:00
parent 68046244dd
commit fb90e47e70
5 changed files with 73 additions and 1 deletions

View File

@ -65,6 +65,7 @@ struct V3ParseBisonYYSType {
AstBegin* beginp; AstBegin* beginp;
AstCase* casep; AstCase* casep;
AstCaseItem* caseitemp; AstCaseItem* caseitemp;
AstCell* cellp;
AstConst* constp; AstConst* constp;
AstNodeModule* modulep; AstNodeModule* modulep;
AstNodeDType* dtypep; AstNodeDType* dtypep;

View File

@ -1731,6 +1731,9 @@ instnameParen<nodep>:
id instRangeE '(' cellpinList ')' { $$ = new AstCell($<fl>1,*$1,GRAMMARP->m_instModule,$4, GRAMMARP->m_instParamp,$2); } id instRangeE '(' cellpinList ')' { $$ = new AstCell($<fl>1,*$1,GRAMMARP->m_instModule,$4, GRAMMARP->m_instParamp,$2); }
| id instRangeE { $$ = new AstCell($<fl>1,*$1,GRAMMARP->m_instModule,NULL,GRAMMARP->m_instParamp,$2); } | id instRangeE { $$ = new AstCell($<fl>1,*$1,GRAMMARP->m_instModule,NULL,GRAMMARP->m_instParamp,$2); }
//UNSUP instRangeE '(' cellpinList ')' { UNSUP } // UDP //UNSUP instRangeE '(' cellpinList ')' { UNSUP } // UDP
// // Adding above and switching to the Verilog-Perl syntax
// // causes a shift conflict due to use of idClassSel inside exprScope.
// // It also breaks allowing "id foo;" instantiation syntax.
; ;
instRangeE<rangep>: instRangeE<rangep>:

View File

@ -354,7 +354,8 @@ sub new {
vcs_run_flags => [split(/\s+/,"+vcs+lic_wait")], vcs_run_flags => [split(/\s+/,"+vcs+lic_wait")],
# NC # NC
nc => 0, nc => 0,
nc_flags => [split(/\s+/,"+licqueue +nowarn+LIBNOU +define+NC=1 -q +assert +sv -c ")], nc_flags => [split(/\s+/,("+licqueue +nowarn+LIBNOU +define+NC=1 -q +assert +sv -c "
.($opt_trace ? " +access+r":"")))],
nc_flags2 => [], # Overridden in some sim files nc_flags2 => [], # Overridden in some sim files
nc_run_flags => [split(/\s+/,"+licqueue -q +assert +sv -R")], nc_run_flags => [split(/\s+/,"+licqueue -q +assert +sv -R")],
# Verilator # Verilator

20
test_regress/t/t_udp_noname.pl Executable file
View 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.
$Self->{vlt} and $Self->unsupported("Verilator unsupported, bug468");
compile (
);
execute (
check_finished=>1,
);
ok(1);
1;

View File

@ -0,0 +1,47 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2012 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
reg a;
wire o;
udp (o, a);
integer cyc; initial cyc=0;
// Test loop
always @ (posedge clk) begin
cyc <= cyc + 1;
a <= cyc[0];
if (cyc==0) begin
end
else if (cyc<90) begin
if (a != !cyc[0]) $stop;
end
else if (cyc==99) begin
$write("*-* All Finished *-*\n");
$finish;
end
end
endmodule
primitive udp(o,a);
output o;
input a;
`ifdef verilator
wire o = ~a;
`else
table
//o a
0 : 1;
1 : 0;
endtable
`endif
endprimitive