aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-builders.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-15 19:04:11 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-15 19:04:11 +0200
commit1d5db1f18f4d6f61433f4b91961378df24e5949b (patch)
tree0cb3ccfd9d0ef8540a92044835c5a3a929180f37 /src/synth/netlists-builders.adb
parent51bab442d6ef8af394e5a5c33d63b2fe6b89af37 (diff)
downloadghdl-1d5db1f18f4d6f61433f4b91961378df24e5949b.tar.gz
ghdl-1d5db1f18f4d6f61433f4b91961378df24e5949b.tar.bz2
ghdl-1d5db1f18f4d6f61433f4b91961378df24e5949b.zip
synth: handle initialized inout port. For #1312
Diffstat (limited to 'src/synth/netlists-builders.adb')
-rw-r--r--src/synth/netlists-builders.adb21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/synth/netlists-builders.adb b/src/synth/netlists-builders.adb
index 85b2eece9..626debfa7 100644
--- a/src/synth/netlists-builders.adb
+++ b/src/synth/netlists-builders.adb
@@ -493,6 +493,12 @@ package body Netlists.Builders is
Outputs2 := (0 => Outputs (0),
1 => Create_Output ("oport"));
Set_Ports_Desc (Ctxt.M_Inout, Inputs2 (0 .. 0), Outputs2);
+
+ Ctxt.M_Iinout := New_User_Module
+ (Ctxt.Design,
+ New_Sname_Artificial (Get_Identifier("iinout"), No_Sname),
+ Id_Iinout, 2, 2, 0);
+ Set_Ports_Desc (Ctxt.M_Iinout, Inputs2 (0 .. 1), Outputs2);
end Create_Objects_Module;
procedure Create_Dff_Modules (Ctxt : Context_Acc)
@@ -1355,19 +1361,30 @@ package body Netlists.Builders is
return Build_Object (Ctxt, Ctxt.M_Output, W);
end Build_Output;
- function Build_Inout (Ctxt : Context_Acc; W : Width) return Instance
+ function Build_Inout_Object (Ctxt : Context_Acc; M : Module; W : Width)
+ return Instance
is
Inst : Instance;
O : Net;
begin
- Inst := New_Internal_Instance (Ctxt, Ctxt.M_Inout);
+ Inst := New_Internal_Instance (Ctxt, M);
O := Get_Output (Inst, 0);
Set_Width (O, W);
O := Get_Output (Inst, 1);
Set_Width (O, W);
return Inst;
+ end Build_Inout_Object;
+
+ function Build_Inout (Ctxt : Context_Acc; W : Width) return Instance is
+ begin
+ return Build_Inout_Object (Ctxt, Ctxt.M_Inout, W);
end Build_Inout;
+ function Build_Iinout (Ctxt : Context_Acc; W : Width) return Instance is
+ begin
+ return Build_Inout_Object (Ctxt, Ctxt.M_Iinout, W);
+ end Build_Iinout;
+
function Build_Ioutput (Ctxt : Context_Acc; Init : Net) return Net
is
Wd : constant Width := Get_Width (Init);