diff --git a/driver/iverilog.man.in b/driver/iverilog.man.in index a159df126..1a7625d2d 100644 --- a/driver/iverilog.man.in +++ b/driver/iverilog.man.in @@ -122,7 +122,8 @@ practice in the past to only specify the range for the net/register declaration and some tools still allow this. By default any mismatch is reported as a error. Using \fB\-gno\-io\-range\-error\fP will produce a warning instead of a fatal error for the case of a vectored net/register -and a scalar port declaration. +and a scalar port declaration. This warning is included in the +\fBanachronisms\fP category. .TP 8 .B -gstrict-ca-eval\fI|\fP-gno-strict-ca-eval The standard requires that if any input to a continuous assignment diff --git a/elab_sig.cc b/elab_sig.cc index 64b76ee67..68541f666 100644 --- a/elab_sig.cc +++ b/elab_sig.cc @@ -1080,17 +1080,17 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const dimensions_ok) { /* Scalar port with a vector net/etc. definition */ if (port_.empty()) { - if (!gn_io_range_error_flag) { - cerr << get_fileline() - << ": warning: Scalar port ``" << name_ - << "'' has a vectored net declaration " - << nlist << "." << endl; - } else { + if (gn_io_range_error_flag) { cerr << get_fileline() << ": error: Scalar port ``" << name_ << "'' has a vectored net declaration " << nlist << "." << endl; des->errors += 1; + } else if (warn_anachronisms) { + cerr << get_fileline() + << ": warning: Scalar port ``" << name_ + << "'' has a vectored net declaration " + << nlist << "." << endl; } } diff --git a/ivtest/gold/br_gh788.gold b/ivtest/gold/br_gh788.gold new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/ivtest/gold/br_gh788.gold @@ -0,0 +1 @@ +42 diff --git a/ivtest/ivltests/br_gh788.v b/ivtest/ivltests/br_gh788.v new file mode 100644 index 000000000..7468e547b --- /dev/null +++ b/ivtest/ivltests/br_gh788.v @@ -0,0 +1,18 @@ +module test(); + +task print_hex; + + input n; + + reg [7:0] n; + + begin + $display("%h", n); + end +endtask + +initial begin + print_hex(66); +end + +endmodule diff --git a/ivtest/regress-vlg.list b/ivtest/regress-vlg.list index 57f82c2e2..0466a4790 100644 --- a/ivtest/regress-vlg.list +++ b/ivtest/regress-vlg.list @@ -349,6 +349,7 @@ br_gh632b normal,-S ivltests br_gh632c normal ivltests br_gh674 normal ivltests br_gh732 normal ivltests gold=br_gh732.gold +br_gh788 normal,-gno-io-range-error,-Wno-anachronisms ivltests gold=br_gh788.gold br_gh793 normal ivltests br_ml20150315 normal ivltests gold=br_ml_20150315.gold br_ml20150321 CE ivltests