Building ghdl from source for Ubuntu 16.04 – mcode version

Based on input from Patrick Lehmann, I decided to re-install ghdl, now using the official GitHub site.

I learned from the README file how to build the mcode variant. I tried, and it worked fine (and it was much simpler than the gcc-based approach I tried earlier)!

Here are the commands that I used.

I downloaded and installed an Ada compiler, as instructed, and I proceeded with the build and install of ghdl, by first setting the PATH to include my newly installed Ada compiler, as

export PATH=/usr/gnat/bin:$PATH

I cloned the repo, using

git clone https://github.com/ghdl/ghdl.git

I configured and built ghdl, using

cd ghdl
./configure --prefix=/usr/local/ghdl_mcode
make

The installation was then done, as

ghdl:-$ sudo -i
# cd 
# PATH=/usr/gnat/bin/:$PATH make install
... 
...
# exit

That was all!

I could now build and run my hello world example, from my work-in-progress book about building a computer, as

vhdl:-$ export PATH=/usr/local/ghdl_mcode/bin/:$PATH
vhdl:-$ ghdl -a hello.vhdl
vhdl:-$ ghdl -e hello_world
vhdl:-$ ghdl -r hello_world
Hello, world
vhdl:-$ 
Advertisements

About Ola
Developer and writer -- creating Layered Books (http://layeredbooks.com) -- with books on programming and embedded systems - published a thriller at http://my.bookbaby.com/book/prevention

2 Responses to Building ghdl from source for Ubuntu 16.04 – mcode version

  1. Pingback: Installing ghdl from source on Ubuntu 16.04 | The Intobooks

  2. Patrick Lehmann says:

    Two additions: the mcode version of GHDL does not need the elaborate step (-e), you can directly run (-r) the testbench after analysis (-a) of all sources. There is also the more powerful LLVM backend version, that can be compiled almost as simple as the mcode version, but giving a higher simulation performance.

    Thanks for using and supporting GHDL!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: