aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-10-13 04:01:58 +0200
committerTristan Gingold <tgingold@free.fr>2022-10-13 04:01:58 +0200
commit10a478df597403fc6c5c268cdaa6ea4ee916a5ef (patch)
treeacd477b6b9d20624b8da5690cedfd6420a685203 /src/synth
parent26d6de24d7f93a1dde14ac457d67e3258b946c94 (diff)
downloadghdl-10a478df597403fc6c5c268cdaa6ea4ee916a5ef.tar.gz
ghdl-10a478df597403fc6c5c268cdaa6ea4ee916a5ef.tar.bz2
ghdl-10a478df597403fc6c5c268cdaa6ea4ee916a5ef.zip
simul: handle last_event and last_active
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/synth-vhdl_expr.adb14
-rw-r--r--src/synth/synth-vhdl_expr.ads2
2 files changed, 16 insertions, 0 deletions
diff --git a/src/synth/synth-vhdl_expr.adb b/src/synth/synth-vhdl_expr.adb
index 33e5ab8ce..3d2d2f3f8 100644
--- a/src/synth/synth-vhdl_expr.adb
+++ b/src/synth/synth-vhdl_expr.adb
@@ -2425,6 +2425,20 @@ package body Synth.Vhdl_Expr is
Error_Msg_Synth (Syn_Inst, Expr,
"last_value attribute not allowed");
return No_Valtyp;
+ when Iir_Kind_Last_Event_Attribute =>
+ if Hook_Last_Event_Attribute /= null then
+ return Hook_Last_Event_Attribute (Syn_Inst, Expr);
+ end if;
+ Error_Msg_Synth (Syn_Inst, Expr,
+ "last_event attribute not allowed");
+ return No_Valtyp;
+ when Iir_Kind_Last_Active_Attribute =>
+ if Hook_Last_Active_Attribute /= null then
+ return Hook_Last_Active_Attribute (Syn_Inst, Expr);
+ end if;
+ Error_Msg_Synth (Syn_Inst, Expr,
+ "last_active attribute not allowed");
+ return No_Valtyp;
when Iir_Kind_Dot_Attribute =>
if Hook_Dot_Attribute /= null then
return Hook_Dot_Attribute (Syn_Inst, Expr);
diff --git a/src/synth/synth-vhdl_expr.ads b/src/synth/synth-vhdl_expr.ads
index 941bae57b..74412fe22 100644
--- a/src/synth/synth-vhdl_expr.ads
+++ b/src/synth/synth-vhdl_expr.ads
@@ -90,6 +90,8 @@ package Synth.Vhdl_Expr is
Hook_Event_Attribute : Hook_Attribute_Acc;
Hook_Active_Attribute : Hook_Attribute_Acc;
Hook_Last_Value_Attribute : Hook_Attribute_Acc;
+ Hook_Last_Event_Attribute : Hook_Attribute_Acc;
+ Hook_Last_Active_Attribute : Hook_Attribute_Acc;
Hook_Dot_Attribute : Hook_Attribute_Acc;
-- Use base type of EXPR to synthesize EXPR. Useful when the type of