Fix pin width mismatch error, bug595.
This commit is contained in:
parent
0286f588bf
commit
0437d0abea
3
Changes
3
Changes
|
|
@ -12,6 +12,9 @@ indicates the contributor was also the author of the fix; Thanks!
|
||||||
|
|
||||||
*** Support bind, to module names only, bug602. [Ed Lander]
|
*** Support bind, to module names only, bug602. [Ed Lander]
|
||||||
|
|
||||||
|
*** Fix pin width mismatch error, bug595. [Alex Solomatnikov]
|
||||||
|
|
||||||
|
|
||||||
* Verilator 3.844 2013/01/09
|
* Verilator 3.844 2013/01/09
|
||||||
|
|
||||||
*** Support "unsigned int" DPI import functions, msg966. [Alex Lee]
|
*** Support "unsigned int" DPI import functions, msg966. [Alex Lee]
|
||||||
|
|
|
||||||
|
|
@ -291,7 +291,6 @@ AstAssignW* V3Inst::pinReconnectSimple(AstPin* pinp, AstCell* cellp, AstNodeModu
|
||||||
pinp->exprp(new AstVarRef (pinexprp->fileline(), newvarp, true));
|
pinp->exprp(new AstVarRef (pinexprp->fileline(), newvarp, true));
|
||||||
} else {
|
} else {
|
||||||
// V3 width should have range/extended to make the widths correct
|
// V3 width should have range/extended to make the widths correct
|
||||||
if (pinexprp->width() != pinVarp->width()) pinp->v3fatalSrc("Input pin width mismatch");
|
|
||||||
assignp = new AstAssignW (pinp->fileline(),
|
assignp = new AstAssignW (pinp->fileline(),
|
||||||
new AstVarRef(pinp->fileline(), newvarp, true),
|
new AstVarRef(pinp->fileline(), newvarp, true),
|
||||||
pinexprp);
|
pinexprp);
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
// DESCRIPTION: Verilator: Verilog Test module
|
||||||
|
//
|
||||||
|
// This file ONLY is placed into the Public Domain, for any use,
|
||||||
|
// without warranty, 2013 by Alex Solomatnikov.
|
||||||
|
|
||||||
|
//bug595
|
||||||
|
|
||||||
|
module t (/*AUTOARG*/
|
||||||
|
// Inputs
|
||||||
|
clk
|
||||||
|
);
|
||||||
|
input clk;
|
||||||
|
|
||||||
|
logic [6-1:0] foo; initial foo = 20;
|
||||||
|
|
||||||
|
dut #(.W(6)) udut(.clk(clk),
|
||||||
|
.foo(foo-16));
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
module dut
|
||||||
|
#(parameter W = 1)
|
||||||
|
(input logic clk,
|
||||||
|
input logic [W-1:0] foo);
|
||||||
|
|
||||||
|
genvar i;
|
||||||
|
generate
|
||||||
|
for (i = 0; i < W; i++) begin
|
||||||
|
suba ua(.clk(clk), .foo(foo[i]));
|
||||||
|
end
|
||||||
|
endgenerate
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
module suba
|
||||||
|
(input logic clk,
|
||||||
|
input logic foo);
|
||||||
|
|
||||||
|
always @(posedge clk) begin
|
||||||
|
$write("*-* All Finished *-*\n");
|
||||||
|
$finish;
|
||||||
|
end
|
||||||
|
endmodule
|
||||||
Loading…
Reference in New Issue