diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-07-10 18:57:44 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-07-10 19:06:06 +0200 |
commit | 0ef59aec0acc050d09dc74c047aa224081c4eced (patch) | |
tree | 5e2adbc6a0c5eb7245f7b3f2b69a9ab1b790a557 /src/synth/netlists-builders.adb | |
parent | fef6c5f6fbec086f9b2a4bd73ccbcb346742ca0d (diff) | |
download | ghdl-0ef59aec0acc050d09dc74c047aa224081c4eced.tar.gz ghdl-0ef59aec0acc050d09dc74c047aa224081c4eced.tar.bz2 ghdl-0ef59aec0acc050d09dc74c047aa224081c4eced.zip |
synth: add Id_Port gate to improve display.
Diffstat (limited to 'src/synth/netlists-builders.adb')
-rw-r--r-- | src/synth/netlists-builders.adb | 24 |
1 files changed, 21 insertions, 3 deletions
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 |