tt_precheck.sh
Runs the Tiny Tapeout precheck locally, so a submission is not first rejected by CI.
make precheck CELL=<CELL> # from work/
bash tt_precheck.sh <CELL> [TAPEOUT_DIR]
TAPEOUT_DIR defaults to ../tapeout.
It reproduces what the TinyTapeout/tt-gds-action/precheck action does, which is to clone tt-support-tools and run
precheck/precheck.py --gds <top>.gds --tech sky130A
with klayout, magic and the sky130A PDK on the path. That covers magic DRC, KLayout DRC, forbidden layers, pin labels, the pin and boundary checks, the power and analog pin checks and verilog syntax.
Environment
| Variable | Default |
|---|---|
TT_TOOLS | ~/github/tt-support-tools |
PDK_ROOT | /opt/pdk/share/pdk |
EDA_BIN | /opt/eda/bin |
KLAYOUT | auto-detected |
PYTHON | first python ≥ 3.10 found |
TT_TECH | sky130A |
If tt-support-tools is missing the script says exactly what to clone.
What it does
- Finds klayout, including inside a macOS
.appbundle, and a python new enough for the precheck. - Creates
tt-support-tools/precheck/.venvon first run and installs the requirements. On arm64 macOSgdstkis built from source, soCMAKE_PREFIX_PATHis pointed at Homebrew’s qhull. - Symlinks the klayout it found into the venv, since
precheck.pycallsklayoutby name. On macOS it also drops in annprocshim, because some KLayout DRC decks call it to pick a thread count. - Stages
<TAPEOUT>/precheck_run/with<CELL>.gds,<CELL>.lef,<CELL>.v(copied fromsrc/project.v) andinfo.yaml, the layoutprecheck.pyexpects. - Runs the precheck from inside
tt-support-tools/precheck, which its own relative paths require.
set -euo pipefail, so the first failure stops it.