najaeda 0.2.2__cp312-cp312-macosx_11_0_arm64.whl → 0.2.4__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/__init__.py +8 -0
- najaeda/_version.py +16 -0
- najaeda/docs/source/instance.rst +15 -0
- najaeda/libnaja_dnl.dylib +0 -0
- najaeda/libnaja_nl.dylib +0 -0
- najaeda/libnaja_python.dylib +0 -0
- najaeda/naja.so +0 -0
- najaeda/netlist.py +217 -43
- najaeda/stats.py +1 -1
- {najaeda-0.2.2.dist-info → najaeda-0.2.4.dist-info}/METADATA +1 -1
- {najaeda-0.2.2.dist-info → najaeda-0.2.4.dist-info}/RECORD +14 -13
- {najaeda-0.2.2.dist-info → najaeda-0.2.4.dist-info}/WHEEL +0 -0
- {najaeda-0.2.2.dist-info → najaeda-0.2.4.dist-info}/licenses/AUTHORS +0 -0
- {najaeda-0.2.2.dist-info → najaeda-0.2.4.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.dylib
CHANGED
|
Binary file
|
najaeda/libnaja_nl.dylib
CHANGED
|
Binary file
|
najaeda/libnaja_python.dylib
CHANGED
|
Binary file
|
najaeda/naja.so
CHANGED
|
Binary file
|
najaeda/netlist.py
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
#
|
|
4
4
|
# SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
6
|
-
import itertools
|
|
7
6
|
import time
|
|
8
7
|
import logging
|
|
9
8
|
import hashlib
|
|
@@ -133,27 +132,31 @@ class Equipotential:
|
|
|
133
132
|
for term in self.equi.getTerms():
|
|
134
133
|
yield Term([], term)
|
|
135
134
|
|
|
136
|
-
def get_leaf_readers(self):
|
|
135
|
+
def get_leaf_readers(self, filter=None):
|
|
137
136
|
if self.equi is not None:
|
|
138
137
|
for term in self.equi.getInstTermOccurrences():
|
|
139
138
|
direction = term.getInstTerm().getDirection()
|
|
140
|
-
if
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
if (
|
|
140
|
+
direction != naja.SNLTerm.Direction.Output and
|
|
141
|
+
term.getInstTerm().getInstance().getModel().isLeaf() and
|
|
142
|
+
(filter is None or filter(term))
|
|
143
|
+
):
|
|
144
|
+
path = term.getPath().getPathIDs()
|
|
145
|
+
path.append(term.getInstTerm().getInstance().getID())
|
|
146
|
+
yield Term(path, term.getInstTerm().getBitTerm())
|
|
147
|
+
|
|
148
|
+
def get_leaf_drivers(self, filter=None):
|
|
148
149
|
if self.equi is not None:
|
|
149
150
|
for term in self.equi.getInstTermOccurrences():
|
|
150
151
|
direction = term.getInstTerm().getDirection()
|
|
151
|
-
if
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
if (
|
|
153
|
+
direction != naja.SNLTerm.Direction.Input and
|
|
154
|
+
term.getInstTerm().getInstance().getModel().isLeaf() and
|
|
155
|
+
(filter is None or filter(term))
|
|
156
|
+
):
|
|
157
|
+
path = term.getPath().getPathIDs()
|
|
158
|
+
path.append(term.getInstTerm().getInstance().getID())
|
|
159
|
+
yield Term(path, term.getInstTerm().getBitTerm())
|
|
157
160
|
|
|
158
161
|
def get_top_readers(self):
|
|
159
162
|
if self.equi is not None:
|
|
@@ -207,14 +210,15 @@ class Net:
|
|
|
207
210
|
return not eq_result
|
|
208
211
|
|
|
209
212
|
def __str__(self):
|
|
210
|
-
if
|
|
211
|
-
net_str = str(self.net)
|
|
212
|
-
elif hasattr(self, "net_concat"):
|
|
213
|
+
if self.is_concat():
|
|
213
214
|
net_str = "{" + ",".join(map(str, self.net_concat)) + "}"
|
|
215
|
+
return net_str
|
|
216
|
+
net_str = str(self.net)
|
|
214
217
|
path = get_snl_path_from_id_list(self.pathIDs)
|
|
215
218
|
if path.size() > 0:
|
|
216
219
|
return f"{path}/{net_str}"
|
|
217
|
-
|
|
220
|
+
else:
|
|
221
|
+
return net_str
|
|
218
222
|
|
|
219
223
|
def get_name(self) -> str:
|
|
220
224
|
"""
|
|
@@ -225,6 +229,27 @@ class Net:
|
|
|
225
229
|
return self.net.getName()
|
|
226
230
|
return "{" + ",".join(map(str, self.net_concat)) + "}"
|
|
227
231
|
|
|
232
|
+
def set_name(self, name: str):
|
|
233
|
+
"""
|
|
234
|
+
:param str name: the name to set for this Net.
|
|
235
|
+
"""
|
|
236
|
+
if self.is_concat():
|
|
237
|
+
raise ValueError(
|
|
238
|
+
f"set_name of {self}: cannot set name for a concatenated net. "
|
|
239
|
+
"Use the individual nets instead."
|
|
240
|
+
)
|
|
241
|
+
elif self.is_bus_bit():
|
|
242
|
+
raise ValueError(
|
|
243
|
+
f"set_name of {self}: cannot set name for a bus bit. "
|
|
244
|
+
"Use the bus net instead."
|
|
245
|
+
)
|
|
246
|
+
else:
|
|
247
|
+
# We need to uniquify until parent instance if parent instance is not top.
|
|
248
|
+
path = get_snl_path_from_id_list(self.pathIDs)
|
|
249
|
+
if path.size():
|
|
250
|
+
naja.SNLUniquifier(path.getHeadPath())
|
|
251
|
+
self.net.setName(name)
|
|
252
|
+
|
|
228
253
|
def get_msb(self) -> int:
|
|
229
254
|
"""
|
|
230
255
|
:return: the most significant bit of the net if it is a bus.
|
|
@@ -286,10 +311,7 @@ class Net:
|
|
|
286
311
|
if hasattr(self, "net"):
|
|
287
312
|
return self.net.isConstant()
|
|
288
313
|
else:
|
|
289
|
-
for net in self.net_concat
|
|
290
|
-
if not net.isConstant():
|
|
291
|
-
return False
|
|
292
|
-
return True
|
|
314
|
+
return all(net.isConstant() for net in self.net_concat)
|
|
293
315
|
|
|
294
316
|
def set_type(self, net_type: Type):
|
|
295
317
|
"""
|
|
@@ -324,7 +346,7 @@ class Net:
|
|
|
324
346
|
yield self
|
|
325
347
|
else:
|
|
326
348
|
for net in self.net_concat:
|
|
327
|
-
yield Net(net)
|
|
349
|
+
yield Net(self.pathIDs, net)
|
|
328
350
|
|
|
329
351
|
def get_bit(self, index: int):
|
|
330
352
|
"""
|
|
@@ -391,8 +413,8 @@ class Net:
|
|
|
391
413
|
:return: an iterator over the terminals of the net.
|
|
392
414
|
:rtype: Iterator[Term]
|
|
393
415
|
"""
|
|
394
|
-
|
|
395
|
-
|
|
416
|
+
yield from self.get_design_terms()
|
|
417
|
+
yield from self.get_inst_terms()
|
|
396
418
|
|
|
397
419
|
|
|
398
420
|
def get_snl_term_for_ids(pathIDs, termIDs):
|
|
@@ -534,6 +556,22 @@ class Term:
|
|
|
534
556
|
"""
|
|
535
557
|
return self.is_scalar() or self.is_bus_bit()
|
|
536
558
|
|
|
559
|
+
def is_sequential(self) -> bool:
|
|
560
|
+
"""
|
|
561
|
+
:return: True if the term is a sequential term.
|
|
562
|
+
:rtype: bool
|
|
563
|
+
"""
|
|
564
|
+
for term in self.get_instance().get_flat_terms():
|
|
565
|
+
clockRelatedInputs = term.get_instance().get_clock_related_inputs(term)
|
|
566
|
+
if self in clockRelatedInputs:
|
|
567
|
+
return True
|
|
568
|
+
clockRelatedOutputs = term.get_instance().get_clock_related_outputs(term)
|
|
569
|
+
if self in clockRelatedOutputs:
|
|
570
|
+
return True
|
|
571
|
+
if (len(clockRelatedInputs) > 0 or len(clockRelatedOutputs) > 0) and (term == self):
|
|
572
|
+
return True
|
|
573
|
+
return False
|
|
574
|
+
|
|
537
575
|
def get_bit_number(self):
|
|
538
576
|
"""
|
|
539
577
|
:return: the bit index of the term if it is a bit.
|
|
@@ -577,6 +615,13 @@ class Term:
|
|
|
577
615
|
"""
|
|
578
616
|
return get_snl_term_for_ids(self.pathIDs, self.termIDs).getName()
|
|
579
617
|
|
|
618
|
+
def is_unnamed(self) -> bool:
|
|
619
|
+
"""
|
|
620
|
+
:return: True if the term is unnamed.
|
|
621
|
+
:rtype: bool
|
|
622
|
+
"""
|
|
623
|
+
return get_snl_term_for_ids(self.pathIDs, self.termIDs).isUnnamed()
|
|
624
|
+
|
|
580
625
|
def get_direction(self) -> Direction:
|
|
581
626
|
"""
|
|
582
627
|
:return: the direction of the term.
|
|
@@ -593,7 +638,7 @@ class Term:
|
|
|
593
638
|
def __get_snl_bitnet(self, bit) -> Net:
|
|
594
639
|
# single bit
|
|
595
640
|
path = get_snl_path_from_id_list(self.pathIDs)
|
|
596
|
-
if path.size()
|
|
641
|
+
if path.size():
|
|
597
642
|
instTerm = path.getTailInstance().getInstTerm(bit)
|
|
598
643
|
return instTerm.getNet()
|
|
599
644
|
else:
|
|
@@ -668,8 +713,11 @@ class Term:
|
|
|
668
713
|
"""
|
|
669
714
|
return Instance(self.pathIDs)
|
|
670
715
|
|
|
671
|
-
def get_flat_fanout(self):
|
|
672
|
-
return self.get_equipotential().get_leaf_readers()
|
|
716
|
+
def get_flat_fanout(self, filter=None):
|
|
717
|
+
return self.get_equipotential().get_leaf_readers(filter=filter)
|
|
718
|
+
|
|
719
|
+
def count_flat_fanout(self, filter=None):
|
|
720
|
+
return sum(1 for _ in self.get_flat_fanout(filter=filter))
|
|
673
721
|
|
|
674
722
|
def get_equipotential(self) -> Equipotential:
|
|
675
723
|
"""
|
|
@@ -753,6 +801,25 @@ class Term:
|
|
|
753
801
|
iterm = inst.getInstTerm(bterm)
|
|
754
802
|
iterm.setNet(bnet)
|
|
755
803
|
|
|
804
|
+
def get_truth_table(self):
|
|
805
|
+
# check the index of the output
|
|
806
|
+
if not self.is_output():
|
|
807
|
+
raise ValueError("Truth table can only be computed for output terms")
|
|
808
|
+
# get the instance
|
|
809
|
+
if self.is_bus():
|
|
810
|
+
raise ValueError("Truth table cannot be computed for bus terms")
|
|
811
|
+
inst = self.get_instance()
|
|
812
|
+
# get the model
|
|
813
|
+
model = inst._Instance__get_snl_model()
|
|
814
|
+
for term in model.getTerms():
|
|
815
|
+
if term.getDirection() == naja.SNLTerm.Direction.Output:
|
|
816
|
+
if term.getName() == self.get_name():
|
|
817
|
+
# get the truth table
|
|
818
|
+
tt = model.getTruthTableByOutputID(term.getID())
|
|
819
|
+
if tt is not None:
|
|
820
|
+
return model.getTruthTableByOutputID(term.getID())
|
|
821
|
+
return None
|
|
822
|
+
|
|
756
823
|
|
|
757
824
|
def get_instance_by_path(names: list):
|
|
758
825
|
assert len(names) > 0
|
|
@@ -813,16 +880,15 @@ class Attribute:
|
|
|
813
880
|
|
|
814
881
|
|
|
815
882
|
class Instance:
|
|
816
|
-
"""Class that represents
|
|
817
|
-
of the snl occurrence API.
|
|
883
|
+
"""Class that represents an instance in the design hierarchy.
|
|
818
884
|
"""
|
|
819
885
|
|
|
820
886
|
def __init__(self, path=naja.SNLPath()):
|
|
821
887
|
self.inst = None
|
|
822
888
|
self.revisionCount = 0
|
|
823
|
-
self.SNLID = [0
|
|
889
|
+
self.SNLID = [0] * 6
|
|
824
890
|
if isinstance(path, naja.SNLPath):
|
|
825
|
-
if path.size()
|
|
891
|
+
if path.size():
|
|
826
892
|
self.pathIDs = path.getPathIDs()
|
|
827
893
|
self.revisionCount = path.getTailInstance().getModel().getRevisionCount()
|
|
828
894
|
self.inst = path.getTailInstance()
|
|
@@ -830,10 +896,10 @@ class Instance:
|
|
|
830
896
|
self.pathIDs = []
|
|
831
897
|
elif isinstance(path, list):
|
|
832
898
|
self.pathIDs = path.copy()
|
|
833
|
-
if
|
|
899
|
+
if path:
|
|
834
900
|
self.inst = get_snl_instance_from_id_list(path)
|
|
835
901
|
self.revisionCount = self.inst.getModel().getRevisionCount()
|
|
836
|
-
if self.inst
|
|
902
|
+
if self.inst:
|
|
837
903
|
self.SNLID = self.inst.getModel().getNLID()
|
|
838
904
|
|
|
839
905
|
def __eq__(self, other) -> bool:
|
|
@@ -946,12 +1012,6 @@ class Instance:
|
|
|
946
1012
|
"""
|
|
947
1013
|
return self.__get_snl_model().isInv()
|
|
948
1014
|
|
|
949
|
-
def is_basic_primitive(instance):
|
|
950
|
-
design = instance.__get_snl_model()
|
|
951
|
-
return (
|
|
952
|
-
design.isConst0() or design.isConst1() or design.isBuf() or design.isInv()
|
|
953
|
-
)
|
|
954
|
-
|
|
955
1015
|
def __get_snl_model(self):
|
|
956
1016
|
if self.is_top():
|
|
957
1017
|
return naja.NLUniverse.get().getTopDesign()
|
|
@@ -1099,6 +1159,13 @@ class Instance:
|
|
|
1099
1159
|
"""
|
|
1100
1160
|
return self.__get_snl_model().isPrimitive()
|
|
1101
1161
|
|
|
1162
|
+
def is_sequential(self) -> bool:
|
|
1163
|
+
"""
|
|
1164
|
+
:return: True if this is a sequential element.
|
|
1165
|
+
:rtype: bool
|
|
1166
|
+
"""
|
|
1167
|
+
return self.__get_snl_model().isSequential()
|
|
1168
|
+
|
|
1102
1169
|
def get_terms(self):
|
|
1103
1170
|
"""Iterate over all scalar terms and bus terms of this Instance.
|
|
1104
1171
|
|
|
@@ -1242,6 +1309,14 @@ class Instance:
|
|
|
1242
1309
|
for attribute in leaf_object.getAttributes():
|
|
1243
1310
|
yield Attribute(attribute)
|
|
1244
1311
|
|
|
1312
|
+
def count_attributes(self) -> int:
|
|
1313
|
+
"""Count the attributes of this Instance.
|
|
1314
|
+
|
|
1315
|
+
:return: the number of attributes of this Instance.
|
|
1316
|
+
:rtype: int
|
|
1317
|
+
"""
|
|
1318
|
+
return sum(1 for _ in self.get_attributes())
|
|
1319
|
+
|
|
1245
1320
|
def delete_instance(self, name: str):
|
|
1246
1321
|
"""Delete the child instance with the given name."""
|
|
1247
1322
|
if name == "":
|
|
@@ -1288,12 +1363,30 @@ class Instance:
|
|
|
1288
1363
|
:return: the name of the instance or name of the top is this is the top.
|
|
1289
1364
|
:rtype: str
|
|
1290
1365
|
"""
|
|
1291
|
-
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1292
1366
|
if self.is_top():
|
|
1293
1367
|
return self.get_model_name()
|
|
1294
1368
|
else:
|
|
1369
|
+
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1295
1370
|
return path.getTailInstance().getName()
|
|
1296
1371
|
|
|
1372
|
+
def set_name(self, name: str):
|
|
1373
|
+
"""Set the name of this instance.
|
|
1374
|
+
|
|
1375
|
+
:param str name: the new name of the instance.
|
|
1376
|
+
"""
|
|
1377
|
+
if self.is_top():
|
|
1378
|
+
topSNLDesign = naja.NLUniverse.get().getTopDesign()
|
|
1379
|
+
topSNLDesign.setName(name)
|
|
1380
|
+
else:
|
|
1381
|
+
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1382
|
+
# We need to uniquify until parent instance if parent instance
|
|
1383
|
+
# is not top. path.size == 1 for instance under top
|
|
1384
|
+
if path.size() > 1:
|
|
1385
|
+
naja.SNLUniquifier(path.getHeadPath())
|
|
1386
|
+
path = get_snl_path_from_id_list(self.pathIDs)
|
|
1387
|
+
inst = path.getTailInstance()
|
|
1388
|
+
inst.setName(name)
|
|
1389
|
+
|
|
1297
1390
|
def get_model_name(self) -> str:
|
|
1298
1391
|
"""
|
|
1299
1392
|
:return: the name of the model of the instance
|
|
@@ -1478,6 +1571,87 @@ class Instance:
|
|
|
1478
1571
|
"""
|
|
1479
1572
|
return self.__get_snl_model().getTruthTable()
|
|
1480
1573
|
|
|
1574
|
+
def add_clock_related_inputs(self, clock_term: Term, input_terms: List[Term]):
|
|
1575
|
+
"""Add input terms that are related to the given clock term.
|
|
1576
|
+
|
|
1577
|
+
:param clock_term: the clock term to check for related inputs.
|
|
1578
|
+
:param input_terms: a list of input terms to add.
|
|
1579
|
+
:return: None
|
|
1580
|
+
"""
|
|
1581
|
+
snlterms = [get_snl_term_for_ids(term.pathIDs, term.termIDs) for term in input_terms]
|
|
1582
|
+
self.__get_snl_model().addInputsToClockArcs(snlterms,
|
|
1583
|
+
get_snl_term_for_ids(clock_term.pathIDs,
|
|
1584
|
+
clock_term.termIDs))
|
|
1585
|
+
|
|
1586
|
+
def get_clock_related_inputs(self, clock_term: Term) -> List[Term]:
|
|
1587
|
+
"""Get all input terms that are related to the given clock term.
|
|
1588
|
+
|
|
1589
|
+
:param clock_term: the clock term to check for related inputs.
|
|
1590
|
+
:return: a list of input terms that are related to the clock term.
|
|
1591
|
+
:rtype: List[Term]
|
|
1592
|
+
"""
|
|
1593
|
+
terms = self.__get_snl_model().getClockRelatedInputs(
|
|
1594
|
+
get_snl_term_for_ids(clock_term.pathIDs, clock_term.termIDs))
|
|
1595
|
+
# Convert SNL terms to Term objects
|
|
1596
|
+
return [Term(clock_term.pathIDs, term) for term in terms]
|
|
1597
|
+
|
|
1598
|
+
def add_clock_related_outputs(self, clock_term: Term, output_terms: List[Term]):
|
|
1599
|
+
"""Add output terms that are related to the given clock term.
|
|
1600
|
+
|
|
1601
|
+
:param clock_term: the clock term to check for related outputs.
|
|
1602
|
+
:param output_terms: a list of output terms to add.
|
|
1603
|
+
:return: None
|
|
1604
|
+
"""
|
|
1605
|
+
# convert Term objects to SNL terms
|
|
1606
|
+
snlterms = [get_snl_term_for_ids(term.pathIDs, term.termIDs) for term in output_terms]
|
|
1607
|
+
self.__get_snl_model().addClockToOutputsArcs(
|
|
1608
|
+
get_snl_term_for_ids(clock_term.pathIDs, clock_term.termIDs), snlterms)
|
|
1609
|
+
|
|
1610
|
+
def get_clock_related_outputs(self, clock_term: Term) -> List[Term]:
|
|
1611
|
+
"""Get all output terms that are related to the given clock term.
|
|
1612
|
+
|
|
1613
|
+
:param clock_term: the clock term to check for related outputs.
|
|
1614
|
+
:return: a list of output terms that are related to the clock term.
|
|
1615
|
+
:rtype: List[Term]
|
|
1616
|
+
"""
|
|
1617
|
+
terms = self.__get_snl_model().getClockRelatedOutputs(
|
|
1618
|
+
get_snl_term_for_ids(clock_term.pathIDs, clock_term.termIDs))
|
|
1619
|
+
# Convert SNL terms to Term objects
|
|
1620
|
+
return [Term(clock_term.pathIDs, term) for term in terms]
|
|
1621
|
+
|
|
1622
|
+
def add_combinatorial_arcs(self, input_terms: List[Term], output_terms: List[Term]):
|
|
1623
|
+
"""Add input terms that are combinatorial inputs for the given output term.
|
|
1624
|
+
|
|
1625
|
+
:param output_term: the output term to check for combinatorial inputs.
|
|
1626
|
+
:param input_terms: a list of input terms to add.
|
|
1627
|
+
:return: None
|
|
1628
|
+
"""
|
|
1629
|
+
self.__get_snl_model().addCombinatorialArcs(
|
|
1630
|
+
[get_snl_term_for_ids(term.pathIDs, term.termIDs) for term in input_terms],
|
|
1631
|
+
[get_snl_term_for_ids(term.pathIDs, term.termIDs) for term in output_terms])
|
|
1632
|
+
|
|
1633
|
+
def get_combinatorial_inputs(self, output_term: Term) -> List[Term]:
|
|
1634
|
+
"""Get all combinatorial input terms of this instance.
|
|
1635
|
+
|
|
1636
|
+
:return: a list of combinatorial input terms.
|
|
1637
|
+
:rtype: List[Term]
|
|
1638
|
+
"""
|
|
1639
|
+
terms = self.__get_snl_model().getCombinatorialInputs(
|
|
1640
|
+
get_snl_term_for_ids(output_term.pathIDs, output_term.termIDs))
|
|
1641
|
+
# Convert SNL terms to Term objects
|
|
1642
|
+
return [Term(self.pathIDs, term) for term in terms]
|
|
1643
|
+
|
|
1644
|
+
def get_combinatorial_outputs(self, input_term: Term) -> List[Term]:
|
|
1645
|
+
"""Get all combinatorial output terms of this instance.
|
|
1646
|
+
|
|
1647
|
+
:return: a list of combinatorial output terms.
|
|
1648
|
+
:rtype: List[Term]
|
|
1649
|
+
"""
|
|
1650
|
+
terms = self.__get_snl_model().getCombinatorialOutputs(
|
|
1651
|
+
get_snl_term_for_ids(input_term.pathIDs, input_term.termIDs))
|
|
1652
|
+
# Convert SNL terms to Term objects
|
|
1653
|
+
return [Term(self.pathIDs, term) for term in terms]
|
|
1654
|
+
|
|
1481
1655
|
|
|
1482
1656
|
def __get_top_db() -> naja.NLDB:
|
|
1483
1657
|
if naja.NLUniverse.get() is None:
|
najaeda/stats.py
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
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=
|
|
7
|
-
najaeda/libnaja_nl.dylib,sha256=
|
|
1
|
+
najaeda-0.2.4.dist-info/RECORD,,
|
|
2
|
+
najaeda-0.2.4.dist-info/WHEEL,sha256=v7i1yNVEHWKlHHcCQ8SYkgpldhmAvPDAYWfI_XMFumo,114
|
|
3
|
+
najaeda-0.2.4.dist-info/METADATA,sha256=aGamxUDd_TKlccUOBxm-ooAbA3Ef-FwSlgP3lPTW09U,3435
|
|
4
|
+
najaeda-0.2.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
5
|
+
najaeda-0.2.4.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
|
|
6
|
+
najaeda/netlist.py,sha256=KdBQ77bMqYiUU_ecbDrR43L98FXk05_ahvj-8um-G5k,63866
|
|
7
|
+
najaeda/libnaja_nl.dylib,sha256=v773WRb6Pl9gpAtRNB8Z6YO0L0L1N121JPXRm9CjucI,757456
|
|
8
8
|
najaeda/pandas_stats.py,sha256=yOb4ka965U7rN4D6AwvSGmRyeT_O7Ed-5cmT8BFbfeo,1070
|
|
9
|
-
najaeda/
|
|
10
|
-
najaeda/
|
|
9
|
+
najaeda/_version.py,sha256=c-4hT20dyE-3BcdzOqR0vd92E7ydR5u2c-VmCc6oU8A,332
|
|
10
|
+
najaeda/__init__.py,sha256=6QrOzlqTfd558FH9Zm6ve54IzkHaDJ8ZO8hTCaEwsL8,218
|
|
11
|
+
najaeda/naja.so,sha256=KlZfhVxDYoHspfxoGy4yHuU8h9-r3y51IDlK9TSrjeQ,99440
|
|
11
12
|
najaeda/net_visitor.py,sha256=P_esjibYb-wBDuF-AyF7es9sJYw1Ha8RhTPu-qKe7G4,1940
|
|
12
13
|
najaeda/libnaja_opt.dylib,sha256=wIG2H5rnxbqGrwLSgklJjZ5wjOkx2Shhu2RsnYQwmuE,212720
|
|
13
|
-
najaeda/libnaja_python.dylib,sha256=
|
|
14
|
-
najaeda/stats.py,sha256=
|
|
14
|
+
najaeda/libnaja_python.dylib,sha256=soj2mTcuscVV3Frs3XmeiyekyUgWm5fmxGezO6ziJEQ,944848
|
|
15
|
+
najaeda/stats.py,sha256=W41fqyMiAN9o9ajXy1t-CGoxDaSmY0TyTT5epc6yz-I,16249
|
|
15
16
|
najaeda/instance_visitor.py,sha256=JMsPSQaWNiDjxS05rxg83a0PIsrOIuTi9G35hkwdibs,1530
|
|
16
17
|
najaeda/libnaja_bne.dylib,sha256=pLbGUnDr5PSGXbA8wKD-pqEyQIWHbiCb1icPpxRYrWE,136416
|
|
17
|
-
najaeda/libnaja_dnl.dylib,sha256=
|
|
18
|
+
najaeda/libnaja_dnl.dylib,sha256=qroDUAnl-eBJcdz-1YGC08Ngz4NEUctMiZ4W-gpT5mU,147088
|
|
18
19
|
najaeda/native/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
20
|
najaeda/native/stats.py,sha256=t50hhE9pEFNtlssjES0A-K9TsO_2ZSUAb-e9L3Rt6yc,13063
|
|
20
21
|
najaeda/docs/requirements.txt,sha256=1XIBGTIplm2arC9HhDCfLuAjozGdVSXkqmOj8ybuT6U,121
|
|
21
22
|
najaeda/docs/.readthedocs.yaml,sha256=nN_Psro-YdfPcIiueZkJcZepts68g23rqVThhKnmVRw,790
|
|
22
23
|
najaeda/docs/source/index.rst,sha256=80VMfeEGHObnOUXRBxIzISQsG_HNkgT-pUpsDZsCfOY,387
|
|
23
|
-
najaeda/docs/source/instance.rst,sha256=
|
|
24
|
+
najaeda/docs/source/instance.rst,sha256=4JDl4_YaTbYxJrgSCe-3vV-EkKGGKOIejXMLfbJR1jk,957
|
|
24
25
|
najaeda/docs/source/conf.py,sha256=XqCFo29gZCbaoPe1xEan9ZonYyQW5NZnWHGEWrB7p8Q,2021
|
|
25
26
|
najaeda/docs/source/preprocessor.py,sha256=TK4LsTdNbv2dxkKQaJ7cEyo9PU5v_56vlrFCJYIPKf8,2625
|
|
26
27
|
najaeda/docs/source/term.rst,sha256=QKWT6u1xjEjusvcZYknKQ-M83ibohO5y1EYTQnnXqak,690
|
|
File without changes
|
|
File without changes
|
|
File without changes
|