Metadata-Version: 2.3
Name: haadic
Version: 0.6.4
Summary: A package for parametric layout design.
Author: Patarimi
Author-email: Patarimi <<38954040+Patarimi@users.noreply.github.com>>
Requires-Dist: autoapi>=2.0.1
Requires-Dist: ciel>=2.6.0
Requires-Dist: cyclopts>=4.22.5
Requires-Dist: jinja2>=3.1.6
Requires-Dist: klayout>=0.30.10
Requires-Dist: lark>=1.2.2
Requires-Dist: matplotlib>=3.11.1
Requires-Dist: nixthon
Requires-Dist: numpy>=2.5.2
Requires-Dist: pandas>=3.0.0
Requires-Dist: pydantic>=2.13.4
Requires-Dist: pyqt6>=6.11.0 ; sys_platform == 'linux'
Requires-Dist: python-dotenv>=1.1.1
Requires-Dist: rich>=13.9.4
Requires-Dist: scikit-rf>=2.1.0
Requires-Dist: scipy>=1.18.0
Requires-Dist: tabulate>=0.9.0
Requires-Python: >3.12, <3.14
Description-Content-Type: text/markdown

# HAADIC

**Highly-Automated Analog Designer for Integrated Circuits**

This project is under development. Its goal is to create a technological and
software-agnostic design flow, from device sizing to layout and implementation.


Dimensions in the layout can be changed by editing the `dim` variable.
Post-simulation computation can be done by editing the `evaluate` function.

## Design Flow

The following flow is run using the information given in a _design.py_ python file (see [tutorial](tutorial/getting_started/)). The flow has 2 entry points :

- `flow.run_from_dim` : Only requires a `dim` variables which defines the value of each parameters of the layout function.
- `flow.run_from_target` : Requires both a `target`and an `local_model` function. The `local_model` is an implementation of the design methodology which output the layout parameters value required to obtains the `target`.

For batch execution, the method `run_from_sweep` can be used.

```mermaid
flowchart TD
    s1{Start #2}
    s2{Start #1}
    app["Physical Model
(design:local_model)"]
    pl["Parametric Layout
(klayout + design:layout)"]
    be_ext["RC extraction
(steps.extraction + Magic-VLSI)"]
    sim["Spice simulation
(steps.spice_sim + NGSpice)"]
    spec["Performances Evaluation
(design:post_processors)"]

    s1 -- "design:specifications" --> app
    s2 -- "design:dimensions" --> pl
    app --"dimensions (step.Dim)" --> pl
    pl --"geometries (.gds)" --> be_ext
    be_ext --"netlist (.cir)" --> sim
    sim --"raw simulation (step.SimRes)" --> spec
    spec --"performances (.csv)" --> st{stop}
```

When finished, a _.gds_ file is available for further design and a _.csv_ file with the performances of the design.

## PDKs configuration

A techno.json file can be created in the working dir or the haadic root with the following structure:

```json
{
"techno_name": {
  "base_dir": "path to the pdk directory root",
  "layermap": "path to the layermap (relative to the base_dir)",
  "techlef": "path to the tlef file",
  "magic_rc": "path to the configuration file of magic",
  "lib_spice": "path to the spice model library",
  "section": "name of the section to import in the spice library typical",
  "source_url": "url to be use for download (set to "ciel" for ciel installation)",
  "version": "version id (only required if source_url is set to "ciel")"
}
}
```

A techno.json file with three open source PDK and a mock PDK are already supplied.

## For developers

Install haadic with optional group dev :

```shell
uv install git+https://github.com/Patarimi/haadic --with dev
```

Then run pytest in a shell

```shell
uvx run poe test
```
