aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-05-22 21:42:51 +0200
committerTristan Gingold <tgingold@free.fr>2022-05-23 06:44:12 +0200
commitbb384c6f0653a3d9494f694d5205b94b7c75899e (patch)
tree3afe82503e4ee46cd14b2b3cf67e8e512b3a8734
parentfb5f98c4f52fbab19facccaac30342f5303c94cb (diff)
downloadghdl-bb384c6f0653a3d9494f694d5205b94b7c75899e.tar.gz
ghdl-bb384c6f0653a3d9494f694d5205b94b7c75899e.tar.bz2
ghdl-bb384c6f0653a3d9494f694d5205b94b7c75899e.zip
synth-vhdl_oper: add an hook for rising_edge
-rw-r--r--src/synth/synth-vhdl_eval.adb8
-rw-r--r--src/synth/synth-vhdl_oper.adb4
-rw-r--r--src/synth/synth-vhdl_oper.ads5
3 files changed, 13 insertions, 4 deletions
diff --git a/src/synth/synth-vhdl_eval.adb b/src/synth/synth-vhdl_eval.adb
index 590ab9900..86502a549 100644
--- a/src/synth/synth-vhdl_eval.adb
+++ b/src/synth/synth-vhdl_eval.adb
@@ -1050,10 +1050,10 @@ package body Synth.Vhdl_Eval is
return Create_Memory_Fp64 (Atan (Read_Fp64 (Param1)), Res_Typ);
end;
when others =>
- Error_Msg_Synth
- (+Expr, "unhandled (static) function: "
- & Iir_Predefined_Functions'Image (Def));
- return Null_Memtyp;
+ null;
end case;
+ Error_Msg_Synth (+Expr, "unhandled (static) function: "
+ & Iir_Predefined_Functions'Image (Def));
+ return Null_Memtyp;
end Eval_Static_Predefined_Function_Call;
end Synth.Vhdl_Eval;
diff --git a/src/synth/synth-vhdl_oper.adb b/src/synth/synth-vhdl_oper.adb
index 9a0415a0e..6f6857418 100644
--- a/src/synth/synth-vhdl_oper.adb
+++ b/src/synth/synth-vhdl_oper.adb
@@ -1915,6 +1915,10 @@ package body Synth.Vhdl_Oper is
case Def is
when Iir_Predefined_Ieee_1164_Rising_Edge =>
+ if Hook_Std_Rising_Edge /= null then
+ return Create_Value_Memtyp
+ (Hook_Std_Rising_Edge.all (L, Res_Typ));
+ end if;
declare
Edge : Net;
begin
diff --git a/src/synth/synth-vhdl_oper.ads b/src/synth/synth-vhdl_oper.ads
index 3ae73df3d..975244022 100644
--- a/src/synth/synth-vhdl_oper.ads
+++ b/src/synth/synth-vhdl_oper.ads
@@ -43,4 +43,9 @@ package Synth.Vhdl_Oper is
(Syn_Inst : Synth_Instance_Acc; Atype : Iir; Len : Iir_Index32)
return Bound_Type;
+
+ type Eval_Predefined_Acc is access
+ function (Param : Valtyp; Res_Typ : Type_Acc) return Memtyp;
+
+ Hook_Std_Rising_Edge : Eval_Predefined_Acc;
end Synth.Vhdl_Oper;