A comprehensive Nix-based setup for Electronic Design Automation (EDA) tools, providing a reproducible development environment for digital circuit design, analog simulation, and VLSI layout.
This project packages and provides easy access to essential EDA tools through the Nix package manager, ensuring:
- Reproducible builds across different systems
- Isolated environments without conflicts
- Easy setup for students, researchers, and engineers
- Version consistency across team members
- Yosys - RTL synthesis framework for Verilog HDL
- OpenROAD - Complete RTL-to-GDSII platform (commented out - WIP)
- Xschem - Schematic capture and netlist generator
- Xcircuit - Circuit drawing and schematic capture
- NGSpice - Mixed-level/mixed-signal circuit simulator
- Xyce - High-performance analog circuit simulator
- Magic VLSI - VLSI layout editor
- KLayout - High-performance layout viewer and editor
- Netgen - LVS (Layout vs Schematic) tool
- IRSIM - Switch-level simulator
- Open PDKs - Open-source PDK installer (commented out - WIP)
CAD_nix_setup/
βββ README.md # This file
βββ LICENSE # GPL v2 license
βββ default.nix # Main Nix expression defining all packages
βββ shell.nix # Development shell configuration
βββ pkgs/ # Individual package definitions
β βββ irsim/
β βββ klayout/
β βββ magic-vlsi/
β βββ netgen/
β βββ ngspice/
β βββ open_pdks/ # Work in progress
β βββ openroad/ # Work in progress
β βββ xcircuit/
β βββ xschem/
β βββ xyce/
β βββ yosys/
βββ simulation/ # Directory for simulation projects
βββ result/ # Nix build outputs (generated)
- Nix package manager installed on your system
# Install Nix (if not already installed) curl -L https://nixos.org/nix/install | sh # Install nix-bin sudo apt install nix-bin
Enter a shell with all EDA tools available:
nix-shellThis will:
- Build all EDA tools
- Add them to your PATH
- Provide a ready-to-use environment
# Build a specific tool
nix-build -A yosys
nix-build -A magic-vlsi
nix-build -A ngspice
# Build all tools
nix-build -A all# Install all tools to your user profile
nix-env -f . -iA all# Enter the development environment
nix-shell
# Synthesize Verilog with Yosys
yosys -p "read_verilog design.v; synth; write_json design.json"
# View results in KLayout
klayout design.gds# Enter the development environment
nix-shell
# Create schematic with Xschem
xschem
# Simulate with NGSpice
ngspice simulation.cir
# For high-performance simulation
xyce netlist.cir# Enter the development environment
nix-shell
# Create/edit layout with Magic
magic -T technology_file layout.mag
# Verify with Netgen (LVS)
netgen -batch lvs "layout.spice" "schematic.spice"
# View layout in KLayout
klayout layout.gds- Create a new directory in
pkgs/toolname/ - Add a
default.nixfile with the package definition - Import it in the main
default.nix - Add it to the build inputs in
shell.nix
Each tool's package definition is in pkgs/toolname/default.nix. Modify these files to:
- Update versions
- Add build dependencies
- Fix build issues
- Add patches
# Test build of a single package
nix-build -A toolname
# Test the development shell
nix-shell --run "which toolname"
# Clean build outputs
rm -rf result/Build failures: Check the specific tool's build log:
nix-build -A toolname 2>&1 | tee build.logMissing dependencies: Ensure all required system packages are available. On NixOS, they're handled automatically. On other systems, you might need additional packages.
Path issues: Make sure you're in the nix-shell when trying to run tools:
nix-shell
which magic # Should show a /nix/store/... pathThis project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test the build
- Submit a pull request
- β Stable: irsim, klayout, magic-vlsi, netgen, ngspice, xcircuit, xschem, xyce, yosys
- π§ Work in Progress: openroad, open_pdks
Happy designing! π¬β‘