aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/trans-chap9.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-08-04 04:06:48 +0200
committerTristan Gingold <tgingold@free.fr>2022-08-04 04:06:48 +0200
commit707804d47fa5280e3c096b9b512a629e69007697 (patch)
tree6692c6cf354ab8b4aaa39cb52a32aa6b686b3056 /src/vhdl/translate/trans-chap9.adb
parentd7bc4dcf7d2fcfa848d61f7f2560fd32f510ce0d (diff)
downloadghdl-707804d47fa5280e3c096b9b512a629e69007697.tar.gz
ghdl-707804d47fa5280e3c096b9b512a629e69007697.tar.bz2
ghdl-707804d47fa5280e3c096b9b512a629e69007697.zip
trans-chap9.adb: destroy types in PSL expressions. For #2157
Diffstat (limited to 'src/vhdl/translate/trans-chap9.adb')
-rw-r--r--src/vhdl/translate/trans-chap9.adb34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/vhdl/translate/trans-chap9.adb b/src/vhdl/translate/trans-chap9.adb
index fef616ce1..469dc6c20 100644
--- a/src/vhdl/translate/trans-chap9.adb
+++ b/src/vhdl/translate/trans-chap9.adb
@@ -49,6 +49,8 @@ with Trans.Foreach_Non_Composite;
package body Trans.Chap9 is
use Trans.Helpers;
+ procedure Destroy_Types (N : PSL_Node);
+
procedure Set_Direct_Drivers (Proc : Iir)
is
Proc_Info : constant Proc_Info_Acc := Get_Info (Proc);
@@ -754,6 +756,8 @@ package body Trans.Chap9 is
end if;
Finish_If_Stmt (E_Blk);
+ Destroy_Types (Get_Edge_Expr (E));
+
Close_Temp;
E := Get_Next_Src_Edge (E);
end loop;
@@ -1524,9 +1528,9 @@ package body Trans.Chap9 is
raise Internal_Error;
end case;
when Type_PSL_NFA
- | Type_PSL_Node =>
- -- TODO
- raise Internal_Error;
+ | Type_PSL_Node =>
+ -- For endpoint in PSL HDL_Expr.
+ null;
when Type_Date_Type
| Type_Date_State_Type
| Type_Time_Stamp_Id
@@ -1561,6 +1565,30 @@ package body Trans.Chap9 is
end;
end Destroy_Types;
+ procedure Destroy_Types (N : PSL_Node)
+ is
+ use PSL.Nodes;
+ begin
+ case Get_Kind (N) is
+ when N_HDL_Bool
+ | N_HDL_Expr =>
+ Destroy_Types (Get_HDL_Node (N));
+ when N_True =>
+ null;
+ when N_EOS =>
+ null;
+ when N_Not_Bool =>
+ Destroy_Types (Get_Boolean (N));
+ when N_And_Bool
+ | N_Or_Bool
+ | N_Imp_Bool =>
+ Destroy_Types (Get_Left (N));
+ Destroy_Types (Get_Right (N));
+ when others =>
+ Error_Kind ("destroy_types(psl)", N);
+ end case;
+ end Destroy_Types;
+
function Foreach_Non_Composite_Prepare_Data_Array_Mnode
(Targ : Mnode; Targ_Type : Iir; Val : Mnode) return Mnode
is