<!--
SPDX-FileCopyrightText: 2022 Thomas Kramer
SPDX-License-Identifier: CC-BY-SA-4.0
-->
# LibreCell
LibreCell aims to be a toolbox for automated synthesis of CMOS logic cells.
LibreCell is structured in multiple sub-projects:
* [librecell-layout](https://codeberg.org/librecell/lclayout): Automated layout generator for CMOS standard cells.
* [lctime](https://codeberg.org/librecell/lctime): Characterization kit for CMOS cells and tool for handling liberty files.
The project is in a very early stage and might not yet be ready for productive use.
Project structure and API might change heavily in near future.
### Getting started
LibreCell can be installed using the Python package manager `pip` or directly from the git repository.
#### Dependencies
The following dependencies must be installed manually:
* python3
* z3 https://github.com/Z3Prover/z3 : SMT solver.
Optional dependencies (not required for default configuration):
* GLPK https://www.gnu.org/software/glpk : ILP/MIP solver
Depending on your linux distribution this packages can be installed using the package manager.
#### Installing from git
It is recommended to use a Python 'virtual environment' for installing all Python dependencies:
```sh
# Create a new virtual environment
python3 -m venv my-librecell-env
# Activate the virtual environment
source ./my-librecell-env/bin/activate
```
Install from git:
```sh
git clone https://codeberg.org/tok/librecell.git
cd librecell
./install.sh
# Alternatively use ./install_develop.sh to install symlinks.
# This allows to edit the code with immediate effect on the installed program.
```
Now, check if the command-line scripts are in the current search path:
```sh
lclayout --help
```
If this shows the documentation of the `lclayout` command, then things are fine. Otherwise, the `PATH` environment variable needs to be updated to include `$HOME/.local/bin`.
```sh
# Instead of executing this line each time it can be added to ~/.bashrc
export PATH=$PATH:$HOME/.local/bin
```
#### Installing with pip
*Note*: The version PyPI is often not the most recent one. Consider installing from git to get the most recent version.
It is recommended to use a Python 'virtual environment' for installing all Python dependencies:
```sh
# Create a new virtual environment
python3 -m venv my-librecell-env
# Activate the virtual environment
source ./my-librecell-env/bin/activate
pip3 install lclayout
```
### Generate a layout
Generate a layout from a SPICE netlist which includes the transistor sizes:
* --output-dir: Directory which will be used to store GDS and LEF of the cell
* --tech: Python script file containing design rules and technology related data
* --netlist: A SPICE netlist containing the netlist of the cell as a sub circuit (`.subckt`).
* --cell: Name of the cell. Must match the name of the sub circuit in the SPICE netlist.
```sh
mkdir mylibrary
lclayout --output-dir mylibrary --tech examples/dummy_tech.py --netlist examples/cells.sp --cell AND2X1
```
## Adapting design rules
Design rulesi and technology related data need to be encoded in a Python script file as shown in `examples/dummy_tech.py`.
### Known issues
#### Reproducibility
You may want to generate standard cells in a fully reproducable manner.
Right now there is some non-determinism in LibreCell that has not been investigated yet.
The current workaround is to set the `PYTHONHASHSEED` environment variable.
```sh
export PYTHONHASHSEED=42
lclayout ...
```
## Contact
```python
"codextkramerych".replace("x", "@").replace("y", ".")
```
Raw data
{
"_id": null,
"home_page": "",
"name": "lclayout",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "cmos,cell,layout,generator,klayout,vlsi,asic",
"author": "",
"author_email": "\"T. Kramer\" <code@tkramer.ch>",
"download_url": "https://files.pythonhosted.org/packages/ae/0a/4c88e8fa294971aaab4ebd4afa2af581160d1e1d7ee6afcdc12fb59581a9/lclayout-0.0.18.tar.gz",
"platform": null,
"description": "<!--\nSPDX-FileCopyrightText: 2022 Thomas Kramer\n\nSPDX-License-Identifier: CC-BY-SA-4.0\n-->\n\n# LibreCell\nLibreCell aims to be a toolbox for automated synthesis of CMOS logic cells.\n\nLibreCell is structured in multiple sub-projects:\n* [librecell-layout](https://codeberg.org/librecell/lclayout): Automated layout generator for CMOS standard cells.\n* [lctime](https://codeberg.org/librecell/lctime): Characterization kit for CMOS cells and tool for handling liberty files.\n\nThe project is in a very early stage and might not yet be ready for productive use.\nProject structure and API might change heavily in near future.\n\n### Getting started\nLibreCell can be installed using the Python package manager `pip` or directly from the git repository.\n\n#### Dependencies\nThe following dependencies must be installed manually:\n* python3\n* z3 https://github.com/Z3Prover/z3 : SMT solver.\n\nOptional dependencies (not required for default configuration):\n* GLPK https://www.gnu.org/software/glpk : ILP/MIP solver\n\nDepending on your linux distribution this packages can be installed using the package manager.\n\n#### Installing from git\nIt is recommended to use a Python 'virtual environment' for installing all Python dependencies:\n```sh\n# Create a new virtual environment\npython3 -m venv my-librecell-env\n# Activate the virtual environment\nsource ./my-librecell-env/bin/activate\n```\n\nInstall from git:\n```sh\ngit clone https://codeberg.org/tok/librecell.git\ncd librecell\n./install.sh\n\n# Alternatively use ./install_develop.sh to install symlinks.\n# This allows to edit the code with immediate effect on the installed program.\n```\n\nNow, check if the command-line scripts are in the current search path:\n```sh\nlclayout --help\n```\nIf this shows the documentation of the `lclayout` command, then things are fine. Otherwise, the `PATH` environment variable needs to be updated to include `$HOME/.local/bin`.\n\n```sh\n# Instead of executing this line each time it can be added to ~/.bashrc\nexport PATH=$PATH:$HOME/.local/bin\n```\n\n#### Installing with pip\n*Note*: The version PyPI is often not the most recent one. Consider installing from git to get the most recent version.\n\nIt is recommended to use a Python 'virtual environment' for installing all Python dependencies:\n```sh\n# Create a new virtual environment\npython3 -m venv my-librecell-env\n# Activate the virtual environment\nsource ./my-librecell-env/bin/activate\n\npip3 install lclayout\n```\n\n### Generate a layout\nGenerate a layout from a SPICE netlist which includes the transistor sizes:\n* --output-dir: Directory which will be used to store GDS and LEF of the cell\n* --tech: Python script file containing design rules and technology related data\n* --netlist: A SPICE netlist containing the netlist of the cell as a sub circuit (`.subckt`).\n* --cell: Name of the cell. Must match the name of the sub circuit in the SPICE netlist.\n\n```sh\nmkdir mylibrary\nlclayout --output-dir mylibrary --tech examples/dummy_tech.py --netlist examples/cells.sp --cell AND2X1\n```\n\n## Adapting design rules\nDesign rulesi and technology related data need to be encoded in a Python script file as shown in `examples/dummy_tech.py`.\n\n### Known issues\n\n#### Reproducibility\nYou may want to generate standard cells in a fully reproducable manner.\nRight now there is some non-determinism in LibreCell that has not been investigated yet.\nThe current workaround is to set the `PYTHONHASHSEED` environment variable.\n\n```sh\nexport PYTHONHASHSEED=42\nlclayout ...\n```\n\n## Contact\n```python\n\"codextkramerych\".replace(\"x\", \"@\").replace(\"y\", \".\")\n```\n",
"bugtrack_url": null,
"license": "OHL-S v2.0",
"summary": "CMOS standard-cell layout generator.",
"version": "0.0.18",
"project_urls": {
"Homepage": "https://codeberg.org/librecell/lclayout",
"Issue Tracker": "https://codeberg.org/librecell/lclayout/issues",
"Repository": "https://codeberg.org/librecell/lclayout"
},
"split_keywords": [
"cmos",
"cell",
"layout",
"generator",
"klayout",
"vlsi",
"asic"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ae0a4c88e8fa294971aaab4ebd4afa2af581160d1e1d7ee6afcdc12fb59581a9",
"md5": "1f5a5f5d45791f62fbd71c424131bbfc",
"sha256": "d65d36080ad346ecbcbad5169a4743ab367a84f987e3cd286eec754082e7e8bd"
},
"downloads": -1,
"filename": "lclayout-0.0.18.tar.gz",
"has_sig": false,
"md5_digest": "1f5a5f5d45791f62fbd71c424131bbfc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 90021,
"upload_time": "2024-01-28T21:50:19",
"upload_time_iso_8601": "2024-01-28T21:50:19.783390Z",
"url": "https://files.pythonhosted.org/packages/ae/0a/4c88e8fa294971aaab4ebd4afa2af581160d1e1d7ee6afcdc12fb59581a9/lclayout-0.0.18.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-28 21:50:19",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": true,
"codeberg_user": "librecell",
"codeberg_project": "lclayout",
"lcname": "lclayout"
}