najaeda 0.1.5__cp313-cp313t-macosx_11_0_arm64.whl → 0.1.6__cp313-cp313t-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 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,7 @@
1
+ najaeda API Documentation
2
+ =========================
3
+
4
+ .. automodule:: najaeda.netlist
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -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
@@ -11,15 +11,21 @@ class VisitorConfig:
11
11
  def __init__(
12
12
  self,
13
13
  enter_condition: Callable[[netlist.Instance], bool] = lambda node: True,
14
- callback: Callable[[netlist.Instance], None] = lambda node: None,
14
+ callback: Callable[..., None] = lambda node, *args, **kwargs: None,
15
+ args: tuple = (),
16
+ kwargs: dict = None,
15
17
  ):
16
18
  """
17
- :param enter_condition: A function that determines whether to visit
18
- the children of an instance.
19
- :param callback: The callback to be executed when an instance is visited.
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.
20
24
  """
21
- self.callback = callback
22
25
  self.enter_condition = enter_condition
26
+ self.callback = callback
27
+ self.args = args
28
+ self.kwargs = kwargs or {}
23
29
 
24
30
 
25
31
  class Visitor:
@@ -37,7 +43,7 @@ class Visitor:
37
43
  :param config: VisitorConfig object defining conditions and callbacks.
38
44
  """
39
45
  # Execute the callback
40
- config.callback(instance)
46
+ config.callback(instance, *config.args, **config.kwargs)
41
47
 
42
48
  # Check if we should proceed to children
43
49
  if config.enter_condition(instance):
Binary file
najaeda/netlist.py CHANGED
@@ -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
- return hash(self.path)
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."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: najaeda
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Naja EDA Python package
5
5
  Author-Email: Naja Authors <contact@keplertech.io>
6
6
  License: Apache License 2.0
@@ -12,7 +12,38 @@ Naja EDA Python Package
12
12
  =======================
13
13
 
14
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>`_.
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>`_.
16
47
 
17
48
  Installation
18
49
  ------------
@@ -49,10 +80,11 @@ a netlist from a Verilog file.
49
80
  Load a design with pre-existing libraries
50
81
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51
82
  In FPGA design environments, Liberty files are often unavailable.
83
+
52
84
  To address this, the following example demonstrates how to load primitives
53
85
  without relying on Liberty files.
54
86
 
55
- najaeda comes with pre-configured libraries to simplify this process.
87
+ Naja EDA comes with pre-configured libraries to simplify this process.
56
88
  Currently, it includes support for partial Xilinx primitives, but this can be
57
89
  easily extended in the future. Don't hesitate to reach out if you need help.
58
90
 
@@ -84,19 +116,46 @@ also defining conditions for stopping or continuing exploration.
84
116
  visitor_config = instance_visitor.VisitorConfig(callback=print_instance)
85
117
  instance_visitor.Visitor(top).visit(top, visitor_config)
86
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
+
87
147
  Documentation
88
148
  -------------
89
- najaeda is a work in progress, and the documentation is still under development.
149
+ Naja EDA is a work in progress, and the documentation is still under development.
90
150
 
91
151
  Naja documentation is available on the `Naja GitHub repository <https://github.com/najaeda/naja>`_.
92
152
 
93
153
  Support
94
154
  -------
95
- Please put up issues on the Delocate issue tracker.
96
155
  If you encounter any issues or have questions, please report them on the
97
156
  `Naja issue tracker <https://github.com/najaeda/naja/issues>`_.
98
157
 
99
158
  License
100
159
  -------
101
- This project is licensed under the Apache License 2.0.
160
+ This project is licensed under the Apache License 2.0. \
102
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=Vav0MgS7S0bKlcSGCuHICUhllhRG6aOdB7UrKNRm8aY,740288
3
+ najaeda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ najaeda/libnaja_snl.dylib,sha256=8Ei7KKU0b14IqlvH_8yQSSCpH0rjbxpeRaXgyfSemMY,574112
5
+ najaeda/snl.so,sha256=Og454YB20jBXM9_5w2YG0e-yDHX95KaJxdGK-6FvjW4,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=WOiMFvo9bzNKIh5Rxx7xDwR4DzXJ4VAFWxSvvQdE_uA,115
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
@@ -1,13 +0,0 @@
1
- najaeda-0.1.5.dist-info/RECORD,,
2
- najaeda-0.1.5.dist-info/WHEEL,sha256=WOiMFvo9bzNKIh5Rxx7xDwR4DzXJ4VAFWxSvvQdE_uA,115
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=S64GfIw9I7Lj391D9ZVwZjFAXeTB0VCbXsq5euw3zGA,740288
8
- najaeda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- najaeda/libnaja_snl.dylib,sha256=8Ei7KKU0b14IqlvH_8yQSSCpH0rjbxpeRaXgyfSemMY,574112
10
- najaeda/snl.so,sha256=Og454YB20jBXM9_5w2YG0e-yDHX95KaJxdGK-6FvjW4,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