diff options
| author | Tristan Gingold <tgingold@free.fr> | 2022-05-29 08:44:22 +0200 | 
|---|---|---|
| committer | Tristan Gingold <tgingold@free.fr> | 2022-05-29 08:44:22 +0200 | 
| commit | 91f74c1d54b9e5547e38fbbacb0f25fe3b22be3a (patch) | |
| tree | 6ee69a85d684d2177259dc2464e33b913094821f /src | |
| parent | 4542748c790c6e2b2606e6dbfe64bd0468c292b4 (diff) | |
| download | ghdl-91f74c1d54b9e5547e38fbbacb0f25fe3b22be3a.tar.gz ghdl-91f74c1d54b9e5547e38fbbacb0f25fe3b22be3a.tar.bz2 ghdl-91f74c1d54b9e5547e38fbbacb0f25fe3b22be3a.zip | |
synth-vhdl_oper: add hook for falling edge, handle aliases.
Diffstat (limited to 'src')
| -rw-r--r-- | src/synth/synth-vhdl_expr.adb | 11 | ||||
| -rw-r--r-- | src/synth/synth-vhdl_oper.adb | 4 | ||||
| -rw-r--r-- | src/synth/synth-vhdl_oper.ads | 1 | 
3 files changed, 13 insertions, 3 deletions
| diff --git a/src/synth/synth-vhdl_expr.adb b/src/synth/synth-vhdl_expr.adb index 6ec6e5e12..eee24353f 100644 --- a/src/synth/synth-vhdl_expr.adb +++ b/src/synth/synth-vhdl_expr.adb @@ -1867,8 +1867,10 @@ package body Synth.Vhdl_Expr is                   Get_Implicit_Definition (Imp);                 Edge : Net;              begin -               --  Match clock-edge -               if Def = Iir_Predefined_Boolean_And then +               --  Match clock-edge (only for synthesis) +               if Def = Iir_Predefined_Boolean_And +                 and then Hook_Signal_Expr = null +               then                    Edge := Synth_Clock_Edge (Syn_Inst,                                              Get_Left (Expr), Get_Right (Expr));                    if Edge /= No_Net then @@ -1938,7 +1940,10 @@ package body Synth.Vhdl_Expr is              begin                 Res := Synth_Name (Syn_Inst, Expr);                 if Res.Val /= null -                 and then Res.Val.Kind = Value_Signal +                 and then +                 (Res.Val.Kind = Value_Signal +                    or else (Res.Val.Kind = Value_Alias +                               and then Res.Val.A_Obj.Kind = Value_Signal))                 then                    if Hook_Signal_Expr /= null then                       return Hook_Signal_Expr (Res); diff --git a/src/synth/synth-vhdl_oper.adb b/src/synth/synth-vhdl_oper.adb index 6f6857418..4854f554a 100644 --- a/src/synth/synth-vhdl_oper.adb +++ b/src/synth/synth-vhdl_oper.adb @@ -1927,6 +1927,10 @@ package body Synth.Vhdl_Oper is                 return Create_Value_Net (Edge, Res_Typ);              end;           when Iir_Predefined_Ieee_1164_Falling_Edge => +            if Hook_Std_Falling_Edge /= null then +               return Create_Value_Memtyp +                 (Hook_Std_Falling_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 975244022..30d32820f 100644 --- a/src/synth/synth-vhdl_oper.ads +++ b/src/synth/synth-vhdl_oper.ads @@ -48,4 +48,5 @@ package Synth.Vhdl_Oper is       function (Param : Valtyp; Res_Typ : Type_Acc) return Memtyp;     Hook_Std_Rising_Edge : Eval_Predefined_Acc; +   Hook_Std_Falling_Edge : Eval_Predefined_Acc;  end Synth.Vhdl_Oper; | 
