News Uni Dev Res Blag

/u/ - VHDL development in Ubuntu Linux

2010/08/31 - 18:40


What you're about to read is basically this raped beyond recognition by my crazy antics.
I haven't actually used VHDL before, but I'll update this article as I hit roadblocks myself.


No, we shall not be using any proprietary software. Concider the license fees you'll soon face for just a second; you'll see where I'm going.
Alas, I am not here to preach about freedom. Not today. Let's just get started, shall we?

Installing the VHDL environment

Whip out your terminal, it's time to get dirty. You'll be needing GHDL for this, so sudo apt-get install ghdl gtkwave
Now your rig is ready to crunch them codes. Much lighter than those 2.81 giggabates amirite?

Setting up a new project

Right now I could ask you to do everything in a terminal, and that's exactly what I'm going to do so DON'T YOU CLOSE THAT TERMINAL SON

First off we'll have to make ourselves a folder to put the project in. cd; mkdir vhdl; cd vhdl
Next up is writing our VHDL code. Do this with nano or mousepad, heck anything is fine.
As we already have some code to compile and test, let's set up a motherfucking makefile.

We're going to use this nifty bash script instead of compiling manually; touch; chmod u+x; nano which contains:

n="eq2_testbench" rm -rf wark; mkdir wark; ghdl -i --workdir=wark *.vhd &&\ ghdl -m --workdir=wark $n &&\ ghdl -r $n --vcd=output.vcd &&\ gtkwave output.vcd

...changing the value of $n to whatever your testbench entity is named.

That's it?

That's it. Now you can simply ./ to sanity-check, compile, run and view the output of your project.

Holy shit on a stick this is awesome

So yeah, I told you there were alternatives. Now you're rocking the Very Herp Derp Logic in your Obento. Like a boss.
Great going brah, now grab yourself a pint and watch some アニメ.

Copyright © 2010 Ed Edland