1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
This directory contains the sources of GHDL, the VHDL simulator.
GHDL is free software. See the file COPYING for copying permission.
The manuals, and some of the runtime libraries, are under different
terms; see the individual source files for details.
### Creating a source tar. ###
##############################
GHDL requires GCC to be compiled. The exact version of GCC is defined in
./translate/gcc/dist.sh, in the GCCVERSION= line. Do not try to change the
version, this may not compile or create a buggy compiler.
The GHDL sources provided on http://ghdl.free.fr do not exactly match the
files hierarchy here. The later are used to directly build a compiler and
follow what GCC expect, while the former are used to do development and
are more logically organized.
Use the ./translate/gcc/dist.sh script to create sources to be included in GCC:
$ cd translate/gcc
$ ./dist.sh sources
# This generates a ghdl-VERSION.tar.bz2 file.
### Compiling for development. ###
###################################
These steps can make GHDL development hard. You can avoid to compile GCC
everytime. To do this, edit ortho/gcc/Makefile and set two variables:
AGCC_GCCSRC_DIR is the GCC sources directory, while AGCC_GCCOBJ_DIR is where
you have compiled GCC+GHDL once. Then, you can compile:
the GHDL back-end (ghdl1) in ./translate:
$ make BE=gcc
the GHDL driver in ./translate/ghdldrv:
$ make ghdl_gcc
the VHDL libraries:
$ cd translate/ghdldrv
$ make install.all
and the GHDL run-time (GRT) in ./translate/grt:
$ make
To use this GRT, you must create two links in translate/lib:
$ ln -s ../grt/grt.lst .
$ ln -s ../grt/libgrt.a .
Once this is done, you can use the ghdl_gcc from translate/ghdldrv.
### Compiling and using the debug back-end. ###
################################################
Debugging GHDL outputs can be very difficuly with the GCC back-end, since you
don't see the high level code generated by GHDL. To help debugging the
translator, I have written a debug back-end. This back-end is used instead of
the GCC back-end and displays pseudo-code (as well as declarations). This
pseudo-code can be then compiled with a reader.
To compile it, go to ./translate:
$ make BE=debug
This creates a ghdl1-debug. Then go to ./ortho/oread and compile the reader:
$ make BE=gcc
You can now use this chain by adding the '--post' option to the ghdl driver:
$ ghdl_gcc -a --post my_file.vhdl
This creates an intermediate file my_file.on, which is then compiled by
oread-gcc.
Tristan.
|