Metadata-Version: 2.1
Name: najaeda
Version: 0.1.2
Summary: Naja EDA Python package
Author-Email: Naja Authors <contact@keplertech.io>
License: Apache License 2.0
Project-URL: Homepage, https://github.com/najaeda/naja
Requires-Python: >=3.8
Description-Content-Type: text/x-rst

Naja EDA Python Package
=======================

Naja EDA is a Python package that provides data structures and APIs for developing post-synthesis Electronic Design Automation (EDA) algorithms. It serves as the Python counterpart to the `Naja C++ project <https://github.com/najaeda/naja>`_.

Features
--------

- **Netlist Simplification**: Perform constant propagation and dead logic elimination.
- **Logic Replication**: Facilitate duplication of logic elements for optimization.
- **Netlist Partitioning**: Divide netlists into manageable sections.
- **Place and Route Support**: Assist in ASIC and FPGA design flows.

Installation
------------

Install Naja EDA using pip:

.. code-block:: bash

    pip install najaeda

Examples
--------
Following snippet shows how to load primitive cells from a liberty file and
a netlist from a Verilog file.
.. code-block:: python

    from os import path
    from najaeda import netlist
    
    benchmarks = path.join('..','benchmarks')
    liberty_files = ['NangateOpenCellLibrary_typical.lib', 'fakeram45_1024x32.lib', 'fakeram45_64x32.lib']
    liberty_files = list(map(lambda p:path.join(benchmarks, 'liberty', p), liberty_files))
        
    netlist.load_liberty(liberty_files)
    top = netlist.load_verilog([path.join(benchmarks, 'verilog', 'tinyrocket.v')])
    
    #dump verilog
    top.dump_verilog('tinyrocket_naja.v')

Next example shows how to browse all the netlist and print all its content.
.. code-block:: python

    def print_netlist(instance):
        for child_instance in instance.get_child_instances():
            print(f"{child_instance}:{child_instance.get_model_name()}")
            print_netlist(child_instance)

Documentation
-------------

Comprehensive documentation is available on the `Naja GitHub repository <https://github.com/najaeda/naja>`_.

License
-------

This project is licensed under the Apache License 2.0. See the `LICENSE <https://github.com/najaeda/naja/blob/main/LICENSE>`_ file for details.