Fix internal error on "output x; reg x = y;"

This commit is contained in:
Wilson Snyder 2008-12-30 14:34:01 -05:00
parent cc31ab84d7
commit 1a60723d77
6 changed files with 48 additions and 2 deletions

View File

@ -35,6 +35,8 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix compile error on Ubuntu 8.10. [Christopher Boumenot]
**** Fix internal error on "output x; reg x = y;".
* Verilator 3.681 2008/11/12
*** Add SystemVerilog unique and priority case.

View File

@ -764,7 +764,7 @@ sigIdRange<varp>:
regSigId<varp>:
yaID rangeListE { $$ = V3Parse::createVariable(CRELINE(), *$1, $2); }
| yaID rangeListE '=' constExpr { $$ = V3Parse::createVariable(CRELINE(), *$1, $2);
$$->addNext(new AstInitial($3,new AstAssign($3, new AstVarRef($3, $$, true), $4))); }
$$->addNext(new AstInitial($3,new AstAssign($3, new AstVarRef($3, *$1, true), $4))); }
;
sigId<varp>: yaID { $$ = V3Parse::createVariable(CRELINE(), *$1, NULL); }

View File

@ -430,7 +430,8 @@ sub compile {
"make", "-f".getcwd()."/Makefile_obj",
"VM_PREFIX=$self->{VM_PREFIX}",
($param{make_main}?"":"MAKE_MAIN=0"),
"$self->{VM_PREFIX}", # not default, as we don't need archive
($param{benchmark}?"OPT_FAST=-O2":""),
"$self->{VM_PREFIX}", # bypass default rule, as we don't need archive
($param{make_flags}||""),
]);
}

View File

@ -54,6 +54,7 @@ module t (/*AUTOARG*/
if (cyc==0) begin
// Setup
crc <= 64'h5aef0c8d_d70a4497;
sum <= 64'h0;
end
else if (cyc<10) begin
sum <= 64'h0;

View File

@ -0,0 +1,17 @@
#!/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
# General Public License or the Perl Artistic License.
compile (
);
execute (
check_finished=>1,
);
ok(1);
1;

View File

@ -0,0 +1,25 @@
// DESCRIPTION: Verilator: Verilog Test module
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2008 by Wilson Snyder.
module t (/*AUTOARG*/
// Outputs
state,
// Inputs
clk
);
input clk;
// Gave "Internal Error: V3Broken.cpp:: Broken link in node"
output [1:0] state;
reg [1:0] state = 2'b11;
always @ (posedge clk) begin
state <= state;
end
initial begin
$write("*-* All Finished *-*\n");
$finish;
end
endmodule