aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-05-06 18:56:03 +0200
committerTristan Gingold <tgingold@free.fr>2021-05-06 18:56:03 +0200
commit09f3b6ad9c45d7882739f999cee3f036f4bd2d6a (patch)
treefd094fc4eb636a4da78d29c510dfe98deaadb403 /src/vhdl
parent3d152fe546003bf5089a2a3915a225d1d088a0bf (diff)
downloadghdl-09f3b6ad9c45d7882739f999cee3f036f4bd2d6a.tar.gz
ghdl-09f3b6ad9c45d7882739f999cee3f036f4bd2d6a.tar.bz2
ghdl-09f3b6ad9c45d7882739f999cee3f036f4bd2d6a.zip
vhdl-sem_stmts: handle aliases for force/release assignment. Fix #1751
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/vhdl-sem_stmts.adb13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vhdl/vhdl-sem_stmts.adb b/src/vhdl/vhdl-sem_stmts.adb
index b0b0447da..b52476f9b 100644
--- a/src/vhdl/vhdl-sem_stmts.adb
+++ b/src/vhdl/vhdl-sem_stmts.adb
@@ -879,6 +879,7 @@ package body Vhdl.Sem_Stmts is
Target : Iir;
Target_Type : Iir;
Target_Object : Iir;
+ Target_Prefix : Iir;
Expr : Iir;
Constrained : Boolean;
begin
@@ -894,6 +895,7 @@ package body Vhdl.Sem_Stmts is
Target := Sem_Expression_Wildcard (Target, Wildcard_Any_Type);
Target_Object := Null_Iir;
+ Target_Prefix := Null_Iir;
Target_Type := Wildcard_Any_Type;
if Target = Null_Iir then
-- To avoid spurious errors, assume the target is fully
@@ -905,21 +907,22 @@ package body Vhdl.Sem_Stmts is
Check_Target (Stmt, Target);
Target_Type := Get_Type (Target);
Target_Object := Check_Simple_Signal_Target_Object (Target);
+ Target_Prefix := Get_Object_Prefix (Target_Object);
Constrained := Is_Object_Name_Fully_Constrained (Target_Object);
else
Constrained := False;
end if;
end if;
- if Target_Object /= Null_Iir then
+ if Target_Prefix /= Null_Iir then
-- LRM08 10.5.2 Simple signal assignments
-- If the right-hand side of a simple force assignment or a simple
-- release assignment does not specify a force mode, then a default
-- force mode is used as follow:
if not Get_Has_Force_Mode (Stmt) then
- case Get_Kind (Target_Object) is
+ case Get_Kind (Target_Prefix) is
when Iir_Kind_Interface_Signal_Declaration =>
- case Get_Mode (Target_Object) is
+ case Get_Mode (Target_Prefix) is
when Iir_In_Mode =>
-- - If the target is a port or signal parameter of
-- mode IN, a force mode IN is used.
@@ -950,10 +953,10 @@ package body Vhdl.Sem_Stmts is
else
-- It is an error if a force mode of OUT is specified and the
-- target is a port of mode IN.
- case Get_Kind (Target_Object) is
+ case Get_Kind (Target_Prefix) is
when Iir_Kind_Interface_Signal_Declaration =>
if Get_Force_Mode (Stmt) = Iir_Force_Out
- and then Get_Mode (Target_Object) = Iir_In_Mode
+ and then Get_Mode (Target_Prefix) = Iir_In_Mode
then
Error_Msg_Sem
(+Stmt, "cannot use force OUT for IN port %n",