LibrePDK: Difference between revisions
| (25 intermediate revisions by the same user not shown) | |||
| Line 14: | Line 14: | ||
After that, LibrePDK should be capable of auto discovering the new process after running the update script. | After that, LibrePDK should be capable of auto discovering the new process after running the update script. | ||
== Dependencies == | |||
=== Ubuntu === | |||
We are using Ubuntu 25.04 in our Docker containers | |||
Simply run<syntaxhighlight lang="bash">apt-get update && apt-get install -y --no-install-recommends \ | |||
autoconf automake bash bison build-essential ca-certificates cargo checkinstall clang cmake \ | |||
curl flex g++ gcc git git-lfs glpk-utils gosu imagemagick libblas-dev libcairo2-dev \ | |||
libcurl4-gnutls-dev libeigen3-dev libfl-dev libgit2-dev libgit2-glib-1.0-dev libglpk-dev \ | |||
libglu1-mesa-dev liblemon-dev libreadline-dev libsparsehash-dev libsqlite3-dev libtool \ | |||
libxaw7-dev libz-dev llvm make mmv pdf2svg pkg-config python3-dev python3-full python3-pip \ | |||
rsync ruby ruby-dev rustc software-properties-common sqlite3 sudo tcl tcl8.6-dev tcllib \ | |||
texlive-latex-recommended time tk8.6-dev tklib unzip vim wget z3 zlib1g-dev | |||
</syntaxhighlight> | |||
=== Boost === | |||
In order for [[LibrePDK#Limbo|Limbo]] to successfully compile we need to install Boost. | |||
We are currently using boost 1.91.0, of which the tar ball can be obtained here https://archives.boost.io/release/1.91.0/source/boost_1_91_0.tar.gz | |||
With the following command Boost can be installed quickly<syntaxhighlight lang="bash"> | |||
./bootstrap.sh \ | |||
--prefix=/usr \ | |||
--with-python-version=3.13 | |||
./b2 install | |||
</syntaxhighlight>Note that the Python version we compile boost for is 3.13, because LibrePDK hasn't been tested with any later version. | |||
=== ngspice === | |||
For the simulation and characterization of standard cells you will need the ngspice frontend and backend library | |||
Currently we are using version 44.2 of ngspice, the tar ball can be obtained from here: https://download.industrysoftware.automation.siemens.com/open-source/ngspice-44.2.tar.gz | |||
==== Backend configuration ==== | |||
The backend library is needed for Charlib in order to run characterization of our cells<syntaxhighlight lang="bash"> | |||
./autogen.sh | |||
./configure --with-ngshared --enable-xspice --enable-cider --enable-openmp --disable-debug | |||
make -j$(nproc) | |||
make install | |||
</syntaxhighlight>After compilation and installation you should have a libngspice.so in your ldpath which charlib can pick up on and load it. | |||
==== Frontend configuration ==== | |||
This will compile and install the ngspice CLI binary which is needed when you wanna simulate your circuits.<syntaxhighlight lang="bash"> | |||
./autogen.sh | |||
../configure --with-x --with-readline=yes --enable-xspice | |||
make -j$(nproc) | |||
make install | |||
</syntaxhighlight>ngspice is also used when loading and importing new technologies into LibrePDK | |||
=== OpenVAF models === | |||
IHP's SG13G2 technology node uses OpenVAF models for the ngspice simulation tool. | |||
The following script will make sure that rust and the OpenVAF tool are present and then | |||
compiles the models into the osdi format and places them into the technology directory | |||
ready to be used by LibrePDK. | |||
Simply run the following script and confirm the installation by checking for the LibrePDK/technologies/spice/SG13G2/devices/*/*.osdi files. | |||
This requires the LibrePDK repo to already have [[LibrePDK#Installation|been cloned and updated]] as shown in. | |||
./scripts/update_ngspice_extensions.sh | |||
=== LP solver === | |||
Google now officially runs the project and you can get the most recent version from GitHub | |||
Install is by cloning and building it<syntaxhighlight lang="bash"> | |||
git clone https://github.com/lp-solve/lp_solve | |||
pushd lp_solve/lpsolve55 | |||
rm -rf bin/ux64 | |||
sh ccc | |||
popd | |||
</syntaxhighlight> Then you can copy the shared object file in solve/lpsolve55/bin/ux64 into your /usr/lib64 and copy the headers with<syntaxhighlight lang="bash"> | |||
mkdir /usr/include/lpsolve | |||
cp lp_solve/*.h /usr/include/lpsolve/ | |||
</syntaxhighlight>OR, you can install the system package and devel package with your package manager | |||
=== Lemon === | |||
That library has been developed by a Hungarian university which doesn't maintain their Mercurial setup. Best approach is to use the version you find in your distribution | |||
=== Limbo === | |||
The official version of Limbo has been a total mess when it comes to building libs and linking them. I had to make some severe modifications which makes CMake properly build shared object files and detects the system wide installation of the dependencies | |||
using proper CMake detection functions | |||
Just run<syntaxhighlight lang="bash"> | |||
git clone https://gitlab.libresilicon.com/leviathan/limbo.git | |||
mkdir Limbo/build | |||
pushd Limbo/build | |||
cmake .. | |||
make | |||
make install | |||
popd | |||
</syntaxhighlight> | |||
== Installation == | == Installation == | ||
Before you start installing LibrePDK, you first need to [[LibrePDK#Dependencies|install its dependencies]] so that its C++ extensions and other C++ tools compile successfully. | |||
After that, please clone the repo. | |||
pip install [https://gitlab.libresilicon.com/generator-tools/librepdk.git https+git://gitlab.libresilicon.com/generator-tools/librepdk.git] | pip install [https://gitlab.libresilicon.com/generator-tools/librepdk.git https+git://gitlab.libresilicon.com/generator-tools/librepdk.git] | ||
Don't forget to make sure that all the submodules and their submodules are cloned | |||
git submodule update --init --recursive | |||
For placement of discrete componentes used in more complex components like Driver Circuits, OpAmps, etc. IdeaPlaceExPy is being used. | |||
IdeaPlaceExPy requires the Python system headers to be installed and the virtual env has to match the Python version with which it was compiled. | |||
=== Using LibrePDK in a Virtual Environment (FINAL SETUP) === | |||
It is recommended to use LibrePDK in a Python virtual environment to avoid dependency conflicts with | |||
system-wide Python packages. | |||
After you've installed all the below dependencies the recommended way of installing the remaining dependencies is to run<syntaxhighlight lang="bash"> | |||
uv sync --no-cache | |||
</syntaxhighlight> | |||
== Building your own Docker images == | |||
Inside of the LibrePDK source folder you will find a script where you can uncomment and comment specific build stages of the multistage Docker build covering all the dependencies | |||
Check out the script '''[https://gitlab.libresilicon.com/generator-tools/librepdk/-/blob/master/scripts/build_docker_images.sh?ref_type=heads scripts/build_docker_images.sh]''' | |||
= Components = | = Components = | ||
LibrePDK provides generators for the basic components usually found within a VLSI/ULSI design, such as resistors, capacitors and transistors. | LibrePDK provides generators for the basic components usually found within a VLSI/ULSI design, such as resistors, capacitors, diodes and transistors. | ||
== Capacitors == | == Capacitors == | ||
LibrePDK can calculate the specific geometry based on the device rules and available parameters for generating any desired target capacitance value. Below a 50pF capacitor can be seen. You will notice the enormous dimensions of the structure. | |||
[[File:50pF MiMCap (GF180A, 3.3V).png|none|thumb|300x300px]] | |||
Usually we deal with femto Farad in VLSI design so you should never be in a situation where you have large capacitors on your chip. | |||
LibrePDK still can generate you a device, you just won't be happy about it. | |||
== Resistors == | == Resistors == | ||
There's two types of resistor structures available: Meander and strip resistors | There's two types of resistor structures available: Meander and strip resistors | ||
LibrePDK automatically adds a guard ring around any resistor which should be on a well | |||
'''The meander here is 200 Ohms for GF180A@3.3V'''[[File:LibrePDK Meander Example.png|none|thumb|300x300px]]'''The meander here is 500 Ohms for GF180A@3.3V'''[[File:Strip Resistor Example.png|none|thumb|300x300px]] | |||
== Diodes == | |||
[[File:Diode Example.png|none|thumb|300x300px|Example of a diode]] | |||
While normal fingered diodes now have been implemented Schottky diodes still are work in progress. | |||
== Schottky diodes == | |||
Those are not yet implemented | |||
== Transistors == | == Transistors == | ||
In order to make sure that our transistors don't go up in flame, we have to take the hot carrier migration and thermal budget into consideration when we decide what transistor to use and whether it should have only one gate or should be fingered. | |||
LibrePDK takes care of this and chooses the right transistor with the right amount of fingers for you based on the target operating voltage and current you plan to pump through it, you provide. | |||
Additionally, you can also overwrite the thermal budget which usually is assumed to be for an internal circuit which isn't bonded directly to the outside. | |||
When LibrePDK calculates that electron migration and thermal budget constraints don't allow for a single gate transistor it will dynamically create a fingered structure, either with bulk and source connected or not with the proper guard ring. | |||
[[File:Fingered Transistor.png|none|thumb|300x300px|Example of a fingered transistor]] | |||
Libre PDK may also decide to just generate a single gate transistor in cases where there's very little power involved | |||
[[File:Single Gate Example.png|none|thumb|300x300px|Example of a single gate transistor]] | |||
== Pad Cells == | |||
Last but not least: It contains the [[Pad Cell Generator]] which produces beauties like this | |||
[[File:30mA SG13G2@3V3 v2.png|none|thumb|356x356px]] | |||
Latest revision as of 22:06, 15 August 2026
The LibrePDK is the library driving Danube River and the Pad Cell Generator

It is responsible for generating discrete parts with specific parameters for a specific process.
The properties of the parts can be optimized by utilizing the calibration values extracted from the measurements of taped out Danube River test wafers.
Adding a new technology
Technologies currently supported can be found in the technologies subfolder.
New technologies can be added by modifying scripts/update_technologies.sh and adding a tech.python script to the technologies folder.
After that, LibrePDK should be capable of auto discovering the new process after running the update script.
Dependencies
Ubuntu
We are using Ubuntu 25.04 in our Docker containers
Simply run
apt-get update && apt-get install -y --no-install-recommends \
autoconf automake bash bison build-essential ca-certificates cargo checkinstall clang cmake \
curl flex g++ gcc git git-lfs glpk-utils gosu imagemagick libblas-dev libcairo2-dev \
libcurl4-gnutls-dev libeigen3-dev libfl-dev libgit2-dev libgit2-glib-1.0-dev libglpk-dev \
libglu1-mesa-dev liblemon-dev libreadline-dev libsparsehash-dev libsqlite3-dev libtool \
libxaw7-dev libz-dev llvm make mmv pdf2svg pkg-config python3-dev python3-full python3-pip \
rsync ruby ruby-dev rustc software-properties-common sqlite3 sudo tcl tcl8.6-dev tcllib \
texlive-latex-recommended time tk8.6-dev tklib unzip vim wget z3 zlib1g-dev
Boost
In order for Limbo to successfully compile we need to install Boost.
We are currently using boost 1.91.0, of which the tar ball can be obtained here https://archives.boost.io/release/1.91.0/source/boost_1_91_0.tar.gz
With the following command Boost can be installed quickly
./bootstrap.sh \
--prefix=/usr \
--with-python-version=3.13
./b2 install
Note that the Python version we compile boost for is 3.13, because LibrePDK hasn't been tested with any later version.
ngspice
For the simulation and characterization of standard cells you will need the ngspice frontend and backend library
Currently we are using version 44.2 of ngspice, the tar ball can be obtained from here: https://download.industrysoftware.automation.siemens.com/open-source/ngspice-44.2.tar.gz
Backend configuration
The backend library is needed for Charlib in order to run characterization of our cells
./autogen.sh
./configure --with-ngshared --enable-xspice --enable-cider --enable-openmp --disable-debug
make -j$(nproc)
make install
After compilation and installation you should have a libngspice.so in your ldpath which charlib can pick up on and load it.
Frontend configuration
This will compile and install the ngspice CLI binary which is needed when you wanna simulate your circuits.
./autogen.sh
../configure --with-x --with-readline=yes --enable-xspice
make -j$(nproc)
make install
ngspice is also used when loading and importing new technologies into LibrePDK
OpenVAF models
IHP's SG13G2 technology node uses OpenVAF models for the ngspice simulation tool.
The following script will make sure that rust and the OpenVAF tool are present and then compiles the models into the osdi format and places them into the technology directory ready to be used by LibrePDK.
Simply run the following script and confirm the installation by checking for the LibrePDK/technologies/spice/SG13G2/devices/*/*.osdi files.
This requires the LibrePDK repo to already have been cloned and updated as shown in.
./scripts/update_ngspice_extensions.sh
LP solver
Google now officially runs the project and you can get the most recent version from GitHub
Install is by cloning and building it
git clone https://github.com/lp-solve/lp_solve
pushd lp_solve/lpsolve55
rm -rf bin/ux64
sh ccc
popd
Then you can copy the shared object file in solve/lpsolve55/bin/ux64 into your /usr/lib64 and copy the headers with
mkdir /usr/include/lpsolve
cp lp_solve/*.h /usr/include/lpsolve/
OR, you can install the system package and devel package with your package manager
Lemon
That library has been developed by a Hungarian university which doesn't maintain their Mercurial setup. Best approach is to use the version you find in your distribution
Limbo
The official version of Limbo has been a total mess when it comes to building libs and linking them. I had to make some severe modifications which makes CMake properly build shared object files and detects the system wide installation of the dependencies using proper CMake detection functions
Just run
git clone https://gitlab.libresilicon.com/leviathan/limbo.git
mkdir Limbo/build
pushd Limbo/build
cmake ..
make
make install
popd
Installation
Before you start installing LibrePDK, you first need to install its dependencies so that its C++ extensions and other C++ tools compile successfully.
After that, please clone the repo.
pip install https+git://gitlab.libresilicon.com/generator-tools/librepdk.git
Don't forget to make sure that all the submodules and their submodules are cloned
git submodule update --init --recursive
For placement of discrete componentes used in more complex components like Driver Circuits, OpAmps, etc. IdeaPlaceExPy is being used.
IdeaPlaceExPy requires the Python system headers to be installed and the virtual env has to match the Python version with which it was compiled.
Using LibrePDK in a Virtual Environment (FINAL SETUP)
It is recommended to use LibrePDK in a Python virtual environment to avoid dependency conflicts with system-wide Python packages.
After you've installed all the below dependencies the recommended way of installing the remaining dependencies is to run
uv sync --no-cache
Building your own Docker images
Inside of the LibrePDK source folder you will find a script where you can uncomment and comment specific build stages of the multistage Docker build covering all the dependencies
Check out the script scripts/build_docker_images.sh
Components
LibrePDK provides generators for the basic components usually found within a VLSI/ULSI design, such as resistors, capacitors, diodes and transistors.
Capacitors
LibrePDK can calculate the specific geometry based on the device rules and available parameters for generating any desired target capacitance value. Below a 50pF capacitor can be seen. You will notice the enormous dimensions of the structure.

Usually we deal with femto Farad in VLSI design so you should never be in a situation where you have large capacitors on your chip.
LibrePDK still can generate you a device, you just won't be happy about it.
Resistors
There's two types of resistor structures available: Meander and strip resistors
LibrePDK automatically adds a guard ring around any resistor which should be on a well
The meander here is 200 Ohms for GF180A@3.3V

The meander here is 500 Ohms for GF180A@3.3V

Diodes

While normal fingered diodes now have been implemented Schottky diodes still are work in progress.
Schottky diodes
Those are not yet implemented
Transistors
In order to make sure that our transistors don't go up in flame, we have to take the hot carrier migration and thermal budget into consideration when we decide what transistor to use and whether it should have only one gate or should be fingered.
LibrePDK takes care of this and chooses the right transistor with the right amount of fingers for you based on the target operating voltage and current you plan to pump through it, you provide.
Additionally, you can also overwrite the thermal budget which usually is assumed to be for an internal circuit which isn't bonded directly to the outside.
When LibrePDK calculates that electron migration and thermal budget constraints don't allow for a single gate transistor it will dynamically create a fingered structure, either with bulk and source connected or not with the proper guard ring.

Libre PDK may also decide to just generate a single gate transistor in cases where there's very little power involved

Pad Cells
Last but not least: It contains the Pad Cell Generator which produces beauties like this
