aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-10-15 07:32:28 +0200
committerTristan Gingold <tgingold@free.fr>2017-10-15 07:32:28 +0200
commit4857f0d5500de52fd73ec6f64f7a01d4d774c74c (patch)
treed7358a562f1c48fbeac1a825ac5942aaeed12fd9 /src/vhdl
parent7df3bfb26d601d12f94285eecb99dd8af2c1d58e (diff)
downloadghdl-4857f0d5500de52fd73ec6f64f7a01d4d774c74c.tar.gz
ghdl-4857f0d5500de52fd73ec6f64f7a01d4d774c74c.tar.bz2
ghdl-4857f0d5500de52fd73ec6f64f7a01d4d774c74c.zip
Allow unbounded IN ports with relaxed rules.
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/configuration.adb9
-rw-r--r--src/vhdl/errorout.adb8
-rw-r--r--src/vhdl/errorout.ads15
3 files changed, 25 insertions, 7 deletions
diff --git a/src/vhdl/configuration.adb b/src/vhdl/configuration.adb
index a0fc0bb7a..7a1ccfc7e 100644
--- a/src/vhdl/configuration.adb
+++ b/src/vhdl/configuration.adb
@@ -375,12 +375,15 @@ package body Configuration is
begin
case Get_Mode (Port) is
when Iir_In_Mode =>
- -- LRM 1.1.1.2 Ports
+ -- LRM93 1.1.1.2 Ports
-- A port of mode IN may be unconnected or unassociated only if
-- its declaration includes a default expression.
if Get_Default_Value (Port) = Null_Iir then
if Loc /= Null_Iir then
- Error_Msg_Elab (Loc, "IN %n must be connected", +Port);
+ Error_Msg_Elab_Relaxed
+ (Loc, Warnid_Port,
+ "IN %n must be connected (or have a default value)",
+ (1 => +Port));
end if;
return True;
end if;
@@ -388,7 +391,7 @@ package body Configuration is
| Iir_Inout_Mode
| Iir_Buffer_Mode
| Iir_Linkage_Mode =>
- -- LRM 1.1.1.2 Ports
+ -- LRM93 1.1.1.2 Ports
-- A port of any mode other than IN may be unconnected or
-- unassociated as long as its type is not an unconstrained array
-- type.
diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb
index 55c367f85..2120332ba 100644
--- a/src/vhdl/errorout.adb
+++ b/src/vhdl/errorout.adb
@@ -763,6 +763,14 @@ package body Errorout is
Error_Msg_Elab (Loc, Msg, Earg_Arr'(1 => Arg1));
end Error_Msg_Elab;
+ procedure Error_Msg_Elab_Relaxed (Loc : Iir;
+ Id : Msgid_Warnings;
+ Msg : String;
+ Args : Earg_Arr := No_Eargs) is
+ begin
+ Error_Msg_Relaxed (Elaboration, Id, Msg, Loc, Args);
+ end Error_Msg_Elab_Relaxed;
+
-- Disp a bug message.
procedure Error_Internal (Expr: in Iir; Msg: String := "")
is
diff --git a/src/vhdl/errorout.ads b/src/vhdl/errorout.ads
index 09260a876..5d34759e0 100644
--- a/src/vhdl/errorout.ads
+++ b/src/vhdl/errorout.ads
@@ -59,6 +59,9 @@ package Errorout is
-- Unbound component.
Warnid_Binding,
+ -- Unconnected IN port without defaults (in relaxed mode).
+ Warnid_Port,
+
-- Vhdl93 reserved word is used as a vhdl87 identifier.
Warnid_Reserved_Word,
@@ -240,6 +243,12 @@ package Errorout is
procedure Error_Msg_Elab
(Loc: Iir; Msg: String; Arg1 : Earg_Type);
+ -- Like Error_Msg_Elab, but a warning if -frelaxed or --std=93c.
+ procedure Error_Msg_Elab_Relaxed (Loc : Iir;
+ Id : Msgid_Warnings;
+ Msg : String;
+ Args : Earg_Arr := No_Eargs);
+
-- Disp a warning durig elaboration (or configuration).
procedure Warning_Msg_Elab (Id : Msgid_Warnings;
Loc : Iir;
@@ -328,9 +337,7 @@ private
type Warnings_Setting is array (Msgid_Warnings) of Warning_Control_Type;
Default_Warnings : constant Warnings_Setting :=
- (Warnid_Binding
- | Warnid_Library => (Enabled => True, Error => False),
- Warnid_Shared
- | Warnid_Pure => (Enabled => True, Error => False),
+ (Warnid_Binding | Warnid_Library | Warnid_Shared | Warnid_Pure
+ | Warnid_Port => (Enabled => True, Error => False),
others => (Enabled => False, Error => False));
end Errorout;