Tiny Tapeout has a local hardening guide to build your design locally. However, the guide does not list required system dependencies and is a bit difficult to follow. This guide aims to be more complete.
This was last tested for the TT10 shuttle.
Setting up a Container for TT
The local hardening guide assumes that we have a local linux OS with certain dependencies installed. In order to be independent of the host OS, I prefer to build in a container. In this case this is slightly more complicated, as the flow requires a working docker daemon and graphical output. To satisfy these requirements, we’ll set up a container in distrobox (with podman backend) that supports running docker.
First, temporarily disable SELinux, as the installation of some packages fails otherwise:
sudo setenforce 0
Then create a distrobox container that supports running docker:
distrobox create --image fedora:41 --additional-packages "systemd docker" --init --unshare-all tt
When using a recent Fedora OS, you’ll have to disable SELinux on the host and load the ip_tables
kernel module:
sudo setenforce 0
sudo modprobe ip_tables
Next, enable docker in the container and add our user to the docker group:
distrobox enter tt
sudo systemctl enable --now docker
sudo usermod -aG docker $USER
exit
We have to exit the container and enter again to make sure the group information is updated. After that, we should be able to use docker:
distrobox enter tt
docker info
Client:
Version: 27.3.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: 0.18.0
Path: /usr/libexec/docker/cli-plugins/docker-buildx
Installing Dependencies
Now let’s install the dependencies for the TT flow in the container:
sudo dnf group install c-development development-tools
sudo dnf install python3-tkinter python3-devel swig
# Install NIX
sh <(curl -L https://nixos.org/nix/install)
Following the Hardening Guide
We can now follow the local hardening guide:
git clone https://github.com/TinyTapeout/tt10-factory-test factory-test
git clone -b tt10 https://github.com/TinyTapeout/tt-support-tools factory-test/tt
mkdir ttsetup
python3 -m venv ttsetup/venv
source ttsetup/venv/bin/activate
pip install -r factory-test/tt/requirements.txt
export PDK_ROOT=$PWD/ttsetup/pdk
export PDK=sky130A
export OPENLANE2_TAG=2.1.9
At least for me, installation of libparse
always failed when simply following the guide.
After manual installation, the rest of the process works fine:
git clone --recursive --branch 0.3.1 https://github.com/efabless/libparse-python.git
pip install libparse-python/
rm -rf libparse-python
Now we can install the remaining python packages:
pip install openlane==$OPENLANE2_TAG
And now we’re finally ready to build the project:
source $HOME/.nix-profile/etc/profile.d/nix.sh
cd factory-test
./tt/tt_tool.py --create-user-config --openlane2
./tt/tt_tool.py --harden --openlane2
./tt/tt_tool.py --print-warnings --openlane2
Adjusting the Flow
Once you have the flow running locally, you can now look at reports and adjust the flow to your needs. Behind the scenes, Tiny Tapeout uses the OpenLane 2 flow. Output files, reports and most configuration will therefore follow the usual OpenLane setup. For details, refer to the OpenLane documentation.
There is sometimes confusion about OpenLane and OpenROAD:
OpenLane and the OpenROAD Flow Scripts are independent RTL-to-GDS flow projects: They combine various tools in a process that takes hardware description language files as inputs, and outputs a GDS file ready for tapeout.
The main OpenROAD application on the other hand performs various steps for digital ASIC design, such as place and route. The OpenROAD application is used in both the OpenROAD Flow Scripts and the OpenLane flows.
To give you a head start, one of the first things you may want to do is check the size of your design.
All output files, reports and command logs are available in the runs/wokwi/
folder.
For area usage specifically, let’s have a look at 27-openroad-globalplacement/openroad-globalplacement.log
.
The relevant part of the file looks like this:
[INFO GPL-0006] NumInstances: 1324
[INFO GPL-0007] NumPlaceInstances: 1021
[INFO GPL-0008] NumFixedInstances: 303
[INFO GPL-0009] NumDummyInstances: 0
[INFO GPL-0010] NumNets: 1040
[INFO GPL-0011] NumPins: 3459
[INFO GPL-0012] DieBBox: ( 0.000 0.000 ) ( 161.000 111.520 ) um
[INFO GPL-0013] CoreBBox: ( 2.760 2.720 ) ( 158.240 108.800 ) um
[INFO GPL-0016] CoreArea: 16493.318 um^2
[INFO GPL-0017] NonPlaceInstsArea: 574.301 um^2
[INFO GPL-0018] PlaceInstsArea: 11977.738 um^2
[INFO GPL-0019] Util: 75.242 %
[INFO GPL-0020] StdInstsArea: 11977.738 um^2
[INFO GPL-0021] MacroInstsArea: 0.000 um^2
Here, Util
is the measurement you’re probably looking for.
To customize the Tiny Tapeout setup (for example to set the number of tiles used), edit info.yaml
.
Refer to the comments in the info.yaml file for more information on available options.
For more complex customization, you can directly adjust the OpenLane configuration in src/config.json
.
If you do, you can refer to these documentation sites:
- OpenLane Getting Started
- OpenLane Config Variables
- OpenLane Timing Closure
- OpenROAD Main Documentation
- OpenROAD Clock-Tree Synthesis
In a future blog post, I will summarize some common options and provide some examples for common adjustments.