VLSI

From DiLab
Revision as of 06:36, 19 June 2026 by Leo (talk | contribs) (My local setup)
Jump to: navigation, search

Open source VLSI design notes.

From Verilog/VHDL to GDSII for SKY or IHP technologies.

Prerequisites

These notes assume the host has Linux, e.g. Ubuntu 24.04 set up. All tools will be running under it.

Open Tools

Essential OSS HW design tools

  • gtkwave - Waveform viewer
  • iverilog - Icarus Verilog compiler
  • Verilator - compile RTL to C++, faster simulations
  • Yosys - RTL to gate level netlist
  • SymbiFlow - Toolchain to FPGA
  • Magic VLSI - transistor level layout design editor
  • KLayout - viewer and editor of GDSII files
  • OpenRoad - Automates floorplanning, placement, routing and timing.
  • OpenLane - Automated design flow, from verilog to GDSII, uses the tools above.

Open Technology PDKs

Process development kits (PDK) available for OSS VLSI:

  • IHP SG13G2 PDK
    • This is a 130nm BiCMOS process from the Leibniz Institute for High Performance Microelectronics, which generally offers higher performance (faster transitions) than Sky130.
    • ReadTheDocs

Other, less popular options:

  • GlobalFoundries 180nm MCU (GF180MCU)
    • A mature 180nm CMOS process with 5 layers of metal, widely used for analog and mixed-signal design. It is fully supported by Efabless for open-source shuttle programs.
  • ASAP7 (Arizona State Academic Process)
    • A 7nm predictive PDK used exclusively for academic research and educational purposes. It is often used for evaluating next-generation PnR flows (e.g., using Synopsys tools).
  • SCMOS (Scalable CMOS)
    • An older "Lambda-based" design rule set used before modern open foundry efforts, helpful for learning layout concepts, though not used for modern, high-performance silicon fabrication.

Tapeout

TinyTapeout: from idea/design to chip/PCB

Setup Openline2

9https://openlane2.readthedocs.io/en/latest/getting_started/installation_overview.html The advised path] is to setup NIX environment and then run openline2 from there, rather than using a dockerized version.

Install Nix

Set up the Nix environment:

sudo apt-get install -y curl

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf "
   extra-substituters = https://openlane.cachix.org
   extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
"

Make sure to close all terminals after you’re done with this step.

If have Nix already

nix-env -f "<nixpkgs>" -iA cachix
sudo env PATH="$PATH" cachix use openlane
sudo pkill nix-daemon

Install OpenLane 2 after Nix

git clone https://github.com/efabless/openlane2
nix-shell
openlane --smoke-test

Other tools

There are many other tools you could setup separately, just know that openlane2 expects and is sensitive to the versions of the tools, and may not work if your tool is older or newer.

My local setup

This is how I use the Openlane2 tools after the setup.

One important note is that they generate MANY intermediate and log files in the "runs" directory under your project, every time you run openlane. Usually my project is mapped toa cloud drive such as Dropbox, and spamming it with tons of files may create confusion when receiving an email later that someone has deleted 2000+ files from your account. Therefore I save the runs locally, outside the project directory. To achieve that, I run the following commands:

   cd git.local/openlane2
   nix-shell
   openlane --smoke_test               # Sanity test for the tools (optional)
   cd your/project/

   run_openlane_local.sh config.json   # will save run logs under work.local/... (recommended)
       or
   opennlane config.json               # will save the run logs in the project directory work/... (cloud?!)

Setting up a new project

A project is usually kept in one directory. It may contain:

  • config.json file with the project options. Potentially you could have several configs, for different technologies, although probably berret to have a separate project for each.
  • src/ directory with the Verilog or VHDL files
  • runs/ directory with many intermediate and log files as populated by the openlane2 tool(s).
    • The runs/ has a RUN<timestamp> folder for each openalne run. Each of those will have the following:
      • Folders from 01-... and up to 74-... or more with files according to the respective run steps
      • final/ directory with the final results, including the magic and klayout and gds files with the final layout, spice files, etc.
      • tmp - temporary directory.
      • flow, warning and error logs.

The config.json file

Technically other formats such as yaml are also supported, but lets stick to json. Here is an example of a simple config.json file for SKY PDK:

   {
       "DESIGN_NAME": "counter",
       "VERILOG_FILES": ["src/counter.v"],
       "CLOCK_PORT": "clk",
       "CLOCK_PERIOD": 10.0,
       "FP_CORE_UTIL": 40,
       "RT_MAX_LAYER": "met4"
   }

Here is another for IHP PDK:

   {
       "DESIGN_NAME": "counter",
       "VERILOG_FILES": ["src/counter.v"],
       "PDK": "sg13g2",
       "CLOCK_PORT": "clk",
       "CLOCK_PERIOD": 10.0,
       "FP_CORE_UTIL": 40,
       "RT_MAX_LAYER": "Metal4"
   }

Usecase: Simple counter

Usecase: RAM integration

TODO.

Usecase: NeoRV32 MCU

NeoRV32 is an open source MCU with many peripheral options written in VHDL.

GitHub repo