diff options
-rw-r--r-- | src/synth/netlists-utils.adb | 6 | ||||
-rw-r--r-- | src/synth/netlists-utils.ads | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/synth/netlists-utils.adb b/src/synth/netlists-utils.adb index d5a1f2edd..7d9d71f5b 100644 --- a/src/synth/netlists-utils.adb +++ b/src/synth/netlists-utils.adb @@ -19,6 +19,7 @@ -- MA 02110-1301, USA. with Netlists.Gates; use Netlists.Gates; +with Mutils; package body Netlists.Utils is function Get_Nbr_Inputs (Inst : Instance) return Port_Nbr @@ -175,4 +176,9 @@ package body Netlists.Utils is -- Free Inst Free_Instance (Inst); end Disconnect_And_Free; + + function Clog2 (W : Width) return Width is + begin + return Uns32 (Mutils.Clog2 (Uns64 (W))); + end Clog2; end Netlists.Utils; diff --git a/src/synth/netlists-utils.ads b/src/synth/netlists-utils.ads index 1026bedc2..e8565c823 100644 --- a/src/synth/netlists-utils.ads +++ b/src/synth/netlists-utils.ads @@ -55,4 +55,6 @@ package Netlists.Utils is -- Disconnect input I. If the driver of I has no output(s) connected, -- disconnect and free it. procedure Disconnect_And_Free (I : Input); + + function Clog2 (W : Width) return Width; end Netlists.Utils; |