Code Monkey home page Code Monkey logo

vunit-mode's Introduction

VUnit Mode check melpa badge

This is a package for GNU Emacs that can be used to interface with VUnit which is an open-source testing framework for VHDL/SystemVerilog.

It hooks to the VHDL mode and wraps the function calls to the run script used by VUnit, therefore allows verification of unit tests while writing code without ever leaving Emacs. At the moment, it is in a very early stage of development where it simply makes use of the compile package and hydra, but in the near future and with some support from the community, the idea is to implement something similar to Magit for VUnit.

Prerequisites

The basic requirements are that the HDL simulator (eg. Modelsim) is in the path and that VUnit is installed in the python environment.

Installation

MELPA

The preferred installation method is through MELPA.

Add MELPA in your ~/.emacs or ~/.emacs.d/init.el init file.

(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))

Then install the package

M-x package-refresh-contents RET
M-x package-install RET vunit-mode RET

Finally enable the mode in your init file.

(require 'vunit-mode)
(global-vunit-mode t)

Manual

To manually install the package, clone this repository and add the following in your ~/.emacs or ~/.emacs.d/init.el init file.

(add-to-list 'load-path "/path-to-repository/")
(require 'vunit-mode)
(global-vunit-mode t)

Usage

Keybinding

The default keybinding to invoke vunit-mode is C-x x.

Keys highlighted in blue will execute the specified action and quit the vunit-mode command window. The ones marked in red, however, will add additional flags to the actions available in blue.

Menu Bar

Once a VHDL file is loaded in the buffer, the VUnit Menu will appear in the Menu Bar. It is also possible to set flags and run tests without having to know any key bindings at all.

Configuration

As for now, it is possible to configure the following variables using M-x Customize:

Path to the VUnit directory.

vunit-path

The Python executable used by VUnit.

vunit-python-executable

Name of the VUnit output directory.

vunit-run-outdir

Name of the python script to run.

vunit-run-script

Number of threads to use in parallel.

vunit-num-threads

Auto-scroll to bottom in the compile buffer.

vunit-auto-scroll

Contributing

Since this is my first application ever written in Emacs Lisp support and input from advanced developers is highly appreciated.

To report bugs and suggest new features please use the issue tracker. In order to merge some code, please open a pull request.

Acknowledgments

The idea for a VUnit Emacs mode seemed to be around for a while and was already discussed online a couple of years ago, however, for me, Markus Pfaff from FH-Hagenberg was the one who inspired me to take the implementation into my own hands and despite my lack of knowledge in elisp publish the code written so far.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.