[J-core] GHDL simulator.

Rob Landley rob at landley.net
Wed Apr 27 01:33:30 EDT 2016


Oh, and below was my reply to Geoff at the time. Part of my confusion
was that the ghdl deveopment website has moved more than once over
the years, and the old ones don't always show where it went. The
list seems to be archived in the "latest news" section of
http://gna.org/projects/ghdl

Rob

----------

On 09/08/2015 04:44 PM, Geoff Salmon wrote:
> Hi all
> 
> The attached tarball contains some VHDL and a Makefile which show how
> you can simulate with GHDL [http://home.gna.org/ghdl/] and view the
> resulting waveforms in GTKWave [http://gtkwave.sourceforge.net/]. See
> the README for more info.
> 
> If you're starting to look at VHDL, I think being able to run it and see
> the results is essential. Once you've got GHDL and GTKWave installed,
> hopefully this will make that step easy. Let me know if you have any
> questions or encounter problems.

I talked to Jeff Dionne and he agreed that the easy way to learn VHDL is
to start with the simulator and learn the basic language before trying
to deploy a bitstream to an FPGA.

But when I tried following the build instructions on
http://sourceforge.net/p/ghdl-updates/code/ci/default/tree/README
for the "mcode" backend, it didn't work. I did:

  hg clone http://hg.code.sf.net/p/ghdl-updates/code ghdl
  sudo apt-get install gnat-4.8
  cd ghdl
  ./configure
  make

And it died the first time it tried to run gnatlink with a bunch of
unknown symbols:

gnatlink ghdl_jit.ali -o ghdl_mcode -g memsegs_c.o chkstk.o jumps.o
times.o grt-cbinding.o grt-cvpi.o fstapi.o lz4.o fastlz.o
grt-cvpi.o: In function `module_open':
/home/landley/sei/vhdl/ghdl-updates-code/src/grt/grt-cvpi.c:175:
undefined reference to `dlopen'
grt-cvpi.o: In function `module_symbol':
/home/landley/sei/vhdl/ghdl-updates-code/src/grt/grt-cvpi.c:181:
undefined reference to `dlsym'
grt-cvpi.o: In function `module_error':
/home/landley/sei/vhdl/ghdl-updates-code/src/grt/grt-cvpi.c:187:
undefined reference to `dlerror'
./foreigns.o:(.rodata+0x130): undefined reference to `sin'
./foreigns.o:(.rodata+0x148): undefined reference to `log'
./foreigns.o:(.rodata+0x160): undefined reference to `exp'
./foreigns.o:(.rodata+0x178): undefined reference to `sqrt'
./foreigns.o:(.rodata+0x190): undefined reference to `asin'
./foreigns.o:(.rodata+0x1a8): undefined reference to `acos'
./foreigns.o:(.rodata+0x1c0): undefined reference to `asinh'
./foreigns.o:(.rodata+0x1d8): undefined reference to `acosh'
./foreigns.o:(.rodata+0x1f0): undefined reference to `atanh'
./foreigns.o:(.rodata+0x208): undefined reference to `atan2'
./grt-vstrings.o: In function `grt__vstrings__to_string__3':
/home/landley/sei/vhdl/ghdl-updates-code/src/grt/grt-vstrings.adb:301:
undefined reference to `trunc'
./ortho_code-x86-abi.o: In function `ortho_code__x86__abi__link_intrinsics':
/home/landley/sei/vhdl/ghdl-updates-code/src/ortho/mcode/ortho_code-x86-abi.adb:775:
undefined reference to `__muldi3'
/home/landley/sei/vhdl/ghdl-updates-code/src/ortho/mcode/ortho_code-x86-abi.adb:779:
undefined reference to `__divdi3'
/home/landley/sei/vhdl/ghdl-updates-code/src/ortho/mcode/ortho_code-x86-abi.adb:783:
undefined reference to `__moddi3'
collect2: error: ld returned 1 exit status

The fix for the dlopen and sin/log/exp stuff was to add "-ldl -lm" to
the gnatlink command line, but the __muldi3 and friends not found is
tricky: libgcc only has the single underscore versions, not the double
underscore versions? I'm trying on Ubuntu 14.04 for x86-64...

Jeff says that mcode mode is useless and deprecated because it only
produces 32 bit output, and 10 years after x86-64 hardware started
shipping in volume 32 bit x86 is so obsolete Fedora is slowly dropping
i686 support. (Fedora 24 server won't ship i686 install media, and i686
bugs are no longer considered release blockers ala
https://lists.fedoraproject.org/pipermail/devel/2015-August/213118.html)

Is there a plan to convert mcode to 64 bit, or is our only choice using
a gcc of llvm backend?

(It's a pity that qemu's tcg and libfirm and such don't all have a
consistent interface so you could try plugging in various alternatives...)

Rob


More information about the J-core mailing list