diff options
author | tmeissner <programming@goodcleanfun.de> | 2020-06-06 17:45:51 +0200 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2020-06-07 06:17:12 +0200 |
commit | b85e83cd189e4e915ecd1a4ff00d1b81b919c215 (patch) | |
tree | 596eeed70dda1d0a526fa60f4610576104c9f24a /src/synth | |
parent | d440dae86de77d0743d21dfd8889dfa73d0dc48d (diff) | |
download | ghdl-b85e83cd189e4e915ecd1a4ff00d1b81b919c215.tar.gz ghdl-b85e83cd189e4e915ecd1a4ff00d1b81b919c215.tar.bz2 ghdl-b85e83cd189e4e915ecd1a4ff00d1b81b919c215.zip |
Synthesis of PSL built-in fell() function.
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-expr.adb | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 7c2dba7c5..efbf466a1 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -1882,7 +1882,7 @@ package body Synth.Expr is begin Expr := Synth_Expression (Syn_Inst, Get_Expression (Call)); - Clk_Net := Synth_Psl_Function_Clock(Syn_Inst, Call, Ctxt); + Clk_Net := Synth_Psl_Function_Clock (Syn_Inst, Call, Ctxt); if Count /= Null_Node then Count_Val := Synth_Expression (Syn_Inst, Count); @@ -1913,7 +1913,7 @@ package body Synth.Expr is begin Expr := Synth_Expression (Syn_Inst, Get_Expression (Call)); - Clk_Net := Synth_Psl_Function_Clock(Syn_Inst, Call, Ctxt); + Clk_Net := Synth_Psl_Function_Clock (Syn_Inst, Call, Ctxt); DffCurr := Get_Net (Ctxt, Expr); Set_Location (DffCurr, Call); @@ -1928,7 +1928,7 @@ package body Synth.Expr is end Synth_Psl_Stable; function Synth_Psl_Rose (Syn_Inst : Synth_Instance_Acc; Call : Node) - return Valtyp + return Valtyp is Ctxt : constant Context_Acc := Get_Build (Syn_Inst); DffCurr : Net; @@ -1940,7 +1940,7 @@ package body Synth.Expr is begin Expr := Synth_Expression (Syn_Inst, Get_Expression (Call)); - Clk_Net := Synth_Psl_Function_Clock(Syn_Inst, Call, Ctxt); + Clk_Net := Synth_Psl_Function_Clock (Syn_Inst, Call, Ctxt); DffCurr := Get_Net (Ctxt, Expr); Set_Location (DffCurr, Call); @@ -1958,6 +1958,36 @@ package body Synth.Expr is end Synth_Psl_Rose; + function Synth_Psl_Fell (Syn_Inst : Synth_Instance_Acc; Call : Node) + return Valtyp + is + Ctxt : constant Context_Acc := Get_Build (Syn_Inst); + DffCurr : Net; + NotDffCurr : Net; + Dff : 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); + + NotDffCurr := Build_Monadic (Ctxt, Id_Not, DffCurr); + Set_Location (NotDffCurr, Call); + + Res := Build_Dyadic (Ctxt, Id_And, Dff, NotDffCurr); + Set_Location (Res, Call); + + return Create_Value_Net (Res, Boolean_Type); + + end Synth_Psl_Fell; + subtype And_Or_Module_Id is Module_Id range Id_And .. Id_Or; function Synth_Short_Circuit (Syn_Inst : Synth_Instance_Acc; @@ -2302,6 +2332,8 @@ package body Synth.Expr is return Synth_Psl_Stable (Syn_Inst, Expr); when Iir_Kind_Psl_Rose => return Synth_Psl_Rose(Syn_Inst, Expr); + when Iir_Kind_Psl_Fell => + return Synth_Psl_Fell(Syn_Inst, Expr); when Iir_Kind_Overflow_Literal => Error_Msg_Synth (+Expr, "out of bound expression"); return No_Valtyp; |