Opensource VHDL simulator - NVC, installing on WSL-Ubuntu

We at AsFigo AsFigo love Opensource. Off late we have been helping some European customers adopt modern verification techniques using VHDL. As a byproduct we have been building a Python based VHDL utility to generate a generic testbench based on OSVVM. While doing so, our team stumbled upon few subtle simulator issues, see:

https://osvvm.org/forums/topic/sbrd-package-issue-with-modelsim-fpga-edition

Hence, we wanted to try out NVC - a relatively new opensource VHDL compiler (https://www.nickg.me.uk/nvc/index.html). While there are pre-built binaries for several OS there, we couldn't locate one for WSL - Windows + WSL running Ubuntu. So, we decided to build it from source - isn't it the best thing about opensource - build missing pieces yourself?  



So here is an Engineer's diary of how we got it up and running in less than 15 minutes! Fasten your seatbelt, off we go!

 Follow the below steps:

  • cd nvc-1.12.2
  • mkdir build
  • cd build/
  • sudo apt install llvm pkg-config libzstd-dev libdw-dev
  •  ../configure
  •  make
  •  sudo make install
Bingo! Off we go with NVC, try out a hello-world test generated via ChatGPT as below:

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_textio.all;
use std.textio.all;

entity hw is
end entity;

architecture Behavioral of hw is
begin
    process
        variable L : line;
    begin
        -- Write "Hello, World!" to the console
        write(L, string'("Hello, World!"));
        writeline(output, L);

        -- Stop simulation
        wait;
    end process;
end architecture;

Comments

Popular posts from this blog

Don't go "wild" with Associative arrays in SystemVerilog - PySlint it!

Porting a complete UVC to Verilator + UVM - an anecdote!

Opensource testbench generator for VHDL designs, OSVVM included!