aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-builders.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-05-22 06:33:58 +0200
committerTristan Gingold <tgingold@free.fr>2019-05-22 06:43:33 +0200
commit1f63ad0215f932c3776057e14946e2d3202c5779 (patch)
treea03caf53f0ee1981ded7c2ee39d25d2093fc8eaa /src/synth/netlists-builders.adb
parent0611b41484571bb92e8a87b39fdfa4d45fe65d83 (diff)
downloadghdl-1f63ad0215f932c3776057e14946e2d3202c5779.tar.gz
ghdl-1f63ad0215f932c3776057e14946e2d3202c5779.tar.bz2
ghdl-1f63ad0215f932c3776057e14946e2d3202c5779.zip
synth: use only one edge gate, make it fully abstract. Handle falling_edge.
Diffstat (limited to 'src/synth/netlists-builders.adb')
-rw-r--r--src/synth/netlists-builders.adb20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/synth/netlists-builders.adb b/src/synth/netlists-builders.adb
index d131db121..8b239573f 100644
--- a/src/synth/netlists-builders.adb
+++ b/src/synth/netlists-builders.adb
@@ -163,15 +163,14 @@ package body Netlists.Builders is
procedure Create_Edge_Module (Ctxt : Context_Acc;
Res : out Module;
- Name : Name_Id;
- Id : Module_Id)
+ Name : Name_Id)
is
Outputs : Port_Desc_Array (0 .. 0);
Inputs : Port_Desc_Array (0 .. 0);
begin
Res := New_User_Module
- (Ctxt.Design, New_Sname_Artificial (Name), Id, 1, 1, 0);
+ (Ctxt.Design, New_Sname_Artificial (Name), Id_Edge, 1, 1, 0);
Inputs := (0 => Create_Input ("i", 1));
Outputs := (0 => Create_Output ("o", 1));
Set_Port_Desc (Res, Inputs, Outputs);
@@ -325,8 +324,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_Posedge, Name_Posedge, Id_Posedge);
- Create_Edge_Module (Res, Res.M_Negedge, Name_Negedge, Id_Negedge);
+ Create_Edge_Module (Res, Res.M_Edge, Name_Posedge);
Create_Mux_Modules (Res);
Create_Objects_Module (Res);
@@ -432,21 +430,13 @@ package body Netlists.Builders is
return O;
end Build_Const_UL32;
- function Build_Edge (Ctxt : Context_Acc;
- Is_Pos : Boolean;
- Src : Net) return Net
+ function Build_Edge (Ctxt : Context_Acc; Src : Net) return Net
is
pragma Assert (Get_Width (Src) = 1);
- M : Module;
Inst : Instance;
O : Net;
begin
- if Is_Pos then
- M := Ctxt.M_Posedge;
- else
- M := Ctxt.M_Negedge;
- end if;
- Inst := New_Internal_Instance (Ctxt, M);
+ Inst := New_Internal_Instance (Ctxt, Ctxt.M_Edge);
O := Get_Output (Inst, 0);
pragma Assert (Get_Width (O) = 1);
Connect (Get_Input (Inst, 0), Src);