├── LICENSE ├── README.md ├── formula_renames.json ├── icestorm.rb ├── nextpnr-ecp5.rb ├── nextpnr-generic.rb ├── nextpnr-ice40.rb └── project-trellis.rb /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2019-present, Kate Temkin 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Homebrew Repository for Open-Source FPGA Tools 2 | 3 | In recent years, there's been an amazing reniassance of open-source FPGA tools -- including tools that allow creation of 4 | usable FPGA bitstreams using entirely open-source tools. This is amazing -- especially as it allows us to avoid running 5 | clunky vendor GUIs on the few Windows / Linux distributions they support. 6 | 7 | This repostiory allows you to easily install some of those open-source toolchains. 8 | 9 | ## Getting Started -- ice40 10 | 11 | To build FPGA programs for iCE40 boards like the [iCEBreaker](https://github.com/icebreaker-fpga/icebreaker), you'll need 12 | the `icestorm`, `yosys`, and `nextpnr` tools. 13 | 14 | Installing a simple toolchain is as easy as running the following: 15 | 16 | ``` 17 | $ brew tap ktemkin/oss-fpga 18 | $ brew install --HEAD icestorm yosys nextpnr-ice40 19 | ``` 20 | 21 | ## Getting Started -- ecp5 22 | 23 | To build FPGA programs for ECP5 boards like [Foxglove](https://github.com/greatfet-hardware/foxglove), you'll need 24 | the `project-trellis`, `yosys`, and `nextpnr` tools. 25 | 26 | Installing a simple toolchain is as easy as running the following: 27 | 28 | ``` 29 | $ brew tap ktemkin/oss-fpga 30 | $ brew install --HEAD project-trellis yosys nextpnr-trellis 31 | ``` 32 | -------------------------------------------------------------------------------- /formula_renames.json: -------------------------------------------------------------------------------- 1 | { 2 | "nextpnr-trellis": "nextpnr-ecp5" 3 | } 4 | -------------------------------------------------------------------------------- /icestorm.rb: -------------------------------------------------------------------------------- 1 | class Icestorm < Formula 2 | desc "tools for documenting and working with iCE40 FPGA files" 3 | homepage "https://github.com/cliffordwolf/icestorm" 4 | head "https://github.com/cliffordwolf/icestorm.git" 5 | 6 | depends_on "pkg-config" => :build 7 | depends_on "gnu-sed" => :build 8 | depends_on "libftdi" 9 | depends_on "python" 10 | depends_on "icestorm" 11 | 12 | def install 13 | 14 | # icestorm now uses sed in its makefiles, but assumes gnu-sed syntax; we'll patch them to use 15 | # homebrew's names for gnu-sed 16 | # upstream has fixed the syntax. Now works properly with SED on darwin (see Issue #4). 17 | # inreplace 'icebox/Makefile', 'sed', 'gsed' 18 | 19 | system "make", "install", "PREFIX=#{prefix}" 20 | 21 | # FIXME: Icestorm installs a set of utility functions and database definitions into /bin/, 22 | # as it lacks e.g. a setup.py for its module. This should be correced in icestorm, but I'm leaving it 23 | # for now (I should fix this upstream). 24 | end 25 | 26 | end 27 | -------------------------------------------------------------------------------- /nextpnr-ecp5.rb: -------------------------------------------------------------------------------- 1 | class NextpnrEcp5 < Formula 2 | desc "portable FPGA place-and-route tool" 3 | homepage "https://github.com/YosysHQ/nextpnr" 4 | head "https://github.com/YosysHQ/nextpnr.git" 5 | 6 | depends_on "cmake" => :build 7 | depends_on "pkg-config" => :build 8 | depends_on "eigen" => :build 9 | depends_on "python@3.9" 10 | depends_on "boost" 11 | depends_on "boost-python3" 12 | depends_on "qt5" 13 | depends_on "project-trellis" 14 | 15 | def install 16 | system "cmake", "-DARCH=ecp5", "-DTRELLIS_INSTALL_PREFIX=#{HOMEBREW_PREFIX}", \ 17 | ".", *std_cmake_args, "-DBoost_NO_BOOST_CMAKE=on", "-DBUILD_TESTS=OFF" 18 | system "make", "install" 19 | end 20 | 21 | end 22 | -------------------------------------------------------------------------------- /nextpnr-generic.rb: -------------------------------------------------------------------------------- 1 | class NextpnrGeneric < Formula 2 | desc "portable FPGA place-and-route tool" 3 | homepage "https://github.com/YosysHQ/nextpnr" 4 | head "https://github.com/YosysHQ/nextpnr.git" 5 | 6 | depends_on "cmake" => :build 7 | depends_on "pkg-config" => :build 8 | depends_on "eigen" => :build 9 | depends_on "python@3.8" 10 | depends_on "boost" 11 | depends_on "boost-python3" 12 | depends_on "qt5" 13 | 14 | def install 15 | system "cmake", "-DARCH=generic", ".", *std_cmake_args, "-DBUILD_TESTS=OFF" 16 | system "make", "install" 17 | end 18 | 19 | end 20 | -------------------------------------------------------------------------------- /nextpnr-ice40.rb: -------------------------------------------------------------------------------- 1 | class NextpnrIce40 < Formula 2 | desc "portable FPGA place-and-route tool" 3 | homepage "https://github.com/YosysHQ/nextpnr" 4 | head "https://github.com/YosysHQ/nextpnr.git" 5 | 6 | depends_on "cmake" => :build 7 | depends_on "pkg-config" => :build 8 | depends_on "eigen" => :build 9 | depends_on "python@3.9" 10 | depends_on "boost" 11 | depends_on "boost-python3" 12 | depends_on "qt5" 13 | depends_on "icestorm" 14 | 15 | def install 16 | system "cmake", "-DARCH=ice40", ".", *std_cmake_args, "-DBoost_NO_BOOST_CMAKE=on", "-DBUILD_TESTS=OFF", "-DICEBOX_ROOT=#{HOMEBREW_PREFIX}/share/icebox" 17 | system "make", "install" 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /project-trellis.rb: -------------------------------------------------------------------------------- 1 | class ProjectTrellis < Formula 2 | desc "tools for documenting and working with ECP5 FPGA files" 3 | homepage "https://github.com/SymbiFlow/prjtrellis" 4 | head "https://github.com/SymbiFlow/prjtrellis.git" 5 | 6 | depends_on "cmake" => :build 7 | depends_on "boost-python3" => :build 8 | depends_on "python@3.9" 9 | depends_on "libftdi" => :recommended 10 | depends_on "open-ocd" => :recommended 11 | 12 | def install 13 | cd "libtrellis" do 14 | 15 | # Modify libtrellis to not depend on local tags, as we're not rapidly 16 | # rebuilding as the CMake script assumes. 17 | inreplace "CMakeLists.txt", "git describe", "git describe --always" 18 | 19 | system "cmake", ".", *std_cmake_args, "-DBoost_NO_BOOST_CMAKE=on" 20 | system "make", "install" 21 | end 22 | end 23 | 24 | end 25 | --------------------------------------------------------------------------------