ChipUSM / usm-vlsi-tools

Docker image for vlsi work
Apache License 2.0
1 stars 0 forks source link

Chip USM Docker Environment for IC Design and Implementation

Docker image for open source integrated circuit development.

This work is based on:

Installed Tools / PDKs

Tool Description
ngspice SPICE analog and mixed-signal simulator
xschem Schematic Editor
magic Layout editor with DRC/Extraction capabilities
klayout Layout viewer and editor for GDS
netgen Netlist Comparison
cvc Circuit validity checker
cace Circuit Characterization engine
gdsfactory Python module for gds generation
glayout Python module for pdk-agnostic layout automation
pygmid Python module for systematic circuit sizing
openvaf Verilog-A to OSDI compiler

The image also contains sky130A, gf180mcuD and ihp-sg13g2 pdks, to change between pdks use the set_pdk command. i.e. set_pdk sky130A. IHP PDK requires the compilation of OSDI files, which is performed when starting a bash terminal. If the compilation fails, just open another bash terminal.

Versions and commits are specified on the Dockerfile.

Host Required Tools

Some of the tools are installed using terminal commands. Windows users should use Powershell.

Docker

Docker on Windows and Mac is installed with Docker Desktop. On Linux it requires a bunch of steps listed on this website.

IMPORTANT!! Docker Desktop should be running while using the environment, if not, the docker commands fails with a pipe error. The app can run on background without the window opened.

alt text

Visual Studio Code

One of the ways in which docker container can be used is through Visual Studio Code and the devcontainer extension. VsCode website has an installer for the editor.

The extension can be installed with the extension explorer (Ctrl-Shift X), or with the following command:

code --install-extension ms-vscode-remote.remote-containers

Git Installation

Most important tool on any project: Control version system. A powershell command to install it is provided.

winget install --id Git.Git -e --source winget

Makefile Windows Installation

Use winget to install Make from the ezwinports project.

winget install ezwinports.make

XServer Installation

Programs that uses graphical user interfaces (xschem, magic, ngspice plots, klayout) requires an X Server running on the host machine. Linux desktops already have one. Windows and Mac requires an external server.

To install vcxsrv goto releases page and install the 21.1.10 release (direct link to 21.1.10 the installer). Since a component of 21.1.13 release is targeted as a virus we are not going to use that version.

IMPORTANT!!: Add installation directory to Path. This allows the use of vcxsrv from terminal.

  1. Open Control Panel and search for environment variables
  2. Select the option that modifies current account
  3. On User Variables, add the directory to Path user variable.
  4. Reopen each terminal to reload the path.

alt text


$~$

USM VLSI Tools Usage

To clone the repo, use this command:

git clone --recurse --depth=1 https://github.com/ChipUSM/usm-vlsi-tools.git

Inside it, there's a Makefile used as a command line interface (CLI) to run programs and start the environment.

IMPORTANT!! Docker Desktop should be running while using the environment, if not, the docker commands fails with a pipe error. The app can run on background without the window opened.

alt text


$~$

DevContainer with External XServer

This should work on Windows, Linux and Mac, but it's only tested on windows.

  1. Verify that Docker Desktop is running
  2. Open the directory <PROJ>/shared_xserver with Visual Studio Code.
  3. Install Devcontainer extension if it's not installed
  4. Open the command palette (Use Ctrl+Shift+P) and run the command Dev Containers: Reopen in Container..
# Open devcontainer
make start-devcontainer

This workflow allows the use of Visual Studio Code to interact with the container, use the git capabilities, install extensions and instantiate multiple terminals.

Note: PyCharm supports devcontainers, but it seems to have troubles with graphical user interfaces. VSCode is recommended until someone takes care of PyCharm support.


$~$

Windows Only: Using the WSL Ubuntu Xserver instance with DevContainer

This workflow does not require the use of an external Xserver, since it uses the one provided on WSL Ubuntu distributions.

Not recommended. This option may have a lot of bugs related with implicit configurations.

  1. Verify that Docker Desktop is running
  2. Open the directory <PROJ>/shared_wsl_xserver with Visual Studio Code
  3. Install Devcontainer extension if it's not installed and run the command Dev Containers: Reopen in Container.. Use Ctrl+Shift+P to open Command Palette
  4. This configuration requires to set the global variable WSL_DISTRO, this requires restart the system to reload the environment variables. This is only required once

Suggestions for cleaner ways to use x11 capabilities of WSL are accepted. I have not figured out how to make windows reload those variables, so for now the only solution is to restart the system. There must be a better way