新千葉 ガーベージ・コレクション

FPGA マガジンやインターフェースで書けなかったこと等をちょぼちょぼ書いてます。@ryos36

ghdl 再び

hanzer/gVHDL · GitHub
昨日失敗した ghdl のコンパイル。上の github のソースをもってきて gcc-4.9.3 を指定するといまのところコンパイルがうまくいっている。

You need to download and untar the sources of
gcc version 4.9.2 [do not modify this line as this is read by scripts].

First configure ghdl and specify gcc source dir:
$ ./configure --with-gcc=/path/to/gcc/source/dir

Then invoke make to copy ghdl sources in the source dir:
$ make copy-sources

Finally configure gcc following the gcc instructions and don't forget to
enable the vhdl language (you can use --enable-languages=c,vhdl

    • disable-bootstrap)

これをそのままやっただけ。mcode というバックエンドも使えるようだけど x86_64 環境ではできないみたいだ。llvm のバックエンドもあるらしい。

おーコンパイルできた。copy-sources は gcc のディレクトリにコピーするのか、、、きたないけどしかたない。

> ghdl -a hello.vhdl
> ghdl -e hello.vhdl
ghdl: bad unit name 'hello.vhdl'
ghdl: (a unit name is required instead of a filename)
> ghdl -e hello_world
> ls
e~hello_world.o  hello.o  hello.vhdl  hello_world.exe*  work-obj93.cf
> ./hello_world.exe
Hello world!

とりあえず hello_world が動いた。VHDL でそれでいいのかは疑問。