aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-sem_stmts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-12-29 18:47:20 +0100
committerTristan Gingold <tgingold@free.fr>2019-12-29 18:47:20 +0100
commit67557e4b9edfe08fc4dfabec790a8301e06762fd (patch)
tree94c6e41eb9698d2bdef08e316ea37f622ceb8970 /src/vhdl/vhdl-sem_stmts.adb
parent24cf373ab40a6bb9b0e9e76556670c1de3fe821d (diff)
downloadghdl-67557e4b9edfe08fc4dfabec790a8301e06762fd.tar.gz
ghdl-67557e4b9edfe08fc4dfabec790a8301e06762fd.tar.bz2
ghdl-67557e4b9edfe08fc4dfabec790a8301e06762fd.zip
vhdl-ams: fix overload for simple simultaneous statement.
Fix tree consistency for branch quantity declarations.
Diffstat (limited to 'src/vhdl/vhdl-sem_stmts.adb')
-rw-r--r--src/vhdl/vhdl-sem_stmts.adb20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/vhdl/vhdl-sem_stmts.adb b/src/vhdl/vhdl-sem_stmts.adb
index 4a420b3a1..e9b14a993 100644
--- a/src/vhdl/vhdl-sem_stmts.adb
+++ b/src/vhdl/vhdl-sem_stmts.adb
@@ -2112,9 +2112,6 @@ package body Vhdl.Sem_Stmts is
return;
end if;
- Set_Simultaneous_Left (Stmt, Left);
- Set_Simultaneous_Right (Stmt, Right);
-
Res_Type := Search_Compatible_Type (Get_Type (Left), Get_Type (Right));
if Res_Type = Null_Iir then
Error_Msg_Sem
@@ -2122,6 +2119,23 @@ package body Vhdl.Sem_Stmts is
return;
end if;
+ -- AMS-LRM17 11.10 Simple simultaneous statement
+ -- The base type of each simple expression shall be the same nature
+ -- type.
+ if not Sem_Types.Is_Nature_Type (Res_Type) then
+ Error_Msg_Sem (+Stmt, "type of expressions must be a float types");
+ end if;
+
+ if not Is_Expr_Fully_Analyzed (Left) then
+ Left := Sem_Expression_Ov (Left, Res_Type);
+ end if;
+ if not Is_Expr_Fully_Analyzed (Right) then
+ Right := Sem_Expression_Ov (Right, Res_Type);
+ end if;
+
+ Set_Simultaneous_Left (Stmt, Left);
+ Set_Simultaneous_Right (Stmt, Right);
+
-- FIXME: check for nature type...
end Sem_Simple_Simultaneous_Statement;