From cb5690c37d52124316603f868fb165d15a5e0c8c Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 6 May 2020 08:19:53 +0200 Subject: synth: add Id_Enable gate (for sequential assertions). --- src/synth/netlists-builders.adb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/synth/netlists-builders.adb') diff --git a/src/synth/netlists-builders.adb b/src/synth/netlists-builders.adb index bd8423dac..34ba4a3f1 100644 --- a/src/synth/netlists-builders.adb +++ b/src/synth/netlists-builders.adb @@ -470,6 +470,12 @@ package body Netlists.Builders is Id_Nop, 1, 1, 0); Set_Ports_Desc (Ctxt.M_Nop, Inputs2 (0 .. 0), Outputs); + Ctxt.M_Enable := New_User_Module + (Ctxt.Design, + New_Sname_Artificial (Get_Identifier ("enable"), No_Sname), + Id_Enable, 1, 1, 0); + Set_Ports_Desc (Ctxt.M_Enable, Inputs2 (0 .. 0), Outputs); + Ctxt.M_Inout := New_User_Module (Ctxt.Design, New_Sname_Artificial (Name_Inout, No_Sname), Id_Inout, 1, 2, 0); @@ -1398,6 +1404,17 @@ package body Netlists.Builders is return O; end Build_Nop; + function Build_Enable (Ctxt : Context_Acc) return Net + is + Inst : Instance; + O : Net; + begin + Inst := New_Internal_Instance (Ctxt, Ctxt.M_Enable); + O := Get_Output (Inst, 0); + Set_Width (O, 1); + return O; + end Build_Enable; + function Build_Dff (Ctxt : Context_Acc; Clk : Net; D : Net) return Net -- cgit v1.2.3