najaeda 0.2.4__cp312-cp312-macosx_11_0_arm64.whl → 0.2.5__cp312-cp312-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of najaeda might be problematic. Click here for more details.
- najaeda/libnaja_dnl.dylib +0 -0
- najaeda/libnaja_metrics.dylib +0 -0
- najaeda/libnaja_python.dylib +0 -0
- najaeda/naja.so +0 -0
- najaeda/netlist.py +58 -41
- najaeda/stats.py +6 -9
- {najaeda-0.2.4.dist-info → najaeda-0.2.5.dist-info}/METADATA +1 -1
- {najaeda-0.2.4.dist-info → najaeda-0.2.5.dist-info}/RECORD +11 -10
- {najaeda-0.2.4.dist-info → najaeda-0.2.5.dist-info}/WHEEL +0 -0
- {najaeda-0.2.4.dist-info → najaeda-0.2.5.dist-info}/licenses/AUTHORS +0 -0
- {najaeda-0.2.4.dist-info → najaeda-0.2.5.dist-info}/licenses/LICENSE +0 -0
najaeda/libnaja_dnl.dylib
CHANGED
|
Binary file
|
|
Binary file
|
najaeda/libnaja_python.dylib
CHANGED
|
Binary file
|
najaeda/naja.so
CHANGED
|
Binary file
|
najaeda/netlist.py
CHANGED
|
@@ -10,7 +10,7 @@ import struct
|
|
|
10
10
|
import sys
|
|
11
11
|
import os
|
|
12
12
|
from enum import Enum
|
|
13
|
-
from typing import Union, List
|
|
13
|
+
from typing import Union, List, Iterator
|
|
14
14
|
from dataclasses import dataclass
|
|
15
15
|
|
|
16
16
|
from najaeda import naja
|
|
@@ -561,7 +561,7 @@ class Term:
|
|
|
561
561
|
:return: True if the term is a sequential term.
|
|
562
562
|
:rtype: bool
|
|
563
563
|
"""
|
|
564
|
-
for term in self.get_instance().
|
|
564
|
+
for term in self.get_instance().get_bit_terms():
|
|
565
565
|
clockRelatedInputs = term.get_instance().get_clock_related_inputs(term)
|
|
566
566
|
if self in clockRelatedInputs:
|
|
567
567
|
return True
|
|
@@ -822,17 +822,7 @@ class Term:
|
|
|
822
822
|
|
|
823
823
|
|
|
824
824
|
def get_instance_by_path(names: list):
|
|
825
|
-
|
|
826
|
-
path = naja.SNLPath()
|
|
827
|
-
instance = None
|
|
828
|
-
top = naja.NLUniverse.get().getTopDesign()
|
|
829
|
-
design = top
|
|
830
|
-
for name in names:
|
|
831
|
-
path = naja.SNLPath(path, design.getInstance(name))
|
|
832
|
-
instance = design.getInstance(name)
|
|
833
|
-
assert instance is not None
|
|
834
|
-
design = instance.getModel()
|
|
835
|
-
return Instance(path)
|
|
825
|
+
return get_top().get_child_instance(names)
|
|
836
826
|
|
|
837
827
|
|
|
838
828
|
# def refresh_path(path: naja.SNLPath):
|
|
@@ -951,14 +941,13 @@ class Instance:
|
|
|
951
941
|
:return: True if this is the top design.
|
|
952
942
|
:rtype: bool
|
|
953
943
|
"""
|
|
954
|
-
return
|
|
944
|
+
return not self.pathIDs
|
|
955
945
|
|
|
956
946
|
def is_assign(self) -> bool:
|
|
957
947
|
"""(assign a=b) will create an instance of assign connecting
|
|
958
948
|
the wire a to the output of the assign and b to the input.
|
|
959
949
|
|
|
960
|
-
:return: True if this is an assign
|
|
961
|
-
unnamed Assign instances.
|
|
950
|
+
:return: True if this is an assign (represented by an unnamed assign instance).
|
|
962
951
|
:rtype: bool
|
|
963
952
|
"""
|
|
964
953
|
return self.__get_snl_model().isAssign()
|
|
@@ -1120,10 +1109,10 @@ class Instance:
|
|
|
1120
1109
|
"""
|
|
1121
1110
|
return sum(1 for _ in self.get_nets())
|
|
1122
1111
|
|
|
1123
|
-
def
|
|
1112
|
+
def get_bit_nets(self):
|
|
1124
1113
|
"""Iterate over all scalar nets and bus net bits.
|
|
1125
1114
|
|
|
1126
|
-
:return: an iterator over the
|
|
1115
|
+
:return: an iterator over the nets at bit level of this Instance.
|
|
1127
1116
|
:rtype: Iterator[Net]
|
|
1128
1117
|
"""
|
|
1129
1118
|
for net in self.__get_snl_model().getNets():
|
|
@@ -1133,13 +1122,13 @@ class Instance:
|
|
|
1133
1122
|
else:
|
|
1134
1123
|
yield Net(self.pathIDs, net)
|
|
1135
1124
|
|
|
1136
|
-
def
|
|
1125
|
+
def count_bit_nets(self) -> int:
|
|
1137
1126
|
"""Count the number of scalar nets and bus net bits of this Instance.
|
|
1138
1127
|
|
|
1139
|
-
:return: the number of
|
|
1128
|
+
:return: the number of bit nets of this Instance.
|
|
1140
1129
|
:rtype: int
|
|
1141
1130
|
"""
|
|
1142
|
-
return sum(1 for _ in self.
|
|
1131
|
+
return sum(1 for _ in self.get_bit_nets())
|
|
1143
1132
|
|
|
1144
1133
|
def get_net(self, name: str) -> Net:
|
|
1145
1134
|
"""
|
|
@@ -1183,22 +1172,22 @@ class Instance:
|
|
|
1183
1172
|
"""
|
|
1184
1173
|
return sum(1 for _ in self.get_terms())
|
|
1185
1174
|
|
|
1186
|
-
def
|
|
1175
|
+
def get_bit_terms(self):
|
|
1187
1176
|
"""Iterate over all scalar terms and bus term bits.
|
|
1188
1177
|
|
|
1189
|
-
:return: the
|
|
1178
|
+
:return: the bit terms of this Instance.
|
|
1190
1179
|
:rtype: Iterator[Term]
|
|
1191
1180
|
"""
|
|
1192
1181
|
for term in self.__get_snl_model().getBitTerms():
|
|
1193
1182
|
yield Term(self.pathIDs, term)
|
|
1194
1183
|
|
|
1195
|
-
def
|
|
1184
|
+
def count_bit_terms(self) -> int:
|
|
1196
1185
|
"""Count the number of scalar terms and bus term bits of this Instance.
|
|
1197
1186
|
|
|
1198
|
-
:return: the number of
|
|
1187
|
+
:return: the number of bit terms of this Instance.
|
|
1199
1188
|
:rtype: int
|
|
1200
1189
|
"""
|
|
1201
|
-
return sum(1 for _ in self.
|
|
1190
|
+
return sum(1 for _ in self.get_bit_terms())
|
|
1202
1191
|
|
|
1203
1192
|
def get_term(self, name: str) -> Term:
|
|
1204
1193
|
"""
|
|
@@ -1231,11 +1220,11 @@ class Instance:
|
|
|
1231
1220
|
"""
|
|
1232
1221
|
return sum(1 for _ in self.get_input_terms())
|
|
1233
1222
|
|
|
1234
|
-
def
|
|
1223
|
+
def get_input_bit_terms(self):
|
|
1235
1224
|
"""Iterate over all scalar input terms and bus input term bits
|
|
1236
1225
|
of this Instance.
|
|
1237
1226
|
|
|
1238
|
-
:return: the
|
|
1227
|
+
:return: the bit input terms of this Instance.
|
|
1239
1228
|
:rtype: Iterator[Term]
|
|
1240
1229
|
"""
|
|
1241
1230
|
for term in self.__get_snl_model().getTerms():
|
|
@@ -1246,14 +1235,14 @@ class Instance:
|
|
|
1246
1235
|
else:
|
|
1247
1236
|
yield Term(self.pathIDs, term)
|
|
1248
1237
|
|
|
1249
|
-
def
|
|
1238
|
+
def count_input_bit_terms(self) -> int:
|
|
1250
1239
|
"""Count the number of scalar input terms and bus input term bits
|
|
1251
1240
|
of this Instance.
|
|
1252
1241
|
|
|
1253
|
-
:return: the number of
|
|
1242
|
+
:return: the number of bit input terms of this Instance.
|
|
1254
1243
|
:rtype: int
|
|
1255
1244
|
"""
|
|
1256
|
-
return sum(1 for _ in self.
|
|
1245
|
+
return sum(1 for _ in self.get_input_bit_terms())
|
|
1257
1246
|
|
|
1258
1247
|
def get_output_terms(self):
|
|
1259
1248
|
"""Iterate over all scalar output terms and bus output terms
|
|
@@ -1275,11 +1264,11 @@ class Instance:
|
|
|
1275
1264
|
"""
|
|
1276
1265
|
return sum(1 for _ in self.get_output_terms())
|
|
1277
1266
|
|
|
1278
|
-
def
|
|
1267
|
+
def get_output_bit_terms(self):
|
|
1279
1268
|
"""Iterate over all scalar output terms and bus output term bits
|
|
1280
1269
|
of this Instance.
|
|
1281
1270
|
|
|
1282
|
-
:return: the
|
|
1271
|
+
:return: the bit output terms of this Instance.
|
|
1283
1272
|
:rtype: Iterator[Term]
|
|
1284
1273
|
"""
|
|
1285
1274
|
for term in self.__get_snl_model().getTerms():
|
|
@@ -1290,16 +1279,16 @@ class Instance:
|
|
|
1290
1279
|
else:
|
|
1291
1280
|
yield Term(self.pathIDs, term)
|
|
1292
1281
|
|
|
1293
|
-
def
|
|
1282
|
+
def count_output_bit_terms(self) -> int:
|
|
1294
1283
|
"""Count the number of scalar output terms and bus output term bits
|
|
1295
1284
|
of this Instance.
|
|
1296
1285
|
|
|
1297
|
-
:return: the number of
|
|
1286
|
+
:return: the number of bit output terms of this Instance.
|
|
1298
1287
|
:rtype: int
|
|
1299
1288
|
"""
|
|
1300
|
-
return sum(1 for _ in self.
|
|
1289
|
+
return sum(1 for _ in self.get_output_bit_terms())
|
|
1301
1290
|
|
|
1302
|
-
def get_attributes(self):
|
|
1291
|
+
def get_attributes(self) -> Iterator[Attribute]:
|
|
1303
1292
|
"""Iterate over the attributes of this Instance.
|
|
1304
1293
|
|
|
1305
1294
|
:return: the attributes of this Instance.
|
|
@@ -1341,7 +1330,7 @@ class Instance:
|
|
|
1341
1330
|
# Delete the last instance in uniq_path
|
|
1342
1331
|
self.__get_snl_model().getInstanceByID(id).destroy()
|
|
1343
1332
|
|
|
1344
|
-
def get_design(self):
|
|
1333
|
+
def get_design(self) -> "Instance":
|
|
1345
1334
|
"""
|
|
1346
1335
|
:return: the Instance containing this instance.
|
|
1347
1336
|
:rtype: Instance
|
|
@@ -1403,7 +1392,7 @@ class Instance:
|
|
|
1403
1392
|
model = self.__get_snl_model()
|
|
1404
1393
|
return model.getDB().getID(), model.getLibrary().getID(), model.getID()
|
|
1405
1394
|
|
|
1406
|
-
def create_child_instance(self, model: str, name: str):
|
|
1395
|
+
def create_child_instance(self, model: str, name: str) -> "Instance":
|
|
1407
1396
|
"""Create a child instance with the given model and name.
|
|
1408
1397
|
|
|
1409
1398
|
:param str model: the name of the model of the instance to create.
|
|
@@ -1524,7 +1513,7 @@ class Instance:
|
|
|
1524
1513
|
:rtype: Net
|
|
1525
1514
|
"""
|
|
1526
1515
|
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1527
|
-
if path.size()
|
|
1516
|
+
if path.size():
|
|
1528
1517
|
naja.SNLUniquifier(path)
|
|
1529
1518
|
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1530
1519
|
model = self.__get_snl_model()
|
|
@@ -1541,7 +1530,7 @@ class Instance:
|
|
|
1541
1530
|
:rtype: Net
|
|
1542
1531
|
"""
|
|
1543
1532
|
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1544
|
-
if path.size()
|
|
1533
|
+
if path.size():
|
|
1545
1534
|
naja.SNLUniquifier(path)
|
|
1546
1535
|
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1547
1536
|
model = self.__get_snl_model()
|
|
@@ -1840,3 +1829,31 @@ def apply_constant_propagation():
|
|
|
1840
1829
|
top = naja.NLUniverse.get().getTopDesign()
|
|
1841
1830
|
if top is not None:
|
|
1842
1831
|
naja.NLUniverse.get().applyConstantPropagation()
|
|
1832
|
+
|
|
1833
|
+
|
|
1834
|
+
def get_max_fanout() -> int:
|
|
1835
|
+
"""Get the maximum fanout of the top design.
|
|
1836
|
+
|
|
1837
|
+
:return: the maximum fanout of the top design.
|
|
1838
|
+
:rtype: int
|
|
1839
|
+
"""
|
|
1840
|
+
u = naja.NLUniverse.get()
|
|
1841
|
+
if u is not None:
|
|
1842
|
+
top = naja.NLUniverse.get().getTopDesign()
|
|
1843
|
+
if top is not None:
|
|
1844
|
+
return naja.NLUniverse.get().getMaxFanout()
|
|
1845
|
+
return 0
|
|
1846
|
+
|
|
1847
|
+
|
|
1848
|
+
def get_max_logic_level() -> int:
|
|
1849
|
+
"""Get the maximum logic level of the top design.
|
|
1850
|
+
|
|
1851
|
+
:return: the maximum logic level of the top design.
|
|
1852
|
+
:rtype: int
|
|
1853
|
+
"""
|
|
1854
|
+
u = naja.NLUniverse.get()
|
|
1855
|
+
if u is not None:
|
|
1856
|
+
top = naja.NLUniverse.get().getTopDesign()
|
|
1857
|
+
if top is not None:
|
|
1858
|
+
return naja.NLUniverse.get().getMaxLogicLevel()
|
|
1859
|
+
return 0
|
najaeda/stats.py
CHANGED
|
@@ -236,7 +236,7 @@ def compute_instance_terms(instance, instance_stats):
|
|
|
236
236
|
|
|
237
237
|
|
|
238
238
|
def compute_instance_net_stats(instance, instance_stats):
|
|
239
|
-
for net in instance.
|
|
239
|
+
for net in instance.get_bit_nets():
|
|
240
240
|
if net.is_const():
|
|
241
241
|
pass
|
|
242
242
|
nb_components = sum(1 for c in net.get_terms())
|
|
@@ -372,21 +372,18 @@ def convert_instance_stats_to_json(instance_stats):
|
|
|
372
372
|
return json_top
|
|
373
373
|
|
|
374
374
|
|
|
375
|
-
def dump_instance_stats_json(instance,
|
|
376
|
-
# stats_files = [(InstanceStats.ReportType.JSON, stats_file)]
|
|
377
|
-
# stats_file.write("[\n")
|
|
378
|
-
# dump_instance_stats(design, stats_files)
|
|
379
|
-
# stats_file.write("]")
|
|
375
|
+
def dump_instance_stats_json(instance, path: str):
|
|
380
376
|
instances_stats = InstancesStats()
|
|
381
377
|
compute_instance_stats(instance, instances_stats)
|
|
382
378
|
json_dict = convert_instance_stats_to_json(instances_stats)
|
|
383
|
-
|
|
379
|
+
with open(path, "w") as f:
|
|
380
|
+
json.dump(json_dict, f, indent=4)
|
|
384
381
|
|
|
385
382
|
|
|
386
|
-
def dump_instance_stats_text(instance,
|
|
383
|
+
def dump_instance_stats_text(instance, path: str):
|
|
387
384
|
instances_stats = InstancesStats()
|
|
388
385
|
compute_instance_stats(instance, instances_stats)
|
|
389
|
-
instances_stats.dump_instance_stats_text(instance,
|
|
386
|
+
instances_stats.dump_instance_stats_text(instance, path)
|
|
390
387
|
|
|
391
388
|
|
|
392
389
|
def dump_constants(design, analyzed_models):
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
najaeda-0.2.
|
|
2
|
-
najaeda-0.2.
|
|
3
|
-
najaeda-0.2.
|
|
4
|
-
najaeda-0.2.
|
|
5
|
-
najaeda-0.2.
|
|
6
|
-
najaeda/netlist.py,sha256=
|
|
1
|
+
najaeda-0.2.5.dist-info/RECORD,,
|
|
2
|
+
najaeda-0.2.5.dist-info/WHEEL,sha256=v7i1yNVEHWKlHHcCQ8SYkgpldhmAvPDAYWfI_XMFumo,114
|
|
3
|
+
najaeda-0.2.5.dist-info/METADATA,sha256=eiDQdwCVkgO-2dtr2b5a_8g5upb0uPXfpUICWWL4Apc,3435
|
|
4
|
+
najaeda-0.2.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
5
|
+
najaeda-0.2.5.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
|
|
6
|
+
najaeda/netlist.py,sha256=ZCFc5z7auEGAn2YURizMHnK0Twljug6vefuBCdxGopw,64298
|
|
7
7
|
najaeda/libnaja_nl.dylib,sha256=v773WRb6Pl9gpAtRNB8Z6YO0L0L1N121JPXRm9CjucI,757456
|
|
8
8
|
najaeda/pandas_stats.py,sha256=yOb4ka965U7rN4D6AwvSGmRyeT_O7Ed-5cmT8BFbfeo,1070
|
|
9
9
|
najaeda/_version.py,sha256=c-4hT20dyE-3BcdzOqR0vd92E7ydR5u2c-VmCc6oU8A,332
|
|
10
10
|
najaeda/__init__.py,sha256=6QrOzlqTfd558FH9Zm6ve54IzkHaDJ8ZO8hTCaEwsL8,218
|
|
11
|
-
najaeda/naja.so,sha256=
|
|
11
|
+
najaeda/naja.so,sha256=Hf_mYB3eVhsiB0Nb9xBOM7Yx6a5DNaRcA5O51r56-MU,99440
|
|
12
12
|
najaeda/net_visitor.py,sha256=P_esjibYb-wBDuF-AyF7es9sJYw1Ha8RhTPu-qKe7G4,1940
|
|
13
13
|
najaeda/libnaja_opt.dylib,sha256=wIG2H5rnxbqGrwLSgklJjZ5wjOkx2Shhu2RsnYQwmuE,212720
|
|
14
|
-
najaeda/libnaja_python.dylib,sha256=
|
|
15
|
-
najaeda/stats.py,sha256=
|
|
14
|
+
najaeda/libnaja_python.dylib,sha256=nQf5iO914R0wB_KU1CHktkIA5gS10v6HmGkwBkoAVgI,961840
|
|
15
|
+
najaeda/stats.py,sha256=g1F1CEBNVvGgzINOI7sK83123cCbclLDmyUjuep3-EU,16107
|
|
16
16
|
najaeda/instance_visitor.py,sha256=JMsPSQaWNiDjxS05rxg83a0PIsrOIuTi9G35hkwdibs,1530
|
|
17
17
|
najaeda/libnaja_bne.dylib,sha256=pLbGUnDr5PSGXbA8wKD-pqEyQIWHbiCb1icPpxRYrWE,136416
|
|
18
|
-
najaeda/
|
|
18
|
+
najaeda/libnaja_metrics.dylib,sha256=Nj1HCvjZR1q4PiWnwKiRHIJ0XFdhsX8XwSLNxXGrl0A,106864
|
|
19
|
+
najaeda/libnaja_dnl.dylib,sha256=tZdFzYkdrk3-MDGPPJoxwLmNjBH2_UhTCEOzueR43hE,148000
|
|
19
20
|
najaeda/native/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
21
|
najaeda/native/stats.py,sha256=t50hhE9pEFNtlssjES0A-K9TsO_2ZSUAb-e9L3Rt6yc,13063
|
|
21
22
|
najaeda/docs/requirements.txt,sha256=1XIBGTIplm2arC9HhDCfLuAjozGdVSXkqmOj8ybuT6U,121
|
|
File without changes
|
|
File without changes
|
|
File without changes
|