Home

Awesome

MELPA MELPA Stable Build Status

fpga.el - FPGA & ASIC Utils for Emacs

This package provides Emacs utilities for FPGA & ASIC tools of major vendors and open source:

Installation

MELPA

fpga is available on MELPA.

straight.el

To install it via straight with use-package:

(straight-use-package 'use-package)
(use-package fpga)

Basic config

First set which vendors you want tools for and then load the package.

For example, if you need tools for Xilinx/Cadence:

(setq fpga-feature-list '(xilinx cadence))
(require 'fpga)

If you need tools for Altera/Siemens:

(setq fpga-feature-list '(altera siemens))
(require 'fpga)

With use-package:

(use-package fpga
  :init
  (setq fpga-feature-list '(xilinx cadence)))

Features

Synthesis/Simulation compilation functions and modes

Compilation functions with their corresponding regexps are provided for each vendor tool:

These can be used as follows:

;; Assumes that you are working with Makefiles and that there is a target named
;; `vivado' that runs synthesis/simulation
(fpga-xilinx-vivado-compile "make vivado")

The package also provides compilation modes for each tool:

These are used by the package to define functions that perform synthesis/simulation compilations. For example, M-x fpga-xilinx-vivado-syn RET will prompt the user for an XPR project file. Once selected, a Vivado compilation with error message colorized will take place.

As an example, the snippet below has a similar effect as the previous one for Vivado synthesis/simulation:

(compile "make vivado")
(fpga-xilinx-vivado-compilation-mode) ; Runs in the *compilation* buffer
Demo video

https://github.com/gmlarumbe/fpga/assets/51021955/e9b59d83-ae78-458a-bf48-360d98bdcef2

Improved interactive shells

Shells with syntax highlighting and autocompletion are provided for the following vendors:

Demo video

https://github.com/gmlarumbe/fpga/assets/51021955/c4be8ebe-26a7-44a3-afe7-82c6928df6f4

Major-modes

The following major modes are provided to edit constraints and project files:

Vivado XDC Mode screenshot
<img src="https://github.com/gmlarumbe/fpga/assets/51021955/b9f622c7-9a34-43ad-8323-00157efdb3c5" width=100%>

Global Gtags creation from project files

Running M-x fpga-xilinx-vivado-tags RET or M-x fpga-altera-quartus-tags RET will prompt for a project file. It will be parsed and a gtags.files will be generated in the selected directory. This file will later be used to gather tags for the project files.

One of the uses of this feature could be filtering out unused files for definitions/references navigation. It can also be useful to generate the list of files used in a project for further hierarchy extraction.

Other packages