stbenjam/quartus-container

★ 0Forks 0ShellGitHub ↗Compare

README

quartus-container

Build Intel/Altera FPGA projects using Quartus Prime Lite in a Podman container on macOS (including Apple Silicon via Rosetta 2).

Prerequisites

Usage

# Build a project
quartus-build /path/to/project

# Build with a MIF file baked into on-chip RAM
quartus-build --mif program.mif /path/to/project

# Build and program via USB Blaster
quartus-build --mif program.mif --program /path/to/project

The first run builds the container image (~10 min). Subsequent builds reuse the cached image and only run synthesis (~1 min).

Options

  --mif <file.mif>     Bake a MIF into on-chip RAM (altsyncram init_file)
  --program            Program the FPGA after build via openFPGALoader
  --cable <name>       openFPGALoader cable (default: usb-blaster)
  --tar <path>         Path to Quartus installer tarball
  --image <name>       Container image name (default: quartus-lite)

How it works

  1. Builds an x86_64 Ubuntu 20.04 container with Quartus Prime Lite
  2. Mounts your project directory into the container
  3. Fixes absolute SEARCH_PATH entries in the QSF for the container
  4. Optionally injects a MIF file into ram.vhd altsyncram instances
  5. Runs quartus_sh --flow compile
  6. Converts the output SOF to SVF format for openFPGALoader
  7. Restores all modified files
  8. Optionally programs the FPGA via USB Blaster

Notes

  • The container includes a workaround for Intel TBB's malloc proxy crashing under Rosetta 2 (replaces libtbbmalloc_proxy.so with libtbbmalloc.so)
  • All device families from the Quartus tarball are installed; if you only need specific families, edit the Containerfile's --disable-components list
  • The SVF programming via openFPGALoader replaces the need for Quartus Programmer, which has no macOS support

Contributors

stbenjam

Issues