From 0ef59aec0acc050d09dc74c047aa224081c4eced Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 10 Jul 2019 18:57:44 +0200 Subject: synth: add Id_Port gate to improve display. --- src/synth/netlists-builders.adb | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/synth/netlists-builders.adb') diff --git a/src/synth/netlists-builders.adb b/src/synth/netlists-builders.adb index 8d6534b42..27364f109 100644 --- a/src/synth/netlists-builders.adb +++ b/src/synth/netlists-builders.adb @@ -272,22 +272,26 @@ package body Netlists.Builders is Outputs := (0 => Create_Output ("o")); Ctxt.M_Output := New_User_Module - (Ctxt.Design, New_Sname_Artificial (Get_Identifier ("output")), + (Ctxt.Design, New_Sname_Artificial (Name_Output), Id_Output, 1, 1, 0); Set_Port_Desc (Ctxt.M_Output, Inputs, Outputs); Ctxt.M_Signal := New_User_Module - (Ctxt.Design, New_Sname_Artificial (Get_Identifier ("signal")), + (Ctxt.Design, New_Sname_Artificial (Name_Signal), Id_Signal, 1, 1, 0); Set_Port_Desc (Ctxt.M_Signal, Inputs, Outputs); - Inputs2 := (0 => Create_Input ("i"), 1 => Create_Input ("init")); Ctxt.M_Isignal := New_User_Module (Ctxt.Design, New_Sname_Artificial (Get_Identifier ("isignal")), Id_Isignal, 2, 1, 0); Set_Port_Desc (Ctxt.M_Isignal, Inputs2, Outputs); + + Ctxt.M_Port := New_User_Module + (Ctxt.Design, New_Sname_Artificial (Name_Port), + Id_Port, 1, 1, 0); + Set_Port_Desc (Ctxt.M_Port, Inputs, Outputs); end Create_Objects_Module; procedure Create_Dff_Modules (Ctxt : Context_Acc) @@ -763,6 +767,20 @@ package body Netlists.Builders is return O; end Build_Isignal; + function Build_Port (Ctxt : Context_Acc; N : Net) return Net + is + Wd : constant Width := Get_Width (N); + pragma Assert (Wd /= No_Width); + Inst : Instance; + O : Net; + begin + Inst := New_Internal_Instance (Ctxt, Ctxt.M_Port); + O := Get_Output (Inst, 0); + Set_Width (O, Wd); + Connect (Get_Input (Inst, 0), N); + return O; + end Build_Port; + function Build_Dff (Ctxt : Context_Acc; Clk : Net; D : Net) return Net -- cgit v1.2.3