MagicVLSI DRC and LVS - WIP
MagicVLSI is an open-source EDA tool capable of real-time DRC detection, generating SPICE (Simulation Program with Integrated Circuit Emphasis) netlist, and more.
Getting Started with Magic
Note: By convention and for simplicity, MagicVLSI will be referred to as Magic in this documentation.
First, read over the official documentation of Magic.
There are two ways to use Magic: by installing it directly and by cloning it through GitHub and running it through your terminal. The second method is usually preferred as you have an easier time updating this version (through updates using GitHub).
Below, a method to run Magic through GitHub in a Linux-based environment is presented. WSL (Windows Subsystem for Linux) compatible. For more information on how to run a Linux-based environment on a Windows device, check "How to install Linux on Windows with WSL."
First, update the system and install a graphical interface
sudo apt update && sudo apt upgrade
sudo apt install m4 tcl-dev tk-dev libx11-dev tcsh cshNext, clone the official GitHub repository (create a GitHub account first and link your account to the terminal - for more instructions, see the GitHub Docs):
git clone https://github.com/RTimothyEdwards/magic.git The terminal should display something similar to this (do not type this into your terminal):
Cloning into 'magic'...
remote: Enumerating objects: 18948, done.
remote: Counting objects: 100% (2861/2861), done.
remote: Compressing objects: 100% (409/409), done.
remote: Total 18948 (delta 2520), reused 2453 (delta 2451), pack-reused 16087 (from 2)
Receiving objects: 100% (18948/18948), 10.95 MiB | 4.09 MiB/s, done.
Resolving deltas: 100% (12790/12790), done.
Updating files: 100% (1292/1292), done.After "magic" finishes cloning into your folder:
Now, running magic in your terminal, the layout and prompt screen should both pop up on screen, and the most basic version of magic is now running on your device!

PDK (Process Design Kit)
To actually make Magic useful, a PDK is required; this is basically a set of models, design rules, device characteristics, and materials that tell the EDA software what is available and what can be used. Usually, a PDK is a collection of foundry-supplied files; however, Hackerfab's goal lies in the creation of a foundry, and thus, the PDK must be determined, created, and verified by each individual lab based on their specific materials, device characteristics, and capabilities.
Since this is a difficult process, we can first utilize the PDKs already developed by other foundries that are open-sourced to draw layers, test out ideas, and create masks; this is possible through the GitHub OpenPDK:
First, make sure to cd out of your magic directory, then:
Here, the SKY130 PDK will be used. This is an open-source 130 nm CMOS Process Design Kit (PDK) released by SkyWater Technology, Efabless, and Google, and is one of (if not) the most popular PDKs in the open-source community.
NOTE!!! Before you run the step above, this will take a significant amount of time (~hours), and space in your device, as PDKs are massive, and this contains multiple. Also note that the -j$(nproc) flag runs all your CPU cores together in parallel to speed up the process; if you want to limit CPU use, remove the -j flag.
Then, create a folder for SKY130. In this folder, every time you run magic, you will run it in conjunction with the SKY130 PDK
After running these scripts, you should see a .magicrc file being copied into your new folder. This file is recognized each time "magic" runs, and acts as a startup script for the application, responsible for the .tech file (the magic equivalent of PDK) and the interface.
Below is what the .magicrc file is supposed to look like:
Now run "magic" again in your terminal (while inside the sky130_design folder), the Magic layout tool and prompt should pop up again with more materials/elements on the side, such as "nwell", "pwell", ... Then you have integrated a fully functional MagicVLSI with the SKY130 PDK and can start your design process!
Should look something similar to this:

PDK, DRC, LVS, and the .tech file
Below are the steps developed to create an LVS (Layout vs. Schematic) standard process using MagicVLSI. Including the use of Netgen, Xschem, and the process of creating your own PDK (.tech) file in magic, as well as creating interactive User Interface windows using the .magicrc file.
Background:
Before starting this process, it is important to understand the relationships between these acronyms. PDK stands for Process Design Kit and has been introduced in the previous section.
DRC stands for Design Rule Check; design rules are usually rules dictated by the fab (foundry) to make sure the chip that has been designed in an EDA tool is actually manufacturable and will have a relatively good yield rate. Some examples of design rules are the minimum width of a material (PolySi, N-Diffusion,...), the minimum spacing. Check the Synopsys guide for more information. Design rules are usually integrated as part of the PDK, and Magic will constantly check for violations through the live DRC feature.
No Errors, as you can see from the DRC=0 and green checkmark on top.

You can see that there are DRC violations here, as DRC is not 0, and the checkmark becomes red. Using the command "drc why" in the Magic terminal while highlighting the spots with white dots (meaning drc violation), you can see the reason for the error:

Here it states:
Meaning the width of the n-diffusion is too small and needs to be expanded.
Layout Versus Schematic (LVS) compares the extracted netlist from the layout (with physical layers and specific materials) to the original schematic netlist (similar to a circuit diagram with specifications) to determine if they match. The comparison check is considered clean if all the devices and nets of the schematic match the devices and the nets of the layout. In more advanced comparisons, LVS will compare the device characteristics to see if they fit within the accepted tolerances. This is through generating a SPICE (Simulation Program with Integrated Circuit Emphasis) netlist using the layout tool and the schematic tool. This is similar to a textual or mathematical representation of the circuit. Below are two examples of SPICE netlists based on the SKY130 PDK:
A standard 1.8V NMOS in Magic exported as a SPICE netlist:
A standard 1.8V NMOS in Xschem (a schematic creation tool) exported as a SPICE netlist:
An LVS checking between these two SPICE netlists using Netgen looks like this:
The final line is the most important: "Final result: Circuits match uniquely." This is the best thing to see, though obvious, it holds true in this case as the two circuits are simple NMOSes with the same dimensions.
Last updated
