Kestrel-3

Install Verilator on VoidLinux
Login

Installing Verilator

Before building this project, you should always start out with the latest versions of Verilator and Yosys. On this page, I detail how to build Verilator.

Start With a Fresh Copy of Verilator

I perform these sets as root user, as it saves typing overall and I trust my compiler tool-chain. If you feel uncomfortable doing this, adapt these instructions appropriately.

If you already have a copy of Verilator installed, first uninstall it. I assume the directory in which you cloned Verilator is pointed at by $CLONE_DIR.

cd $CLONE_DIR/verilator
make uninstall
cd ..
rm -rf verilator
unset VERILATOR_ROOT

Clone the latest version of Verilator, and build the latest stable version.

cd $CLONE_DIR
git clone http://git.veripool.org/git/verilator
cd verilator
git checkout stable
autoconf
./configure --prefix=/opt/verilator
make
make test && make install

NOTE! Unlike the documented instructions, do not set the VERILATOR_ROOT environment variable. The ./configure step takes care of recording appropriate paths for you.

Make Sure It Works

These steps are to be performed as a normal, everyday, non-root user.

mkdir project
cd project
cat <<EOF >our.v
module our;
        initial begin $display("Hello World"); $finish; end
endmodule
EOF
cat <<EOF >our.cpp
#include "Vour.h" 
#include "verilated.h" 
int main(int argc, char **argv, char **env) {
        Verilated::commandArgs(argc, argv);
        Vour *top = new Vour;
        while (!Verilated::gotFinish()) { top->eval(); }
        delete top;
        exit(0);
}
EOF
unset VERILATOR_ROOT    # this is what makes everything work for me!
verilator -Wall --cc our.v --exe our.cpp
make -j -C obj_dir -f Vour.mk Vour
obj_dir/Vour

If everything worked, the result should be a hello world message on the console.