aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-06-28 18:31:10 +0200
committerTristan Gingold <tgingold@free.fr>2019-06-28 18:31:10 +0200
commit40c7b033a8e005503a5719901ac420bd39145a7b (patch)
tree5bd7c5b077516d4c4b17a8603c989219f9b49655 /src
parent1054c3731f64d58ff9eddc75b536c4a3d7e68057 (diff)
downloadghdl-40c7b033a8e005503a5719901ac420bd39145a7b.tar.gz
ghdl-40c7b033a8e005503a5719901ac420bd39145a7b.tar.bz2
ghdl-40c7b033a8e005503a5719901ac420bd39145a7b.zip
synth: Move get_input_net to netlists.utils.
Diffstat (limited to 'src')
-rw-r--r--src/synth/netlists-disp_vhdl.adb2
-rw-r--r--src/synth/netlists-utils.adb5
-rw-r--r--src/synth/netlists-utils.ads2
-rw-r--r--src/synth/netlists.adb5
-rw-r--r--src/synth/netlists.ads2
-rw-r--r--src/synth/synth-expr.adb1
6 files changed, 9 insertions, 8 deletions
diff --git a/src/synth/netlists-disp_vhdl.adb b/src/synth/netlists-disp_vhdl.adb
index a6919ae3a..b6dbf823b 100644
--- a/src/synth/netlists-disp_vhdl.adb
+++ b/src/synth/netlists-disp_vhdl.adb
@@ -20,7 +20,7 @@
with Ada.Text_IO; use Ada.Text_IO;
with Name_Table; use Name_Table;
--- with Netlists.Utils; use Netlists.Utils;
+with Netlists.Utils; use Netlists.Utils;
with Netlists.Iterators; use Netlists.Iterators;
with Netlists.Gates; use Netlists.Gates;
diff --git a/src/synth/netlists-utils.adb b/src/synth/netlists-utils.adb
index abd754d2d..0f33002d3 100644
--- a/src/synth/netlists-utils.adb
+++ b/src/synth/netlists-utils.adb
@@ -69,6 +69,11 @@ package body Netlists.Utils is
return Get_Output_Desc (M, I).Name;
end Get_Output_Name;
+ function Get_Input_Net (Inst : Instance; Idx : Port_Idx) return Net is
+ begin
+ return Get_Driver (Get_Input (Inst, Idx));
+ end Get_Input_Net;
+
function Is_Connected (O : Net) return Boolean is
begin
return Get_First_Sink (O) /= No_Input;
diff --git a/src/synth/netlists-utils.ads b/src/synth/netlists-utils.ads
index cdf474da2..493e27e92 100644
--- a/src/synth/netlists-utils.ads
+++ b/src/synth/netlists-utils.ads
@@ -31,6 +31,8 @@ package Netlists.Utils is
function Get_Input_Name (M : Module; I : Port_Idx) return Sname;
function Get_Output_Name (M : Module; I : Port_Idx) return Sname;
+ function Get_Input_Net (Inst : Instance; Idx : Port_Idx) return Net;
+
-- Return True iff O has at least one sink (ie is connected to at least one
-- input).
function Is_Connected (O : Net) return Boolean;
diff --git a/src/synth/netlists.adb b/src/synth/netlists.adb
index af1c149f2..6e84e2116 100644
--- a/src/synth/netlists.adb
+++ b/src/synth/netlists.adb
@@ -461,11 +461,6 @@ package body Netlists is
return Instances_Table.Table (Inst).First_Input + Input (Idx);
end Get_Input;
- function Get_Input_Net (Inst : Instance; Idx : Port_Idx) return Net is
- begin
- return Get_Driver (Get_Input (Inst, Idx));
- end Get_Input_Net;
-
-- Nets
function Is_Valid (N : Net) return Boolean is
diff --git a/src/synth/netlists.ads b/src/synth/netlists.ads
index a3c6cfe7c..f84f0c78e 100644
--- a/src/synth/netlists.ads
+++ b/src/synth/netlists.ads
@@ -235,8 +235,6 @@ package Netlists is
function Get_Param_Uns32 (Inst : Instance; Param : Param_Idx) return Uns32;
procedure Set_Param_Uns32 (Inst : Instance; Param : Param_Idx; Val : Uns32);
- function Get_Input_Net (Inst : Instance; Idx : Port_Idx) return Net;
-
-- Input
function Get_Input_Parent (I : Input) return Instance;
function Get_Parent (I : Input) return Instance renames Get_Input_Parent;
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index 6cfc2d8a6..cb2dc64b6 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -37,6 +37,7 @@ with Synth.Stmts;
with Netlists.Gates; use Netlists.Gates;
with Netlists.Builders; use Netlists.Builders;
+with Netlists.Utils; use Netlists.Utils;
package body Synth.Expr is
function Is_Const (Val : Value_Acc) return Boolean is