aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-expr.adb
diff options
context:
space:
mode:
authortmeissner <programming@goodcleanfun.de>2020-06-06 13:29:57 +0200
committertgingold <tgingold@users.noreply.github.com>2020-06-06 16:49:30 +0200
commit2416376cabc3dd03413a5038ce59ccfab569414c (patch)
treef36d87d5cbce058f8f1f36104582d07746c79c25 /src/synth/synth-expr.adb
parent350f710818732d7e3c2d1c56d50b503bf07ac024 (diff)
downloadghdl-2416376cabc3dd03413a5038ce59ccfab569414c.tar.gz
ghdl-2416376cabc3dd03413a5038ce59ccfab569414c.tar.bz2
ghdl-2416376cabc3dd03413a5038ce59ccfab569414c.zip
Synthesis of PSL built-in rose() function.
Diffstat (limited to 'src/synth/synth-expr.adb')
-rw-r--r--src/synth/synth-expr.adb33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index 6f8317831..7c2dba7c5 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -1927,6 +1927,37 @@ package body Synth.Expr is
end Synth_Psl_Stable;
+ function Synth_Psl_Rose (Syn_Inst : Synth_Instance_Acc; Call : Node)
+ return Valtyp
+ is
+ Ctxt : constant Context_Acc := Get_Build (Syn_Inst);
+ DffCurr : Net;
+ Dff : Net;
+ NotDff : Net;
+ Clk_Net : Net;
+ Expr : Valtyp;
+ Res : Net;
+ begin
+ Expr := Synth_Expression (Syn_Inst, Get_Expression (Call));
+
+ Clk_Net := Synth_Psl_Function_Clock(Syn_Inst, Call, Ctxt);
+
+ DffCurr := Get_Net (Ctxt, Expr);
+ Set_Location (DffCurr, Call);
+ Dff := Build_Dff (Ctxt, Clk_Net, DffCurr);
+ Set_Location (Dff, Call);
+
+ NotDff := Build_Monadic (Ctxt, Id_Not, Dff);
+ Set_Location (NotDff, Call);
+
+ Res := Build_Dyadic (Ctxt, Id_And,
+ NotDff, DffCurr);
+ Set_Location (Res, Call);
+
+ return Create_Value_Net (Res, Boolean_Type);
+
+ end Synth_Psl_Rose;
+
subtype And_Or_Module_Id is Module_Id range Id_And .. Id_Or;
function Synth_Short_Circuit (Syn_Inst : Synth_Instance_Acc;
@@ -2269,6 +2300,8 @@ package body Synth.Expr is
return Synth_Psl_Prev (Syn_Inst, Expr);
when Iir_Kind_Psl_Stable =>
return Synth_Psl_Stable (Syn_Inst, Expr);
+ when Iir_Kind_Psl_Rose =>
+ return Synth_Psl_Rose(Syn_Inst, Expr);
when Iir_Kind_Overflow_Literal =>
Error_Msg_Synth (+Expr, "out of bound expression");
return No_Valtyp;