najaeda 0.1.17__cp39-cp39-macosx_11_0_arm64.whl → 0.1.22__cp39-cp39-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.

@@ -15,7 +15,7 @@ sys.path.insert(0, os.path.abspath('../../../'))
15
15
  project = 'najaeda'
16
16
  copyright = '2024, Naja authors'
17
17
  author = 'Naja authors'
18
- release = '0.1.9'
18
+ release = '0.1.22'
19
19
 
20
20
  # -- General configuration ---------------------------------------------------
21
21
  # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -27,7 +27,7 @@ extensions = [
27
27
  'sphinx.ext.todo', # (Optional) For TODOs in the documentation
28
28
  ]
29
29
 
30
- autodoc_mock_imports = ["najaeda.snl"]
30
+ autodoc_mock_imports = ["najaeda.naja"]
31
31
  templates_path = ['_templates']
32
32
  exclude_patterns = []
33
33
 
najaeda/libnaja_dnl.dylib CHANGED
Binary file
najaeda/libnaja_opt.dylib CHANGED
Binary file
Binary file
najaeda/naja.so CHANGED
Binary file
najaeda/netlist.py CHANGED
@@ -11,6 +11,7 @@ import struct
11
11
  import sys
12
12
  import os
13
13
  from enum import Enum
14
+ from typing import Union, List
14
15
 
15
16
  from najaeda import naja
16
17
 
@@ -455,9 +456,9 @@ class Term:
455
456
  term_str = (
456
457
  f"{path}/{get_snl_term_for_ids(self.pathIDs, self.termIDs).getName()}"
457
458
  )
458
- if self.is_bus:
459
+ if self.is_bus():
459
460
  term_str += f"[{self.get_msb()}:{self.get_lsb()}]"
460
- elif self.is_bus_bit:
461
+ elif self.is_bus_bit():
461
462
  term_str += f"[{self.get_lsb()}]"
462
463
  return term_str
463
464
 
@@ -978,7 +979,7 @@ class Instance:
978
979
  yield Instance(path_child)
979
980
  # path.pop()
980
981
 
981
- def get_number_of_child_instances(self) -> int:
982
+ def count_child_instances(self) -> int:
982
983
  """
983
984
  :return: the number of child instances of this instance.
984
985
  :rtype: int
@@ -1010,6 +1011,14 @@ class Instance:
1010
1011
  for net in self.__get_snl_model().getNets():
1011
1012
  yield Net(self.pathIDs, net)
1012
1013
 
1014
+ def count_nets(self) -> int:
1015
+ """Count the number of scalar nets and bus nets of this Instance.
1016
+
1017
+ :return: the number of nets of this Instance.
1018
+ :rtype: int
1019
+ """
1020
+ return sum(1 for _ in self.get_nets())
1021
+
1013
1022
  def get_flat_nets(self):
1014
1023
  """Iterate over all scalar nets and bus net bits.
1015
1024
 
@@ -1023,6 +1032,14 @@ class Instance:
1023
1032
  else:
1024
1033
  yield Net(self.pathIDs, net)
1025
1034
 
1035
+ def count_flat_nets(self) -> int:
1036
+ """Count the number of scalar nets and bus net bits of this Instance.
1037
+
1038
+ :return: the number of flat nets of this Instance.
1039
+ :rtype: int
1040
+ """
1041
+ return sum(1 for _ in self.get_flat_nets())
1042
+
1026
1043
  def get_net(self, name: str) -> Net:
1027
1044
  """
1028
1045
  :param str name: the name of the Net to get.
@@ -1050,6 +1067,14 @@ class Instance:
1050
1067
  for term in self.__get_snl_model().getTerms():
1051
1068
  yield Term(self.pathIDs, term)
1052
1069
 
1070
+ def count_terms(self) -> int:
1071
+ """Count the number of scalar terms and bus terms of this Instance.
1072
+
1073
+ :return: the number of terms of this Instance.
1074
+ :rtype: int
1075
+ """
1076
+ return sum(1 for _ in self.get_terms())
1077
+
1053
1078
  def get_flat_terms(self):
1054
1079
  """Iterate over all scalar terms and bus term bits.
1055
1080
 
@@ -1059,6 +1084,14 @@ class Instance:
1059
1084
  for term in self.__get_snl_model().getBitTerms():
1060
1085
  yield Term(self.pathIDs, term)
1061
1086
 
1087
+ def count_flat_terms(self) -> int:
1088
+ """Count the number of scalar terms and bus term bits of this Instance.
1089
+
1090
+ :return: the number of flat terms of this Instance.
1091
+ :rtype: int
1092
+ """
1093
+ return sum(1 for _ in self.get_flat_terms())
1094
+
1062
1095
  def get_term(self, name: str) -> Term:
1063
1096
  """
1064
1097
  :param str name: the name of the Term to get.
@@ -1081,6 +1114,15 @@ class Instance:
1081
1114
  if term.getDirection() != naja.SNLTerm.Direction.Output:
1082
1115
  yield Term(self.pathIDs, term)
1083
1116
 
1117
+ def count_input_terms(self) -> int:
1118
+ """Count the number of scalar input terms and bus input terms
1119
+ of this Instance.
1120
+
1121
+ :return: the number of input terms of this Instance.
1122
+ :rtype: int
1123
+ """
1124
+ return sum(1 for _ in self.get_input_terms())
1125
+
1084
1126
  def get_flat_input_terms(self):
1085
1127
  """Iterate over all scalar input terms and bus input term bits
1086
1128
  of this Instance.
@@ -1096,6 +1138,15 @@ class Instance:
1096
1138
  else:
1097
1139
  yield Term(self.pathIDs, term)
1098
1140
 
1141
+ def count_flat_input_terms(self) -> int:
1142
+ """Count the number of scalar input terms and bus input term bits
1143
+ of this Instance.
1144
+
1145
+ :return: the number of flat input terms of this Instance.
1146
+ :rtype: int
1147
+ """
1148
+ return sum(1 for _ in self.get_flat_input_terms())
1149
+
1099
1150
  def get_output_terms(self):
1100
1151
  """Iterate over all scalar output terms and bus output terms
1101
1152
  of this Instance.
@@ -1107,6 +1158,15 @@ class Instance:
1107
1158
  if term.getDirection() != naja.SNLTerm.Direction.Input:
1108
1159
  yield Term(self.pathIDs, term)
1109
1160
 
1161
+ def count_output_terms(self) -> int:
1162
+ """Count the number of scalar output terms and bus output terms
1163
+ of this Instance.
1164
+
1165
+ :return: the number of output terms of this Instance.
1166
+ :rtype: int
1167
+ """
1168
+ return sum(1 for _ in self.get_output_terms())
1169
+
1110
1170
  def get_flat_output_terms(self):
1111
1171
  """Iterate over all scalar output terms and bus output term bits
1112
1172
  of this Instance.
@@ -1122,6 +1182,15 @@ class Instance:
1122
1182
  else:
1123
1183
  yield Term(self.pathIDs, term)
1124
1184
 
1185
+ def count_flat_output_terms(self) -> int:
1186
+ """Count the number of scalar output terms and bus output term bits
1187
+ of this Instance.
1188
+
1189
+ :return: the number of flat output terms of this Instance.
1190
+ :rtype: int
1191
+ """
1192
+ return sum(1 for _ in self.get_flat_output_terms())
1193
+
1125
1194
  def get_attributes(self):
1126
1195
  """Iterate over the attributes of this Instance.
1127
1196
 
@@ -1399,7 +1468,14 @@ class VerilogConfig:
1399
1468
  self.keep_assigns = keep_assigns
1400
1469
 
1401
1470
 
1402
- def load_verilog(files: list, config: VerilogConfig = None) -> Instance:
1471
+ def load_verilog(files: Union[str, List[str]], config: VerilogConfig = None) -> Instance:
1472
+ """Load verilog files into the top design.
1473
+ :param files: a list of verilog files to load or a single file.
1474
+ :param config: the configuration to use when loading the files.
1475
+ :return: the top Instance.
1476
+ """
1477
+ if isinstance(files, str):
1478
+ files = [files]
1403
1479
  if not files or len(files) == 0:
1404
1480
  raise Exception("No verilog files provided")
1405
1481
  if config is None:
@@ -1412,7 +1488,14 @@ def load_verilog(files: list, config: VerilogConfig = None) -> Instance:
1412
1488
  return get_top()
1413
1489
 
1414
1490
 
1415
- def load_liberty(files: list):
1491
+ def load_liberty(files: Union[str, List[str]]):
1492
+ """Load liberty files.
1493
+ :param files: a list of liberty files to load or a single file.
1494
+ """
1495
+ if isinstance(files, str):
1496
+ files = [files]
1497
+ if not files or len(files) == 0:
1498
+ raise Exception("No liberty files provided")
1416
1499
  logging.info(f"Loading liberty files: {', '.join(files)}")
1417
1500
  __get_top_db().loadLibertyPrimitives(files)
1418
1501
 
@@ -1477,3 +1560,17 @@ def get_model_name(id: tuple[int, int, int]) -> str:
1477
1560
  if model:
1478
1561
  return model.getName()
1479
1562
  return None
1563
+
1564
+
1565
+ def apply_dle():
1566
+ """Apply the DLE (Dead Logic Elimination) to the top design."""
1567
+ top = naja.NLUniverse.get().getTopDesign()
1568
+ if top is not None:
1569
+ naja.NLUniverse.get().applyDLE()
1570
+
1571
+
1572
+ def apply_constant_propagation():
1573
+ """Apply constant propagation to the top design."""
1574
+ top = naja.NLUniverse.get().getTopDesign()
1575
+ if top is not None:
1576
+ naja.NLUniverse.get().applyConstantPropagation()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: najaeda
3
- Version: 0.1.17
3
+ Version: 0.1.22
4
4
  Summary: Naja EDA Python package
5
5
  Author-Email: Naja Authors <contact@keplertech.io>
6
6
  License: Apache License 2.0
@@ -1,27 +1,27 @@
1
- najaeda-0.1.17.dist-info/RECORD,,
2
- najaeda-0.1.17.dist-info/WHEEL,sha256=gUcXopd-K2IKuDoaEe4uBUYaf2fjHRiHplXdACpNr9A,112
3
- najaeda-0.1.17.dist-info/METADATA,sha256=kOcF0pRa4WGiLp5MFPu1H2cfTeTz66ZaLNDuHVSmvWs,2475
4
- najaeda-0.1.17.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
- najaeda-0.1.17.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
6
- najaeda/netlist.py,sha256=f_lr0sbwk6NZbLWDfgCNqwqbIaxZxac0GA8JhTJ5DS4,50187
1
+ najaeda-0.1.22.dist-info/RECORD,,
2
+ najaeda-0.1.22.dist-info/WHEEL,sha256=Bp5NfjQuMM_4-YV1MlnhqEfxPV5ySj3kUtyINz66rJc,112
3
+ najaeda-0.1.22.dist-info/METADATA,sha256=yODu-S8hBOfAa8gE_obfi9DKrlaWUMBz89ZZb9fk10A,2475
4
+ najaeda-0.1.22.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
+ najaeda-0.1.22.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
6
+ najaeda/netlist.py,sha256=donwdHm7eKBQNTkjdTTt9lAqKxSbSSYF3CTmN1UafkY,53396
7
7
  najaeda/libnaja_nl.dylib,sha256=O1pfUil1jLkWu89X3JGpKyTwuVqmpsnwZDOESYqjqeU,713152
8
8
  najaeda/pandas_stats.py,sha256=yOb4ka965U7rN4D6AwvSGmRyeT_O7Ed-5cmT8BFbfeo,1070
9
9
  najaeda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- najaeda/naja.so,sha256=CUaXZt5Q5dUvyS-Y3oRUMiJlcljdW0NWgsAmR1HUNec,99440
10
+ najaeda/naja.so,sha256=MR_bQ_U1LJRg_rHuKma1ReUGEUewKzUZTbVI5B6FQUE,99440
11
11
  najaeda/net_visitor.py,sha256=P_esjibYb-wBDuF-AyF7es9sJYw1Ha8RhTPu-qKe7G4,1940
12
- najaeda/libnaja_opt.dylib,sha256=-k7rJk_5L6nwKfBhgy3zAWU9GKdVjfp1r0iIx_K8mC0,190816
13
- najaeda/libnaja_python.dylib,sha256=MGD5pydoh4mRtpFnw_xgDqkTS1OlTDzZKF9CKRsDF6k,903808
12
+ najaeda/libnaja_opt.dylib,sha256=91kz37-SLpztC7x1F_VYZlddwzCBoNVaD6NqL7OL2GQ,190816
13
+ najaeda/libnaja_python.dylib,sha256=T2F6x0X3vz_a_RLdKaQOS6XsHZhiPfBZ9czNWbOkAiM,904240
14
14
  najaeda/stats.py,sha256=wackXsf0x24ic9v-UifECHj4t5yveUWssMDZp2B057A,16187
15
15
  najaeda/instance_visitor.py,sha256=JMsPSQaWNiDjxS05rxg83a0PIsrOIuTi9G35hkwdibs,1530
16
16
  najaeda/libnaja_bne.dylib,sha256=r9-g0qCILL6w_BgXYg62karCWloSPSpdNGEeS2Ey0Jk,134064
17
- najaeda/libnaja_dnl.dylib,sha256=kH9Jzdbvj14dlzSSU8hPctvWn6r1qBh6GYOdPWFwLBs,145840
17
+ najaeda/libnaja_dnl.dylib,sha256=zWsiT-RPDJz9koiDDUHqGNFzSFz7x2SmlIo5PTLkTUs,145936
18
18
  najaeda/native/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  najaeda/native/stats.py,sha256=t50hhE9pEFNtlssjES0A-K9TsO_2ZSUAb-e9L3Rt6yc,13063
20
20
  najaeda/docs/requirements.txt,sha256=1XIBGTIplm2arC9HhDCfLuAjozGdVSXkqmOj8ybuT6U,121
21
21
  najaeda/docs/.readthedocs.yaml,sha256=nN_Psro-YdfPcIiueZkJcZepts68g23rqVThhKnmVRw,790
22
22
  najaeda/docs/source/index.rst,sha256=80VMfeEGHObnOUXRBxIzISQsG_HNkgT-pUpsDZsCfOY,387
23
23
  najaeda/docs/source/instance.rst,sha256=7B2IBB0p32Tb4qvOCE77OlrQaYpFADvmTlq1q8eyVqw,458
24
- najaeda/docs/source/conf.py,sha256=iSeerg2pJlZlhtwkJ9edRRYrLEdx3R1p7GWi78dHP1o,2019
24
+ najaeda/docs/source/conf.py,sha256=XqCFo29gZCbaoPe1xEan9ZonYyQW5NZnWHGEWrB7p8Q,2021
25
25
  najaeda/docs/source/preprocessor.py,sha256=TK4LsTdNbv2dxkKQaJ7cEyo9PU5v_56vlrFCJYIPKf8,2625
26
26
  najaeda/docs/source/term.rst,sha256=QKWT6u1xjEjusvcZYknKQ-M83ibohO5y1EYTQnnXqak,690
27
27
  najaeda/docs/source/net.rst,sha256=i6YEir8ZOldSY8-UmPxgVJ4Ot3y-Q6seRkBr2H-KmXc,732
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: scikit-build-core 0.11.4
2
+ Generator: scikit-build-core 0.11.5
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp39-cp39-macosx_11_0_arm64
5
5