najaeda 0.1.5__cp313-cp313-macosx_11_0_arm64.whl → 0.1.7__cp313-cp313-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/docs/.readthedocs.yaml +37 -0
- najaeda/docs/Makefile +20 -0
- najaeda/docs/conf.py +26 -0
- najaeda/docs/make.bat +35 -0
- najaeda/docs/source/api.rst +7 -0
- najaeda/docs/source/conf.py +40 -0
- najaeda/docs/source/index.rst +13 -0
- najaeda/instance_visitor.py +12 -6
- najaeda/libnaja_snl.dylib +0 -0
- najaeda/libnaja_snl_python.dylib +0 -0
- najaeda/netlist.py +346 -144
- najaeda-0.1.7.dist-info/METADATA +192 -0
- najaeda-0.1.7.dist-info/RECORD +20 -0
- najaeda-0.1.5.dist-info/METADATA +0 -102
- najaeda-0.1.5.dist-info/RECORD +0 -13
- {najaeda-0.1.5.dist-info → najaeda-0.1.7.dist-info}/WHEEL +0 -0
- {najaeda-0.1.5.dist-info → najaeda-0.1.7.dist-info}/licenses/AUTHORS +0 -0
- {najaeda-0.1.5.dist-info → najaeda-0.1.7.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: najaeda
|
|
3
|
+
Version: 0.1.7
|
|
4
|
+
Summary: Naja EDA Python package
|
|
5
|
+
Author-Email: Naja Authors <contact@keplertech.io>
|
|
6
|
+
License: Apache License 2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/najaeda/naja
|
|
8
|
+
Requires-Python: >=3.8
|
|
9
|
+
Description-Content-Type: text/x-rst
|
|
10
|
+
|
|
11
|
+
Naja EDA Python Package
|
|
12
|
+
=======================
|
|
13
|
+
|
|
14
|
+
Naja EDA is a Python package that provides data structures and APIs for developing post-synthesis Electronic Design Automation (EDA) algorithms.
|
|
15
|
+
|
|
16
|
+
Naja EDA provides a powerful yet simple framework designed to help software
|
|
17
|
+
and hardware developers efficiently navigate and manipulate electronic
|
|
18
|
+
design automation (EDA) workflows.
|
|
19
|
+
|
|
20
|
+
With Naja EDA, you can:
|
|
21
|
+
|
|
22
|
+
* Explore Netlists with Ease:
|
|
23
|
+
|
|
24
|
+
* Navigate netlist hierarchy and connectivity effortlessly.
|
|
25
|
+
* Browse at multiple levels of detail:
|
|
26
|
+
|
|
27
|
+
* Bit-level or bus-level granularity.
|
|
28
|
+
* Instance-by-instance exploration or flattened views at the primitives level.
|
|
29
|
+
* Localized per-instance connections or comprehensive equipotential views.
|
|
30
|
+
|
|
31
|
+
* Perform ECO (Engineering Change Order) Transformations:
|
|
32
|
+
|
|
33
|
+
* Seamlessly apply and manage changes to your designs.
|
|
34
|
+
|
|
35
|
+
* Prototype EDA Ideas Quickly:
|
|
36
|
+
|
|
37
|
+
* Use an intuitive API to experiment with new EDA concepts and workflows.
|
|
38
|
+
|
|
39
|
+
* Develop Custom EDA Tools:
|
|
40
|
+
|
|
41
|
+
* Build fast, tailored tools for solving specific challenges without relying on costly, proprietary EDA software.
|
|
42
|
+
|
|
43
|
+
Naja EDA empowers developers to innovate, adapt, and accelerate their EDA
|
|
44
|
+
processes with minimal overhead.
|
|
45
|
+
|
|
46
|
+
Naja EDA is the Python counterpart of the `Naja C++ project <https://github.com/najaeda/naja>`_.
|
|
47
|
+
|
|
48
|
+
Installation
|
|
49
|
+
------------
|
|
50
|
+
|
|
51
|
+
Install Naja EDA using pip:
|
|
52
|
+
|
|
53
|
+
.. code-block:: bash
|
|
54
|
+
|
|
55
|
+
pip install najaeda
|
|
56
|
+
|
|
57
|
+
Examples
|
|
58
|
+
--------
|
|
59
|
+
|
|
60
|
+
Load a design from a liberty file and a Verilog file
|
|
61
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
62
|
+
Following snippet shows how to load primitive cells from a liberty file and
|
|
63
|
+
a netlist from a Verilog file.
|
|
64
|
+
|
|
65
|
+
.. code-block:: python
|
|
66
|
+
|
|
67
|
+
benchmarks = path.join('..','benchmarks')
|
|
68
|
+
liberty_files = [
|
|
69
|
+
'NangateOpenCellLibrary_typical.lib',
|
|
70
|
+
'fakeram45_1024x32.lib',
|
|
71
|
+
'fakeram45_64x32.lib'
|
|
72
|
+
]
|
|
73
|
+
liberty_files = list(map(lambda p:path.join(benchmarks, 'liberty', p), liberty_files))
|
|
74
|
+
|
|
75
|
+
netlist.load_liberty(liberty_files)
|
|
76
|
+
top = netlist.load_verilog([path.join(benchmarks, 'verilog', 'tinyrocket.v')])
|
|
77
|
+
|
|
78
|
+
top.dump_verilog('.', 'tinyrocket_naja.v')
|
|
79
|
+
|
|
80
|
+
Load a design with pre-existing libraries
|
|
81
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
82
|
+
In FPGA design environments, Liberty files are often unavailable.
|
|
83
|
+
|
|
84
|
+
To address this, the following example demonstrates how to load primitives
|
|
85
|
+
without relying on Liberty files.
|
|
86
|
+
|
|
87
|
+
Naja EDA comes with pre-configured libraries to simplify this process.
|
|
88
|
+
Currently, it includes support for partial Xilinx primitives, but this can be
|
|
89
|
+
easily extended in the future. Don't hesitate to reach out if you need help.
|
|
90
|
+
|
|
91
|
+
.. code-block:: python
|
|
92
|
+
|
|
93
|
+
netlist.load_primitives('xilinx')
|
|
94
|
+
benchmarks = path.join('..','benchmarks')
|
|
95
|
+
top = netlist.load_verilog([path.join(benchmarks, 'verilog', 'arm_core_netlist.v')])
|
|
96
|
+
|
|
97
|
+
Print all the instances in the netlist
|
|
98
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
99
|
+
Next example shows how to browse all the netlist and print all its content recursively.
|
|
100
|
+
|
|
101
|
+
.. code-block:: python
|
|
102
|
+
|
|
103
|
+
def print_netlist(instance):
|
|
104
|
+
for child_instance in instance.get_child_instances():
|
|
105
|
+
print(f"{child_instance}:{child_instance.get_model_name()}")
|
|
106
|
+
print_netlist(child_instance)
|
|
107
|
+
|
|
108
|
+
Similar to the previous example, but utilizing an instance visitor.
|
|
109
|
+
This approach allows you to perform operations on each instance while
|
|
110
|
+
also defining conditions for stopping or continuing exploration.
|
|
111
|
+
|
|
112
|
+
.. code-block:: python
|
|
113
|
+
|
|
114
|
+
def print_instance(instance):
|
|
115
|
+
print(f"{instance}:{instance.get_model_name()}")
|
|
116
|
+
visitor_config = instance_visitor.VisitorConfig(callback=print_instance)
|
|
117
|
+
instance_visitor.Visitor(top).visit(top, visitor_config)
|
|
118
|
+
|
|
119
|
+
Counting the Number of Leaves in a Netlist
|
|
120
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
121
|
+
The instance visitor provides a tool for collecting various types of information
|
|
122
|
+
about a netlist.
|
|
123
|
+
|
|
124
|
+
The following example demonstrates how to use the visitor’s callback
|
|
125
|
+
function to transmit user-defined arguments, allowing for flexible data processing.
|
|
126
|
+
|
|
127
|
+
This specific use case shows how to count the number of leaf instances in a netlist.
|
|
128
|
+
|
|
129
|
+
.. code-block:: python
|
|
130
|
+
|
|
131
|
+
leaves = {"count": 0, "assigns": 0, "constants": 0}
|
|
132
|
+
def count_leaves(instance, leaves):
|
|
133
|
+
if instance.is_leaf():
|
|
134
|
+
if instance.is_assign():
|
|
135
|
+
leaves["assigns"] += 1
|
|
136
|
+
elif instance.is_const():
|
|
137
|
+
leaves["constants"] += 1
|
|
138
|
+
else:
|
|
139
|
+
leaves["count"] += 1
|
|
140
|
+
visitor_config = instance_visitor.VisitorConfig(callback=count_leaves, args=(leaves,))
|
|
141
|
+
instance_visitor.Visitor(top).visit(top, visitor_config)
|
|
142
|
+
print(f"{top} leaves count")
|
|
143
|
+
print(f"nb_assigns={leaves['assigns']}")
|
|
144
|
+
print(f"nb constants={leaves['constants']}")
|
|
145
|
+
print(f"nb other leaves={leaves['count']}")
|
|
146
|
+
|
|
147
|
+
DLE (Dead Logic Elimination)
|
|
148
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
149
|
+
This example demonstrates how to perform Dead Logic Elimination (DLE) on a netlist.
|
|
150
|
+
|
|
151
|
+
.. code-block:: python
|
|
152
|
+
|
|
153
|
+
def apply_dle(top):
|
|
154
|
+
# Trace back from design outputs
|
|
155
|
+
visited = set()
|
|
156
|
+
output_terms = top.get_flat_output_terms()
|
|
157
|
+
for termToTrace in output_terms:
|
|
158
|
+
queue = deque([termToTrace])
|
|
159
|
+
while queue:
|
|
160
|
+
term = queue.popleft()
|
|
161
|
+
if term in visited:
|
|
162
|
+
continue
|
|
163
|
+
visited.add(term)
|
|
164
|
+
equipotential = term.get_equipotential()
|
|
165
|
+
leaf_drivers = equipotential.get_leaf_drivers()
|
|
166
|
+
for driver in leaf_drivers:
|
|
167
|
+
instance = driver.get_instance()
|
|
168
|
+
instances.add(instance)
|
|
169
|
+
input_terms = instance.get_flat_input_terms()
|
|
170
|
+
queue.extend(input_terms)
|
|
171
|
+
|
|
172
|
+
leaf_children = top.get_leaf_children()
|
|
173
|
+
to_delete = [leaf for leaf in leaf_children if leaf not in instances]
|
|
174
|
+
for leaf in to_delete:
|
|
175
|
+
leaf.delete()
|
|
176
|
+
return to_delete
|
|
177
|
+
|
|
178
|
+
Documentation
|
|
179
|
+
-------------
|
|
180
|
+
Naja EDA is a work in progress, and the documentation is still under development.
|
|
181
|
+
|
|
182
|
+
Naja documentation is available on the `Naja GitHub repository <https://github.com/najaeda/naja>`_.
|
|
183
|
+
|
|
184
|
+
Support
|
|
185
|
+
-------
|
|
186
|
+
If you encounter any issues or have questions, please report them on the
|
|
187
|
+
`Naja issue tracker <https://github.com/najaeda/naja/issues>`_.
|
|
188
|
+
|
|
189
|
+
License
|
|
190
|
+
-------
|
|
191
|
+
This project is licensed under the Apache License 2.0. \
|
|
192
|
+
See the `LICENSE <https://github.com/najaeda/naja/blob/main/LICENSE>`_ file for details.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
najaeda/netlist.py,sha256=_ojRBNwyvfcrsuoNRpCc1LCIo6uzFQSQcmaTR7qvOQc,34660
|
|
2
|
+
najaeda/libnaja_snl_python.dylib,sha256=XJHXYPE65M-5OAjGlymgDaMrL-yCLezs5T4XIPliSAo,741024
|
|
3
|
+
najaeda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
najaeda/libnaja_snl.dylib,sha256=AFqR64aX6KnzkX6lrLGCuscx2f5E07umNC_7E9cNrT0,574272
|
|
5
|
+
najaeda/snl.so,sha256=nwbhD_k8zYEQZh-LsCexOj9j2uSibNAeUnWTxwUy1iM,97888
|
|
6
|
+
najaeda/instance_visitor.py,sha256=2HnQ5y8-0tSOKd9nS4WYiypccQWLJgKfs84wp357Tls,1781
|
|
7
|
+
najaeda/docs/Makefile,sha256=4zv3TVkTACm6JBaKgTES3ZI9cETXgM6ULbZkXZP1as8,638
|
|
8
|
+
najaeda/docs/conf.py,sha256=XmqDjqssSJswFPmC7RhVS_dYKOjzML4UmrbhUowF78M,653
|
|
9
|
+
najaeda/docs/make.bat,sha256=L4I5T7uDUIjwGyMRJ-y9FoT61sxIyCuaYuJyLt8c-nA,804
|
|
10
|
+
najaeda/docs/.readthedocs.yaml,sha256=yP012ik240oBTMApJYBOvjhNzFDzsAI4vmqX1R7KDrA,988
|
|
11
|
+
najaeda/docs/source/index.rst,sha256=VBWfJySZ9v8mWfWt3kuSCZh7Gp0zUrFjXGQH7tZZfy0,323
|
|
12
|
+
najaeda/docs/source/conf.py,sha256=3qkykCg12ZYqawHl8VEg2Fti6rc3G-soGYM0L6zL3CU,1387
|
|
13
|
+
najaeda/docs/source/api.rst,sha256=H2Bw0JmHS9z-NhQARepmH74wsWHzjSVPbeXppSmtgCQ,141
|
|
14
|
+
najaeda/primitives/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
najaeda/primitives/xilinx.py,sha256=fuu4KxEIuC0ueCK4C_gds6hzgtJsLE3tjDtOHtY9McM,25947
|
|
16
|
+
najaeda-0.1.7.dist-info/RECORD,,
|
|
17
|
+
najaeda-0.1.7.dist-info/WHEEL,sha256=PJzLOGr1UQbVJ9ClJnwqiFhnlyWYjSsyNgebnLgIQKg,114
|
|
18
|
+
najaeda-0.1.7.dist-info/METADATA,sha256=4ac4lOScunYkRke1pZTzxQiLM3XwMGQxbekUHq2PMdw,6752
|
|
19
|
+
najaeda-0.1.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
20
|
+
najaeda-0.1.7.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
|
najaeda-0.1.5.dist-info/METADATA
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: najaeda
|
|
3
|
-
Version: 0.1.5
|
|
4
|
-
Summary: Naja EDA Python package
|
|
5
|
-
Author-Email: Naja Authors <contact@keplertech.io>
|
|
6
|
-
License: Apache License 2.0
|
|
7
|
-
Project-URL: Homepage, https://github.com/najaeda/naja
|
|
8
|
-
Requires-Python: >=3.8
|
|
9
|
-
Description-Content-Type: text/x-rst
|
|
10
|
-
|
|
11
|
-
Naja EDA Python Package
|
|
12
|
-
=======================
|
|
13
|
-
|
|
14
|
-
Naja EDA is a Python package that provides data structures and APIs for developing post-synthesis Electronic Design Automation (EDA) algorithms.
|
|
15
|
-
It serves as the Python counterpart to the `Naja C++ project <https://github.com/najaeda/naja>`_.
|
|
16
|
-
|
|
17
|
-
Installation
|
|
18
|
-
------------
|
|
19
|
-
|
|
20
|
-
Install Naja EDA using pip:
|
|
21
|
-
|
|
22
|
-
.. code-block:: bash
|
|
23
|
-
|
|
24
|
-
pip install najaeda
|
|
25
|
-
|
|
26
|
-
Examples
|
|
27
|
-
--------
|
|
28
|
-
|
|
29
|
-
Load a design from a liberty file and a Verilog file
|
|
30
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
31
|
-
Following snippet shows how to load primitive cells from a liberty file and
|
|
32
|
-
a netlist from a Verilog file.
|
|
33
|
-
|
|
34
|
-
.. code-block:: python
|
|
35
|
-
|
|
36
|
-
benchmarks = path.join('..','benchmarks')
|
|
37
|
-
liberty_files = [
|
|
38
|
-
'NangateOpenCellLibrary_typical.lib',
|
|
39
|
-
'fakeram45_1024x32.lib',
|
|
40
|
-
'fakeram45_64x32.lib'
|
|
41
|
-
]
|
|
42
|
-
liberty_files = list(map(lambda p:path.join(benchmarks, 'liberty', p), liberty_files))
|
|
43
|
-
|
|
44
|
-
netlist.load_liberty(liberty_files)
|
|
45
|
-
top = netlist.load_verilog([path.join(benchmarks, 'verilog', 'tinyrocket.v')])
|
|
46
|
-
|
|
47
|
-
top.dump_verilog('.', 'tinyrocket_naja.v')
|
|
48
|
-
|
|
49
|
-
Load a design with pre-existing libraries
|
|
50
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
51
|
-
In FPGA design environments, Liberty files are often unavailable.
|
|
52
|
-
To address this, the following example demonstrates how to load primitives
|
|
53
|
-
without relying on Liberty files.
|
|
54
|
-
|
|
55
|
-
najaeda comes with pre-configured libraries to simplify this process.
|
|
56
|
-
Currently, it includes support for partial Xilinx primitives, but this can be
|
|
57
|
-
easily extended in the future. Don't hesitate to reach out if you need help.
|
|
58
|
-
|
|
59
|
-
.. code-block:: python
|
|
60
|
-
|
|
61
|
-
netlist.load_primitives('xilinx')
|
|
62
|
-
benchmarks = path.join('..','benchmarks')
|
|
63
|
-
top = netlist.load_verilog([path.join(benchmarks, 'verilog', 'arm_core_netlist.v')])
|
|
64
|
-
|
|
65
|
-
Print all the instances in the netlist
|
|
66
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
67
|
-
Next example shows how to browse all the netlist and print all its content recursively.
|
|
68
|
-
|
|
69
|
-
.. code-block:: python
|
|
70
|
-
|
|
71
|
-
def print_netlist(instance):
|
|
72
|
-
for child_instance in instance.get_child_instances():
|
|
73
|
-
print(f"{child_instance}:{child_instance.get_model_name()}")
|
|
74
|
-
print_netlist(child_instance)
|
|
75
|
-
|
|
76
|
-
Similar to the previous example, but utilizing an instance visitor.
|
|
77
|
-
This approach allows you to perform operations on each instance while
|
|
78
|
-
also defining conditions for stopping or continuing exploration.
|
|
79
|
-
|
|
80
|
-
.. code-block:: python
|
|
81
|
-
|
|
82
|
-
def print_instance(instance):
|
|
83
|
-
print(f"{instance}:{instance.get_model_name()}")
|
|
84
|
-
visitor_config = instance_visitor.VisitorConfig(callback=print_instance)
|
|
85
|
-
instance_visitor.Visitor(top).visit(top, visitor_config)
|
|
86
|
-
|
|
87
|
-
Documentation
|
|
88
|
-
-------------
|
|
89
|
-
najaeda is a work in progress, and the documentation is still under development.
|
|
90
|
-
|
|
91
|
-
Naja documentation is available on the `Naja GitHub repository <https://github.com/najaeda/naja>`_.
|
|
92
|
-
|
|
93
|
-
Support
|
|
94
|
-
-------
|
|
95
|
-
Please put up issues on the Delocate issue tracker.
|
|
96
|
-
If you encounter any issues or have questions, please report them on the
|
|
97
|
-
`Naja issue tracker <https://github.com/najaeda/naja/issues>`_.
|
|
98
|
-
|
|
99
|
-
License
|
|
100
|
-
-------
|
|
101
|
-
This project is licensed under the Apache License 2.0.
|
|
102
|
-
See the `LICENSE <https://github.com/najaeda/naja/blob/main/LICENSE>`_ file for details.
|
najaeda-0.1.5.dist-info/RECORD
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
najaeda-0.1.5.dist-info/RECORD,,
|
|
2
|
-
najaeda-0.1.5.dist-info/WHEEL,sha256=PJzLOGr1UQbVJ9ClJnwqiFhnlyWYjSsyNgebnLgIQKg,114
|
|
3
|
-
najaeda-0.1.5.dist-info/METADATA,sha256=WuZMeLEC6yRy9aEA4UiQ5Bg9RA_NtPplvGclOEt6h7c,3511
|
|
4
|
-
najaeda-0.1.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
5
|
-
najaeda-0.1.5.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
|
|
6
|
-
najaeda/netlist.py,sha256=jzpnmhGdkXRmSYmMNv3YGe3KC9BB9eoQc0Y3zlMh3ag,25748
|
|
7
|
-
najaeda/libnaja_snl_python.dylib,sha256=KwaiTP804H-3DyQ3FXkdju0qpMRWylEix-o0Mid3o-U,740160
|
|
8
|
-
najaeda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
najaeda/libnaja_snl.dylib,sha256=8Ei7KKU0b14IqlvH_8yQSSCpH0rjbxpeRaXgyfSemMY,574112
|
|
10
|
-
najaeda/snl.so,sha256=nwbhD_k8zYEQZh-LsCexOj9j2uSibNAeUnWTxwUy1iM,97888
|
|
11
|
-
najaeda/instance_visitor.py,sha256=HrrOnCSuw5Lh1HSp2R-ckYP4gEbqdxp_rw3Sl0GpGHE,1479
|
|
12
|
-
najaeda/primitives/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
najaeda/primitives/xilinx.py,sha256=fuu4KxEIuC0ueCK4C_gds6hzgtJsLE3tjDtOHtY9McM,25947
|
|
File without changes
|
|
File without changes
|
|
File without changes
|