From 818b00f30376d766c6d6cfcfc41a7dcc388a2cb9 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 2 Jul 2019 19:01:57 +0200 Subject: synth: fix Idff; fix 'edge and enable'. --- src/synth/netlists-builders.adb | 2 +- src/synth/synth-inference.adb | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/synth/netlists-builders.adb b/src/synth/netlists-builders.adb index 957ba565c..f52ac4f56 100644 --- a/src/synth/netlists-builders.adb +++ b/src/synth/netlists-builders.adb @@ -397,7 +397,7 @@ package body Netlists.Builders is Create_Monadic_Module (Design, Res.M_Extend (Id_Sextend), Get_Identifier ("sextend"), Id_Sextend); - Create_Edge_Module (Res, Res.M_Edge, Name_Posedge); + Create_Edge_Module (Res, Res.M_Edge, Name_Edge); Create_Mux_Modules (Res); Create_Objects_Module (Res); diff --git a/src/synth/synth-inference.adb b/src/synth/synth-inference.adb index cb7a0ee41..6e0ba1648 100644 --- a/src/synth/synth-inference.adb +++ b/src/synth/synth-inference.adb @@ -160,19 +160,16 @@ package body Synth.Inference is -- CLK and EXPR. -- FIXME: do it! declare - I0 : constant Input := Get_Input (Inst, 0); - I1 : Input; - Drv : Net; + I0 : constant Net := Get_Input_Net (Inst, 0); + Inst0 : constant Instance := Get_Net_Parent (I0); begin - Drv := Get_Driver (I0); - if Get_Id (Get_Net_Parent (Drv)) = Id_Edge then + if Get_Id (Inst0) = Id_Edge then -- INST is clearly not synthesizable (boolean operation on -- an edge). Will be removed at the end by -- remove_unused_instances. Do not remove it now as its -- output may be used by other nets. - Clk := Drv; - I1 := Get_Input (Inst, 1); - Enable := Get_Driver (I1); + Clk := Get_Input_Net (Inst0, 0); + Enable := Get_Input_Net (Inst, 1); end if; end; when others => -- cgit v1.2.3