Skip to content

Landflier/nix-opensource-eda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

44 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EDA Tools Nix Setup

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.

🎯 Purpose

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

πŸ› οΈ Included Tools

Digital Design & Synthesis

  • Yosys - RTL synthesis framework for Verilog HDL
  • OpenROAD - Complete RTL-to-GDSII platform (commented out - WIP)

Analog Circuit Design & Simulation

  • 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

Layout & Physical Verification

  • Magic VLSI - VLSI layout editor
  • KLayout - High-performance layout viewer and editor
  • Netgen - LVS (Layout vs Schematic) tool
  • IRSIM - Switch-level simulator

Process Design Kits

  • Open PDKs - Open-source PDK installer (commented out - WIP)

πŸ“ Project Structure

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)

πŸš€ Quick Start

Prerequisites

  • 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

Option 1: Development Shell (Recommended)

Enter a shell with all EDA tools available:

nix-shell

This will:

  • Build all EDA tools
  • Add them to your PATH
  • Provide a ready-to-use environment

Option 2: Build Individual Tools

# Build a specific tool
nix-build -A yosys
nix-build -A magic-vlsi
nix-build -A ngspice

# Build all tools
nix-build -A all

Option 3: Install Globally

# Install all tools to your user profile
nix-env -f . -iA all

πŸ’» Usage Examples

Digital Design Flow

# 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

Analog Simulation Flow

# Enter the development environment
nix-shell

# Create schematic with Xschem
xschem

# Simulate with NGSpice
ngspice simulation.cir

# For high-performance simulation
xyce netlist.cir

Layout and Verification

# 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

πŸ”§ Development

Adding New Tools

  1. Create a new directory in pkgs/toolname/
  2. Add a default.nix file with the package definition
  3. Import it in the main default.nix
  4. Add it to the build inputs in shell.nix

Modifying Existing Packages

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

Building and Testing

# 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/

πŸ› Troubleshooting

Common Issues

Build failures: Check the specific tool's build log:

nix-build -A toolname 2>&1 | tee build.log

Missing 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/... path

πŸ“„ License

This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test the build
  5. Submit a pull request

πŸ“š Resources

🏷️ Status

  • βœ… Stable: irsim, klayout, magic-vlsi, netgen, ngspice, xcircuit, xschem, xyce, yosys
  • 🚧 Work in Progress: openroad, open_pdks

Happy designing! πŸ”¬βš‘

About

Nix shell containing all open-source eda tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published