najaeda 0.2.10__cp312-cp312-macosx_11_0_arm64.whl → 0.2.12__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 CHANGED
Binary file
Binary file
najaeda/libnaja_nl.dylib CHANGED
Binary file
Binary file
najaeda/naja.so CHANGED
Binary file
najaeda/netlist.py CHANGED
@@ -72,6 +72,35 @@ def get_snl_path_from_id_list(id_list: list) -> naja.SNLPath:
72
72
  return path
73
73
 
74
74
 
75
+ class Attribute:
76
+ def __init__(self, snlAttribute):
77
+ self.snlAttribute = snlAttribute
78
+
79
+ def __str__(self):
80
+ return str(self.snlAttribute)
81
+
82
+ def get_name(self):
83
+ """
84
+ :return: the name of the attribute.
85
+ :rtype: str
86
+ """
87
+ return self.snlAttribute.getName()
88
+
89
+ def has_value(self):
90
+ """
91
+ :return: True if the attribute has a value.
92
+ :rtype: bool
93
+ """
94
+ return self.snlAttribute.hasValue()
95
+
96
+ def get_value(self):
97
+ """
98
+ :return: the value of the attribute.
99
+ :rtype: str
100
+ """
101
+ return self.snlAttribute.getValue()
102
+
103
+
75
104
  class Equipotential:
76
105
  """Class that represents the term and wraps
77
106
  some of the snl occurrence API.
@@ -423,6 +452,25 @@ class Net:
423
452
  yield from self.get_design_terms()
424
453
  yield from self.get_inst_terms()
425
454
 
455
+ def get_attributes(self) -> Iterator[Attribute]:
456
+ """Iterate over the attributes of this Net.
457
+
458
+ :return: the attributes of this Net.
459
+ :rtype: Iterator[Attribute]
460
+ """
461
+ if hasattr(self, "net"):
462
+ snlnet = self.net
463
+ for attribute in snlnet.getAttributes():
464
+ yield Attribute(attribute)
465
+
466
+ def count_attributes(self) -> int:
467
+ """Count the attributes of this Net.
468
+
469
+ :return: the number of attributes of this Net.
470
+ :rtype: int
471
+ """
472
+ return sum(1 for _ in self.get_attributes())
473
+
426
474
 
427
475
  def get_snl_term_for_ids(pathIDs, termIDs):
428
476
  path = get_snl_path_from_id_list(pathIDs)
@@ -638,6 +686,24 @@ class Term:
638
686
  elif snlterm.getDirection() == naja.SNLTerm.Direction.InOut:
639
687
  return Term.Direction.INOUT
640
688
 
689
+ def get_attributes(self) -> Iterator[Attribute]:
690
+ """Iterate over the attributes of this Term.
691
+
692
+ :return: the attributes of this Term.
693
+ :rtype: Iterator[Attribute]
694
+ """
695
+ snlterm = get_snl_term_for_ids(self.pathIDs, self.termIDs)
696
+ for attribute in snlterm.getAttributes():
697
+ yield Attribute(attribute)
698
+
699
+ def count_attributes(self) -> int:
700
+ """Count the attributes of this Term.
701
+
702
+ :return: the number of attributes of this Term.
703
+ :rtype: int
704
+ """
705
+ return sum(1 for _ in self.get_attributes())
706
+
641
707
  def get_combinatorial_inputs(self):
642
708
  """Get all combinatorial input terms of this instance.
643
709
 
@@ -894,35 +960,6 @@ def get_instance_by_path(names: list):
894
960
  return get_top().get_child_instance(names)
895
961
 
896
962
 
897
- class Attribute:
898
- def __init__(self, snlAttribute):
899
- self.snlAttribute = snlAttribute
900
-
901
- def __str__(self):
902
- return str(self.snlAttribute)
903
-
904
- def get_name(self):
905
- """
906
- :return: the name of the attribute.
907
- :rtype: str
908
- """
909
- return self.snlAttribute.getName()
910
-
911
- def has_value(self):
912
- """
913
- :return: True if the attribute has a value.
914
- :rtype: bool
915
- """
916
- return self.snlAttribute.hasValue()
917
-
918
- def get_value(self):
919
- """
920
- :return: the value of the attribute.
921
- :rtype: str
922
- """
923
- return self.snlAttribute.getValue()
924
-
925
-
926
963
  class Instance:
927
964
  """Class that represents an instance in the design hierarchy.
928
965
  """
@@ -1831,7 +1868,7 @@ def apply_constant_propagation():
1831
1868
  naja.NLUniverse.get().applyConstantPropagation()
1832
1869
 
1833
1870
 
1834
- def get_max_fanout() -> int:
1871
+ def get_max_fanout() -> list:
1835
1872
  """Get the maximum fanout of the top design.
1836
1873
 
1837
1874
  :return: the maximum fanout of the top design.
@@ -1841,11 +1878,39 @@ def get_max_fanout() -> int:
1841
1878
  if u is not None:
1842
1879
  top = naja.NLUniverse.get().getTopDesign()
1843
1880
  if top is not None:
1844
- return naja.NLUniverse.get().getMaxFanout()
1845
- return 0
1846
-
1847
-
1848
- def get_max_logic_level() -> int:
1881
+ max_fanout = naja.NLUniverse.get().getMaxFanout()
1882
+ result = []
1883
+ index = 0
1884
+ result.append(max_fanout[0])
1885
+ fanouts = []
1886
+ for entry in max_fanout[1]:
1887
+ fanout = []
1888
+ driver = entry[0]
1889
+ component = driver.getComponent()
1890
+ path = driver.getPath().getPathIDs()
1891
+ if isinstance(component, naja.SNLInstTerm):
1892
+ path.append(component.getInstance().getID())
1893
+ component = component.getBitTerm()
1894
+ print(component)
1895
+ print(path)
1896
+ fanout.append(Term(path, component))
1897
+ readers = []
1898
+ for item in entry[1]:
1899
+ component = item.getComponent()
1900
+ path = item.getPath().getPathIDs()
1901
+ if isinstance(component, naja.SNLInstTerm):
1902
+ path.append(component.getInstance().getID())
1903
+ component = component.getBitTerm()
1904
+ readers.append(Term(path, component))
1905
+ fanout.append(readers)
1906
+ fanouts.append(fanout)
1907
+ index += 1
1908
+ result.append(fanouts)
1909
+ return result
1910
+ return [0]
1911
+
1912
+
1913
+ def get_max_logic_level() -> list:
1849
1914
  """Get the maximum logic level of the top design.
1850
1915
 
1851
1916
  :return: the maximum logic level of the top design.
@@ -1855,5 +1920,25 @@ def get_max_logic_level() -> int:
1855
1920
  if u is not None:
1856
1921
  top = naja.NLUniverse.get().getTopDesign()
1857
1922
  if top is not None:
1858
- return naja.NLUniverse.get().getMaxLogicLevel()
1859
- return 0
1923
+ max_logic_level = naja.NLUniverse.get().getMaxLogicLevel()
1924
+ result = []
1925
+ index = 0
1926
+ for entry in max_logic_level:
1927
+ if index == 0:
1928
+ result.append(max_logic_level[0])
1929
+ else:
1930
+ paths = []
1931
+ for path in entry:
1932
+ llpath = []
1933
+ for item in path:
1934
+ component = item.getComponent()
1935
+ pathIDs = item.getPath().getPathIDs()
1936
+ if isinstance(component, naja.SNLInstTerm):
1937
+ pathIDs.append(component.getInstance().getID())
1938
+ component = component.getBitTerm()
1939
+ llpath.append(Term(pathIDs, component))
1940
+ paths.append(llpath)
1941
+ result.append(paths)
1942
+ index += 1
1943
+ return result
1944
+ return [0]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: najaeda
3
- Version: 0.2.10
3
+ Version: 0.2.12
4
4
  Summary: Naja EDA Python package
5
5
  Author-Email: Naja Authors <contact@keplertech.io>
6
6
  License: Apache License 2.0
@@ -1,22 +1,22 @@
1
- najaeda-0.2.10.dist-info/RECORD,,
2
- najaeda-0.2.10.dist-info/WHEEL,sha256=a5hFNLnG478el62xhySpcm13yln7Jlz1BenyGRdoSlE,114
3
- najaeda-0.2.10.dist-info/METADATA,sha256=-9uJNNWWDpC0ofYCIvFlQgusbbd5iMvBmz60oz5HspE,3656
4
- najaeda-0.2.10.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
- najaeda-0.2.10.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
6
- najaeda/netlist.py,sha256=iDaELvPq9irnAPmk6F7LqjP0W6w9uUpb3b_UG900Q-g,63744
7
- najaeda/libnaja_nl.dylib,sha256=G0kN6sg7R5sLwPFDL2jPZHjUPFbzA-CWycVTuYLowoo,774400
1
+ najaeda-0.2.12.dist-info/RECORD,,
2
+ najaeda-0.2.12.dist-info/WHEEL,sha256=a5hFNLnG478el62xhySpcm13yln7Jlz1BenyGRdoSlE,114
3
+ najaeda-0.2.12.dist-info/METADATA,sha256=hSlx5YMwg6ZliqOfS5k6qHjF9kx0i_m6g6z-ulC5TAc,3656
4
+ najaeda-0.2.12.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
+ najaeda-0.2.12.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
6
+ najaeda/netlist.py,sha256=f36j5CT2pEV9qqQwJmkAe-1vU8n8Smied4XTuEFkcok,67034
7
+ najaeda/libnaja_nl.dylib,sha256=wW6MuM89Q6WIK-GqDuFJrbHvb06IY8fX9LE1ijytHEo,774480
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=InUjeTwg_gRulIBrVozhkA6jgP6DScuzWu1eqQwQiiU,99440
11
+ najaeda/naja.so,sha256=O4ik-tGZn4n0T2h_G-hrzZTCk6jNWH-hsFU6lAJ9N7w,99440
12
12
  najaeda/net_visitor.py,sha256=P_esjibYb-wBDuF-AyF7es9sJYw1Ha8RhTPu-qKe7G4,1940
13
13
  najaeda/libnaja_opt.dylib,sha256=vW8P49UplpYdjSxqU3TeaV2s9ck75Spq5ZcrN3ET0f4,212720
14
- najaeda/libnaja_python.dylib,sha256=8PARxZfekFTxgjZSd-VCklRkSiPsM1rGJkZWi4Fi1Dw,962128
14
+ najaeda/libnaja_python.dylib,sha256=Vt0E2AbFgiqX5Jmfl2CNXjdo8EK_D1t5IZMcFonc0l0,962688
15
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/libnaja_metrics.dylib,sha256=Nj1HCvjZR1q4PiWnwKiRHIJ0XFdhsX8XwSLNxXGrl0A,106864
19
- najaeda/libnaja_dnl.dylib,sha256=QJ6_p0xWdPZn0T1MmPQ74j3FRXkQliM_7E8KQiotRzg,148000
18
+ najaeda/libnaja_metrics.dylib,sha256=83UJKTRmqtEvUZokv539CWcCENvd8lOf5U2SfgXnT7E,123440
19
+ najaeda/libnaja_dnl.dylib,sha256=B2jj02K-4rzjeAYCpXShrgNDjm9I1gz4e50n_DugUgg,148096
20
20
  najaeda/native/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  najaeda/native/stats.py,sha256=t50hhE9pEFNtlssjES0A-K9TsO_2ZSUAb-e9L3Rt6yc,13063
22
22
  najaeda/docs/requirements.txt,sha256=1XIBGTIplm2arC9HhDCfLuAjozGdVSXkqmOj8ybuT6U,121