aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-utils.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-19 08:29:07 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-19 18:48:23 +0200
commit932a2beb675d155b1e71804d7e18f61e166d26bb (patch)
tree93f173cad8f4d4d41bdaaf0f9bad171a7c3ba502 /src/synth/netlists-utils.adb
parent51fb29f988e3d4d2cf2192fcc0f0a64d07f9d91e (diff)
downloadghdl-932a2beb675d155b1e71804d7e18f61e166d26bb.tar.gz
ghdl-932a2beb675d155b1e71804d7e18f61e166d26bb.tar.bz2
ghdl-932a2beb675d155b1e71804d7e18f61e166d26bb.zip
synth: add concatn gate
Diffstat (limited to 'src/synth/netlists-utils.adb')
-rw-r--r--src/synth/netlists-utils.adb21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/synth/netlists-utils.adb b/src/synth/netlists-utils.adb
index 1b8d08b1a..f04fafb2d 100644
--- a/src/synth/netlists-utils.adb
+++ b/src/synth/netlists-utils.adb
@@ -18,18 +18,23 @@
-- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-- MA 02110-1301, USA.
-with Netlists.Gates;
+with Netlists.Gates; use Netlists.Gates;
package body Netlists.Utils is
function Get_Nbr_Inputs (Inst : Instance) return Port_Nbr
is
M : constant Module := Get_Module (Inst);
begin
- if Is_Self_Instance (Inst) then
- return Get_Nbr_Outputs (M);
- else
- return Get_Nbr_Inputs (M);
- end if;
+ case Get_Id (M) is
+ when Id_Concatn =>
+ return Port_Nbr (Get_Param_Uns32 (Inst, 0));
+ when others =>
+ if Is_Self_Instance (Inst) then
+ return Get_Nbr_Outputs (M);
+ else
+ return Get_Nbr_Inputs (M);
+ end if;
+ end case;
end Get_Nbr_Inputs;
function Get_Nbr_Outputs (Inst : Instance) return Port_Nbr
@@ -76,9 +81,7 @@ package body Netlists.Utils is
return Get_Driver (Get_Input (Inst, Idx));
end Get_Input_Net;
- function Is_Const (Id : Module_Id) return Boolean
- is
- use Netlists.Gates;
+ function Is_Const (Id : Module_Id) return Boolean is
begin
case Id is
when Id_Const_UB32