najaeda 0.2.2__cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.2.3__cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.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/__init__.py +8 -0
- najaeda/_version.py +16 -0
- najaeda/docs/source/instance.rst +15 -0
- najaeda/libnaja_dnl.so +0 -0
- najaeda/libnaja_nl.so +0 -0
- najaeda/libnaja_python.so +0 -0
- najaeda/naja.so +0 -0
- najaeda/netlist.py +66 -7
- {najaeda-0.2.2.dist-info → najaeda-0.2.3.dist-info}/METADATA +1 -1
- {najaeda-0.2.2.dist-info → najaeda-0.2.3.dist-info}/RECORD +13 -12
- {najaeda-0.2.2.dist-info → najaeda-0.2.3.dist-info}/WHEEL +0 -0
- {najaeda-0.2.2.dist-info → najaeda-0.2.3.dist-info}/licenses/AUTHORS +0 -0
- {najaeda-0.2.2.dist-info → najaeda-0.2.3.dist-info}/licenses/LICENSE +0 -0
najaeda/__init__.py
CHANGED
najaeda/_version.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025 The Naja authors
|
|
2
|
+
# <https://github.com/najaeda/naja/blob/main/AUTHORS>
|
|
3
|
+
#
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
from najaeda import naja
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def version():
|
|
10
|
+
"""Get the version of Naja."""
|
|
11
|
+
return naja.getVersion()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def git_hash():
|
|
15
|
+
"""Get the git hash of Naja."""
|
|
16
|
+
return naja.getGitHash()
|
najaeda/docs/source/instance.rst
CHANGED
|
@@ -10,6 +10,21 @@ of an instance in its hierarchical context.
|
|
|
10
10
|
When an **Instance** is modified through editing methods,
|
|
11
11
|
**najaeda** will automatically manage the necessary uniquification.
|
|
12
12
|
|
|
13
|
+
Generic Gates (and, or, etc.)
|
|
14
|
+
-----------------------------
|
|
15
|
+
|
|
16
|
+
**najaeda** supports **generic gates** as defined in Verilog, specifically:
|
|
17
|
+
|
|
18
|
+
- **n-input gates**: `and`, `nand`, `or`, `nor`, `xor`, `xnor`
|
|
19
|
+
- **n-output gates**: `buf`, `not`
|
|
20
|
+
|
|
21
|
+
In this model:
|
|
22
|
+
|
|
23
|
+
- **n-input gates** have a **single scalar output** and a **bus input terminal** (of size *n*).
|
|
24
|
+
- **n-output gates** have a **scalar input** and a **bus output terminal** (of size *n*).
|
|
25
|
+
|
|
26
|
+
All terminals in these generic instances are **unnamed**,
|
|
27
|
+
|
|
13
28
|
Instance Attributes
|
|
14
29
|
-------------------
|
|
15
30
|
|
najaeda/libnaja_dnl.so
CHANGED
|
Binary file
|
najaeda/libnaja_nl.so
CHANGED
|
Binary file
|
najaeda/libnaja_python.so
CHANGED
|
Binary file
|
najaeda/naja.so
CHANGED
|
Binary file
|
najaeda/netlist.py
CHANGED
|
@@ -207,14 +207,15 @@ class Net:
|
|
|
207
207
|
return not eq_result
|
|
208
208
|
|
|
209
209
|
def __str__(self):
|
|
210
|
-
if
|
|
211
|
-
net_str = str(self.net)
|
|
212
|
-
elif hasattr(self, "net_concat"):
|
|
210
|
+
if self.is_concat():
|
|
213
211
|
net_str = "{" + ",".join(map(str, self.net_concat)) + "}"
|
|
212
|
+
return net_str
|
|
213
|
+
net_str = str(self.net)
|
|
214
214
|
path = get_snl_path_from_id_list(self.pathIDs)
|
|
215
215
|
if path.size() > 0:
|
|
216
216
|
return f"{path}/{net_str}"
|
|
217
|
-
|
|
217
|
+
else:
|
|
218
|
+
return net_str
|
|
218
219
|
|
|
219
220
|
def get_name(self) -> str:
|
|
220
221
|
"""
|
|
@@ -225,6 +226,23 @@ class Net:
|
|
|
225
226
|
return self.net.getName()
|
|
226
227
|
return "{" + ",".join(map(str, self.net_concat)) + "}"
|
|
227
228
|
|
|
229
|
+
def set_name(self, name: str):
|
|
230
|
+
"""
|
|
231
|
+
:param str name: the name to set for this Net.
|
|
232
|
+
"""
|
|
233
|
+
if self.is_concat():
|
|
234
|
+
raise ValueError(
|
|
235
|
+
f"set_name of {self}: cannot set name for a concatenated net. "
|
|
236
|
+
"Use the individual nets instead."
|
|
237
|
+
)
|
|
238
|
+
elif self.is_bus_bit():
|
|
239
|
+
raise ValueError(
|
|
240
|
+
f"set_name of {self}: cannot set name for a bus bit. "
|
|
241
|
+
"Use the bus net instead."
|
|
242
|
+
)
|
|
243
|
+
else:
|
|
244
|
+
self.net.setName(name)
|
|
245
|
+
|
|
228
246
|
def get_msb(self) -> int:
|
|
229
247
|
"""
|
|
230
248
|
:return: the most significant bit of the net if it is a bus.
|
|
@@ -577,6 +595,13 @@ class Term:
|
|
|
577
595
|
"""
|
|
578
596
|
return get_snl_term_for_ids(self.pathIDs, self.termIDs).getName()
|
|
579
597
|
|
|
598
|
+
def is_unnamed(self) -> bool:
|
|
599
|
+
"""
|
|
600
|
+
:return: True if the term is unnamed.
|
|
601
|
+
:rtype: bool
|
|
602
|
+
"""
|
|
603
|
+
return get_snl_term_for_ids(self.pathIDs, self.termIDs).isUnnamed()
|
|
604
|
+
|
|
580
605
|
def get_direction(self) -> Direction:
|
|
581
606
|
"""
|
|
582
607
|
:return: the direction of the term.
|
|
@@ -753,6 +778,25 @@ class Term:
|
|
|
753
778
|
iterm = inst.getInstTerm(bterm)
|
|
754
779
|
iterm.setNet(bnet)
|
|
755
780
|
|
|
781
|
+
def get_truth_table(self):
|
|
782
|
+
# check the index of the output
|
|
783
|
+
if not self.is_output():
|
|
784
|
+
raise ValueError("Truth table can only be computed for output terms")
|
|
785
|
+
# get the instance
|
|
786
|
+
if self.is_bus():
|
|
787
|
+
raise ValueError("Truth table cannot be computed for bus terms")
|
|
788
|
+
inst = self.get_instance()
|
|
789
|
+
# get the model
|
|
790
|
+
model = inst._Instance__get_snl_model()
|
|
791
|
+
for term in model.getTerms():
|
|
792
|
+
if term.getDirection() == naja.SNLTerm.Direction.Output:
|
|
793
|
+
if term.getName() == self.get_name():
|
|
794
|
+
# get the truth table
|
|
795
|
+
tt = model.getTruthTableByOutputID(term.getID())
|
|
796
|
+
if tt is not None:
|
|
797
|
+
return model.getTruthTableByOutputID(term.getID())
|
|
798
|
+
return None
|
|
799
|
+
|
|
756
800
|
|
|
757
801
|
def get_instance_by_path(names: list):
|
|
758
802
|
assert len(names) > 0
|
|
@@ -813,8 +857,7 @@ class Attribute:
|
|
|
813
857
|
|
|
814
858
|
|
|
815
859
|
class Instance:
|
|
816
|
-
"""Class that represents
|
|
817
|
-
of the snl occurrence API.
|
|
860
|
+
"""Class that represents an instance in the design hierarchy.
|
|
818
861
|
"""
|
|
819
862
|
|
|
820
863
|
def __init__(self, path=naja.SNLPath()):
|
|
@@ -1288,12 +1331,28 @@ class Instance:
|
|
|
1288
1331
|
:return: the name of the instance or name of the top is this is the top.
|
|
1289
1332
|
:rtype: str
|
|
1290
1333
|
"""
|
|
1291
|
-
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1292
1334
|
if self.is_top():
|
|
1293
1335
|
return self.get_model_name()
|
|
1294
1336
|
else:
|
|
1337
|
+
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1295
1338
|
return path.getTailInstance().getName()
|
|
1296
1339
|
|
|
1340
|
+
def set_name(self, name: str):
|
|
1341
|
+
"""Set the name of this instance.
|
|
1342
|
+
|
|
1343
|
+
:param str name: the new name of the instance.
|
|
1344
|
+
"""
|
|
1345
|
+
if self.is_top():
|
|
1346
|
+
topSNLDesign = naja.NLUniverse.get().getTopDesign()
|
|
1347
|
+
topSNLDesign.setName(name)
|
|
1348
|
+
else:
|
|
1349
|
+
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1350
|
+
if path.size() > 0:
|
|
1351
|
+
naja.SNLUniquifier(path)
|
|
1352
|
+
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1353
|
+
inst = path.getTailInstance()
|
|
1354
|
+
inst.setName(name)
|
|
1355
|
+
|
|
1297
1356
|
def get_model_name(self) -> str:
|
|
1298
1357
|
"""
|
|
1299
1358
|
:return: the name of the model of the instance
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
najaeda
|
|
2
|
-
najaeda
|
|
3
|
-
najaeda
|
|
4
|
-
najaeda
|
|
5
|
-
najaeda-0.2.2.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
|
|
6
|
-
najaeda/libnaja_python.so,sha256=YJD05Yz3Wy8r51nxPElrIXYXSSmlwp3syHG7wSjcPlc,1886217
|
|
7
|
-
najaeda/libnaja_nl.so,sha256=DSyBNyIPDt8oz9kRO0EqiPYTNvNSiVe8AaZd3LoCUqs,1646864
|
|
8
|
-
najaeda/naja.so,sha256=TcbRubiyBA1KFnqd7hC_Lp6F_yfJXktFkJ6VOwBuR04,206521
|
|
1
|
+
najaeda/libnaja_python.so,sha256=wpgnHiXaMuWTvullT3EgX9WY17By3Tv1p4q1ESOap5g,1953737
|
|
2
|
+
najaeda/_version.py,sha256=c-4hT20dyE-3BcdzOqR0vd92E7ydR5u2c-VmCc6oU8A,332
|
|
3
|
+
najaeda/libnaja_nl.so,sha256=2N9413-s5cYoPR3W_AgBIbavOb9ES7dFQcDJYCYoc1s,1646872
|
|
4
|
+
najaeda/naja.so,sha256=oGJemBfrJ92hAPycm2xtuAu0GILyOJWz7jslxhhe4qY,206521
|
|
9
5
|
najaeda/pandas_stats.py,sha256=yOb4ka965U7rN4D6AwvSGmRyeT_O7Ed-5cmT8BFbfeo,1070
|
|
10
6
|
najaeda/stats.py,sha256=SJ9rca0Z6ldNAFOjU7DPO2hfx1zq-9Bec0Rx_oLasJo,16217
|
|
11
7
|
najaeda/libnaja_bne.so,sha256=ejZf2Zl2AXQagN41HIj8x-3oeoyEffcPTPR0YeY40ng,272577
|
|
12
|
-
najaeda/__init__.py,sha256=
|
|
8
|
+
najaeda/__init__.py,sha256=6QrOzlqTfd558FH9Zm6ve54IzkHaDJ8ZO8hTCaEwsL8,218
|
|
13
9
|
najaeda/libnaja_opt.so,sha256=t71JSk0NSGXY48FRSOL-j_O98iwLF1s-ppe8z8h2lZg,348713
|
|
14
|
-
najaeda/netlist.py,sha256=
|
|
10
|
+
najaeda/netlist.py,sha256=B2NwDDriuqf3Jy-J0w4bDJ4dwXIovSzwrWOEHLXjw6s,58509
|
|
15
11
|
najaeda/net_visitor.py,sha256=P_esjibYb-wBDuF-AyF7es9sJYw1Ha8RhTPu-qKe7G4,1940
|
|
16
|
-
najaeda/libnaja_dnl.so,sha256=
|
|
12
|
+
najaeda/libnaja_dnl.so,sha256=QxHFSN33IIipFUl-Nx0qyG1XPynYOq4GbF7YbwGkbBM,276545
|
|
17
13
|
najaeda/instance_visitor.py,sha256=JMsPSQaWNiDjxS05rxg83a0PIsrOIuTi9G35hkwdibs,1530
|
|
18
14
|
najaeda/native/stats.py,sha256=t50hhE9pEFNtlssjES0A-K9TsO_2ZSUAb-e9L3Rt6yc,13063
|
|
19
15
|
najaeda/native/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -33,8 +29,13 @@ najaeda/docs/source/index.rst,sha256=80VMfeEGHObnOUXRBxIzISQsG_HNkgT-pUpsDZsCfOY
|
|
|
33
29
|
najaeda/docs/source/visitors.rst,sha256=KScCr7BytrhFxWfZPyYWIrr3CEJuk5Tx-LjEuDnnBaA,227
|
|
34
30
|
najaeda/docs/source/api.rst,sha256=47VCPyF4Py_1cklZ3q9fmOMhqqI17rxwU_VUJETfCwY,151
|
|
35
31
|
najaeda/docs/source/term.rst,sha256=QKWT6u1xjEjusvcZYknKQ-M83ibohO5y1EYTQnnXqak,690
|
|
36
|
-
najaeda/docs/source/instance.rst,sha256=
|
|
32
|
+
najaeda/docs/source/instance.rst,sha256=4JDl4_YaTbYxJrgSCe-3vV-EkKGGKOIejXMLfbJR1jk,957
|
|
37
33
|
najaeda/docs/source/conf.py,sha256=XqCFo29gZCbaoPe1xEan9ZonYyQW5NZnWHGEWrB7p8Q,2021
|
|
34
|
+
najaeda-0.2.3.dist-info/WHEEL,sha256=qWe43I_ziyqlu2SouxbZAN4VQzvapKrxWUcRsva4KM8,158
|
|
35
|
+
najaeda-0.2.3.dist-info/METADATA,sha256=Jx4ae_OoGfbOlrSqer4UwGLTOz5-CYwWQMeeKz3_mhM,3435
|
|
36
|
+
najaeda-0.2.3.dist-info/RECORD,,
|
|
37
|
+
najaeda-0.2.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
38
|
+
najaeda-0.2.3.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
|
|
38
39
|
najaeda.libs/libtbbmalloc-8bd2c113.so.2.15,sha256=t7EmHeYI7vtRrpUMImjQuzDv3a1gs8-lcUxotcVs3mA,198281
|
|
39
40
|
najaeda.libs/libcapnp-1-d562dcbf.1.0.so,sha256=oATbFuRyIBdV6dWAaarYlY3DDt3Wvyp1nC5FvgRIyzw,1152985
|
|
40
41
|
najaeda.libs/libtbb-58378cc2.so.12.15,sha256=yxzhDOGKoZHEHYUULdSu-uH9-Hr1Wh8JygBizKBxc_U,404105
|
|
File without changes
|
|
File without changes
|
|
File without changes
|