najaeda 0.1.4__cp312-cp312-macosx_11_0_arm64.whl → 0.1.6__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/docs/Makefile +20 -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 +51 -0
- najaeda/libnaja_snl_python.dylib +0 -0
- najaeda/netlist.py +11 -7
- najaeda-0.1.6.dist-info/METADATA +161 -0
- najaeda-0.1.6.dist-info/RECORD +18 -0
- najaeda-0.1.4.dist-info/METADATA +0 -86
- najaeda-0.1.4.dist-info/RECORD +0 -12
- {najaeda-0.1.4.dist-info → najaeda-0.1.6.dist-info}/WHEEL +0 -0
- {najaeda-0.1.4.dist-info → najaeda-0.1.6.dist-info}/licenses/AUTHORS +0 -0
- {najaeda-0.1.4.dist-info → najaeda-0.1.6.dist-info}/licenses/LICENSE +0 -0
najaeda/docs/Makefile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = source
|
|
9
|
+
BUILDDIR = build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
najaeda/docs/make.bat
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@ECHO OFF
|
|
2
|
+
|
|
3
|
+
pushd %~dp0
|
|
4
|
+
|
|
5
|
+
REM Command file for Sphinx documentation
|
|
6
|
+
|
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
|
8
|
+
set SPHINXBUILD=sphinx-build
|
|
9
|
+
)
|
|
10
|
+
set SOURCEDIR=source
|
|
11
|
+
set BUILDDIR=build
|
|
12
|
+
|
|
13
|
+
%SPHINXBUILD% >NUL 2>NUL
|
|
14
|
+
if errorlevel 9009 (
|
|
15
|
+
echo.
|
|
16
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
17
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
18
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
19
|
+
echo.may add the Sphinx directory to PATH.
|
|
20
|
+
echo.
|
|
21
|
+
echo.If you don't have Sphinx installed, grab it from
|
|
22
|
+
echo.https://www.sphinx-doc.org/
|
|
23
|
+
exit /b 1
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
if "%1" == "" goto help
|
|
27
|
+
|
|
28
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
29
|
+
goto end
|
|
30
|
+
|
|
31
|
+
:help
|
|
32
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
33
|
+
|
|
34
|
+
:end
|
|
35
|
+
popd
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
#
|
|
3
|
+
# For the full list of built-in configuration values, see the documentation:
|
|
4
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
5
|
+
|
|
6
|
+
# -- Project information -----------------------------------------------------
|
|
7
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
8
|
+
|
|
9
|
+
import sys
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
# Add the src directory to sys.path
|
|
13
|
+
sys.path.insert(0, os.path.abspath('../../../'))
|
|
14
|
+
|
|
15
|
+
project = 'najaeda'
|
|
16
|
+
copyright = '2024, Naja authors'
|
|
17
|
+
author = 'Naja authors'
|
|
18
|
+
release = '0.1.6'
|
|
19
|
+
|
|
20
|
+
# -- General configuration ---------------------------------------------------
|
|
21
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
22
|
+
|
|
23
|
+
extensions = [
|
|
24
|
+
'sphinx.ext.autodoc', # Enables the automodule directive
|
|
25
|
+
'sphinx.ext.napoleon', # (Optional) Supports Google and NumPy-style docstrings
|
|
26
|
+
'sphinx.ext.viewcode', # (Optional) Links to source code in docs
|
|
27
|
+
'sphinx.ext.todo', # (Optional) For TODOs in the documentation
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
autodoc_mock_imports = ["najaeda.snl"]
|
|
31
|
+
templates_path = ['_templates']
|
|
32
|
+
exclude_patterns = []
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# -- Options for HTML output -------------------------------------------------
|
|
37
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
38
|
+
|
|
39
|
+
html_theme = 'sphinx_rtd_theme'
|
|
40
|
+
html_static_path = ['_static']
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.. najaeda documentation master file, created by
|
|
2
|
+
sphinx-quickstart on Mon Dec 16 16:39:26 2024.
|
|
3
|
+
You can adapt this file completely to your liking, but it should at least
|
|
4
|
+
contain the root `toctree` directive.
|
|
5
|
+
|
|
6
|
+
najaeda documentation
|
|
7
|
+
=====================
|
|
8
|
+
|
|
9
|
+
.. toctree::
|
|
10
|
+
:maxdepth: 2
|
|
11
|
+
:caption: Contents:
|
|
12
|
+
|
|
13
|
+
api
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2024 The Naja authors
|
|
2
|
+
# <https://github.com/najaeda/naja/blob/main/AUTHORS>
|
|
3
|
+
#
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
from typing import Callable
|
|
7
|
+
from najaeda import netlist
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class VisitorConfig:
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
enter_condition: Callable[[netlist.Instance], bool] = lambda node: True,
|
|
14
|
+
callback: Callable[..., None] = lambda node, *args, **kwargs: None,
|
|
15
|
+
args: tuple = (),
|
|
16
|
+
kwargs: dict = None,
|
|
17
|
+
):
|
|
18
|
+
"""
|
|
19
|
+
:param enter_condition: A callable that takes a node (dict)
|
|
20
|
+
and returns True if the visitor should enter.
|
|
21
|
+
:param callback: A callable that takes a node (dict) and performs an operation on it.
|
|
22
|
+
:param args: Positional arguments to pass to the callback.
|
|
23
|
+
:param kwargs: Keyword arguments to pass to the callback.
|
|
24
|
+
"""
|
|
25
|
+
self.enter_condition = enter_condition
|
|
26
|
+
self.callback = callback
|
|
27
|
+
self.args = args
|
|
28
|
+
self.kwargs = kwargs or {}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class Visitor:
|
|
32
|
+
def __init__(self, instance: netlist.Instance):
|
|
33
|
+
"""
|
|
34
|
+
:param netlist: The hierarchical netlist to be traversed.
|
|
35
|
+
"""
|
|
36
|
+
self.instance = instance
|
|
37
|
+
|
|
38
|
+
def visit(self, instance: netlist.Instance, config: VisitorConfig):
|
|
39
|
+
"""
|
|
40
|
+
Recursively visits nodes in the netlist hierarchy.
|
|
41
|
+
|
|
42
|
+
:param instance: The current node in the netlist instance hierarchy.
|
|
43
|
+
:param config: VisitorConfig object defining conditions and callbacks.
|
|
44
|
+
"""
|
|
45
|
+
# Execute the callback
|
|
46
|
+
config.callback(instance, *config.args, **config.kwargs)
|
|
47
|
+
|
|
48
|
+
# Check if we should proceed to children
|
|
49
|
+
if config.enter_condition(instance):
|
|
50
|
+
for child in instance.get_child_instances():
|
|
51
|
+
self.visit(child, config)
|
najaeda/libnaja_snl_python.dylib
CHANGED
|
Binary file
|
najaeda/netlist.py
CHANGED
|
@@ -35,13 +35,13 @@ class Equipotential:
|
|
|
35
35
|
|
|
36
36
|
def get_top_terms(self):
|
|
37
37
|
for term in self.equi.getTerms():
|
|
38
|
-
yield Term(snl.SNLPath(), term
|
|
38
|
+
yield Term(snl.SNLPath(), term)
|
|
39
39
|
|
|
40
40
|
def get_all_leaf_readers(self):
|
|
41
41
|
for term in self.equi.getInstTermOccurrences():
|
|
42
42
|
direction = term.getInstTerm().getDirection()
|
|
43
43
|
if direction != snl.SNLTerm.Direction.Output:
|
|
44
|
-
if term.getInstTerm().getInstance().getModel().
|
|
44
|
+
if term.getInstTerm().getInstance().getModel().isLeaf():
|
|
45
45
|
yield Term(
|
|
46
46
|
snl.SNLPath(term.getPath(), term.getInstTerm().getInstance()),
|
|
47
47
|
term.getInstTerm().getBitTerm(),
|
|
@@ -161,14 +161,14 @@ class Net:
|
|
|
161
161
|
path = snl.SNLPath(self.path, term.getInstance())
|
|
162
162
|
yield Term(path, term.getBitTerm())
|
|
163
163
|
|
|
164
|
-
def
|
|
164
|
+
def get_design_terms(self):
|
|
165
165
|
if hasattr(self, "net_concat"):
|
|
166
166
|
raise ValueError("Cannot get terms from a net_concat")
|
|
167
167
|
for term in self.net.getBitTerms():
|
|
168
168
|
yield Term(self.path, term)
|
|
169
169
|
|
|
170
|
-
def
|
|
171
|
-
for term in itertools.chain(self.
|
|
170
|
+
def get_terms(self):
|
|
171
|
+
for term in itertools.chain(self.get_design_terms(), self.get_inst_terms()):
|
|
172
172
|
yield term
|
|
173
173
|
|
|
174
174
|
|
|
@@ -438,8 +438,8 @@ class Instance:
|
|
|
438
438
|
def __repr__(self) -> str:
|
|
439
439
|
return f"Instance({self.path})"
|
|
440
440
|
|
|
441
|
-
def __hash__(self):
|
|
442
|
-
|
|
441
|
+
# def __hash__(self):
|
|
442
|
+
# return hash(self.path)
|
|
443
443
|
|
|
444
444
|
def is_top(self) -> bool:
|
|
445
445
|
"""Return True if this is the top design."""
|
|
@@ -452,6 +452,10 @@ class Instance:
|
|
|
452
452
|
"""Return True if this is a blackbox."""
|
|
453
453
|
return self.__get_snl_model().isBlackBox()
|
|
454
454
|
|
|
455
|
+
def is_leaf(self) -> bool:
|
|
456
|
+
"""Return True if this is a leaf."""
|
|
457
|
+
return self.__get_snl_model().isLeaf()
|
|
458
|
+
|
|
455
459
|
def is_const0(self) -> bool:
|
|
456
460
|
"""Return True if this is a constant 0 generator."""
|
|
457
461
|
return self.__get_snl_model().isConst0()
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: najaeda
|
|
3
|
+
Version: 0.1.6
|
|
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
|
+
Documentation
|
|
148
|
+
-------------
|
|
149
|
+
Naja EDA is a work in progress, and the documentation is still under development.
|
|
150
|
+
|
|
151
|
+
Naja documentation is available on the `Naja GitHub repository <https://github.com/najaeda/naja>`_.
|
|
152
|
+
|
|
153
|
+
Support
|
|
154
|
+
-------
|
|
155
|
+
If you encounter any issues or have questions, please report them on the
|
|
156
|
+
`Naja issue tracker <https://github.com/najaeda/naja/issues>`_.
|
|
157
|
+
|
|
158
|
+
License
|
|
159
|
+
-------
|
|
160
|
+
This project is licensed under the Apache License 2.0. \
|
|
161
|
+
See the `LICENSE <https://github.com/najaeda/naja/blob/main/LICENSE>`_ file for details.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
najaeda/netlist.py,sha256=Lg0JHaYD1xJl-tOFxdUorkev8TonBP8RNqDnxViOsxg,25751
|
|
2
|
+
najaeda/libnaja_snl_python.dylib,sha256=B-L2hEAoNpBVgg5DVp0jXNPkDZfyGZ9UC6e_CZcIyYw,740160
|
|
3
|
+
najaeda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
najaeda/libnaja_snl.dylib,sha256=8Ei7KKU0b14IqlvH_8yQSSCpH0rjbxpeRaXgyfSemMY,574112
|
|
5
|
+
najaeda/snl.so,sha256=2vv_LPtR0B-txFyT1mZYaYoaqPw6vd42BX2UROwOR8A,97888
|
|
6
|
+
najaeda/instance_visitor.py,sha256=2HnQ5y8-0tSOKd9nS4WYiypccQWLJgKfs84wp357Tls,1781
|
|
7
|
+
najaeda/docs/Makefile,sha256=4zv3TVkTACm6JBaKgTES3ZI9cETXgM6ULbZkXZP1as8,638
|
|
8
|
+
najaeda/docs/make.bat,sha256=L4I5T7uDUIjwGyMRJ-y9FoT61sxIyCuaYuJyLt8c-nA,804
|
|
9
|
+
najaeda/docs/source/index.rst,sha256=VBWfJySZ9v8mWfWt3kuSCZh7Gp0zUrFjXGQH7tZZfy0,323
|
|
10
|
+
najaeda/docs/source/conf.py,sha256=3qkykCg12ZYqawHl8VEg2Fti6rc3G-soGYM0L6zL3CU,1387
|
|
11
|
+
najaeda/docs/source/api.rst,sha256=H2Bw0JmHS9z-NhQARepmH74wsWHzjSVPbeXppSmtgCQ,141
|
|
12
|
+
najaeda/primitives/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
najaeda/primitives/xilinx.py,sha256=fuu4KxEIuC0ueCK4C_gds6hzgtJsLE3tjDtOHtY9McM,25947
|
|
14
|
+
najaeda-0.1.6.dist-info/RECORD,,
|
|
15
|
+
najaeda-0.1.6.dist-info/WHEEL,sha256=bS2kxwU1pioFffhNQmlfvjD0H1flBf5ZtxV4jDj8Nvc,114
|
|
16
|
+
najaeda-0.1.6.dist-info/METADATA,sha256=BNHiU6acY0ppMEC7I66Q34H4oDDalUoepVBas2Oqr5E,5608
|
|
17
|
+
najaeda-0.1.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
18
|
+
najaeda-0.1.6.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
|
najaeda-0.1.4.dist-info/METADATA
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: najaeda
|
|
3
|
-
Version: 0.1.4
|
|
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
|
-
|
|
66
|
-
Print all the instances in the netlist
|
|
67
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
68
|
-
Next example shows how to browse all the netlist and print all its content.
|
|
69
|
-
|
|
70
|
-
.. code-block:: python
|
|
71
|
-
|
|
72
|
-
def print_netlist(instance):
|
|
73
|
-
for child_instance in instance.get_child_instances():
|
|
74
|
-
print(f"{child_instance}:{child_instance.get_model_name()}")
|
|
75
|
-
print_netlist(child_instance)
|
|
76
|
-
|
|
77
|
-
Documentation
|
|
78
|
-
-------------
|
|
79
|
-
najaeda is a work in progress, and the documentation is still under development.
|
|
80
|
-
|
|
81
|
-
Naja documentation is available on the `Naja GitHub repository <https://github.com/najaeda/naja>`_.
|
|
82
|
-
|
|
83
|
-
License
|
|
84
|
-
-------
|
|
85
|
-
|
|
86
|
-
This project is licensed under the Apache License 2.0. See the `LICENSE <https://github.com/najaeda/naja/blob/main/LICENSE>`_ file for details.
|
najaeda-0.1.4.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
najaeda-0.1.4.dist-info/RECORD,,
|
|
2
|
-
najaeda-0.1.4.dist-info/WHEEL,sha256=bS2kxwU1pioFffhNQmlfvjD0H1flBf5ZtxV4jDj8Nvc,114
|
|
3
|
-
najaeda-0.1.4.dist-info/METADATA,sha256=rpver3Febf2UhLXS-HAceNHU3YnNLGKde1icywDK_-Y,2842
|
|
4
|
-
najaeda-0.1.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
5
|
-
najaeda-0.1.4.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
|
|
6
|
-
najaeda/netlist.py,sha256=ena4A9S1UxQV-pO1XWxO_qbG-4ELnorKInJgX0zN3M0,25633
|
|
7
|
-
najaeda/libnaja_snl_python.dylib,sha256=GR1KlfHbg2X3aYcQKgjWbWnwEorGvrANrcYh8KEkdbg,740160
|
|
8
|
-
najaeda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
najaeda/libnaja_snl.dylib,sha256=8Ei7KKU0b14IqlvH_8yQSSCpH0rjbxpeRaXgyfSemMY,574112
|
|
10
|
-
najaeda/snl.so,sha256=2vv_LPtR0B-txFyT1mZYaYoaqPw6vd42BX2UROwOR8A,97888
|
|
11
|
-
najaeda/primitives/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
najaeda/primitives/xilinx.py,sha256=fuu4KxEIuC0ueCK4C_gds6hzgtJsLE3tjDtOHtY9McM,25947
|
|
File without changes
|
|
File without changes
|
|
File without changes
|