summaryrefslogtreecommitdiff
path: root/README
blob: 4ffae280d17e920384c7be1b7083d660d1d226ed (plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
This directory contains the sources of GHDL, the VHDL simulator.

GHDL fully supports IEEE 1076-1987, IEEE 1076-1993, IEE 1076-2002 and
partially the 1076-2008 version of VHDL.

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.

Building GHDL (Short instructions)
**********************************

You need GNAT for x86 (32 bits).  See below for instructions

$ ./configure
$ make

At that place, you can already use the 'ghdl_mcode' built in the directory.
You can also install GHDL (the executable is installed as 'ghdl'):
$ make install

That's all!

Build GHDL (Long instructions)
******************************

GHDL supports many backend (code generator), so you first must choose
the backend you want to use.  There are currently 3 supported backends:

* gcc
* mcode (this is an internal code generator for i386)
* llvm (experimental)

Here is a short comparaison:

* gcc:
+ generated code is faster (particularly with -O or -O2)
+ generated code can be debugger (with -g)
+ the output is an executable
+ ported to many platforms (x86, x86_64, powerpc, sparc)
- analyze can takes time (particularly for big units)
- build is more complex

* mcode
+ easy to build
- but i386 only
+ very quick analysis time
+ can analyze very big designs
- simulation is slower
- no executable created

* llvm
- still experimental
+ same advantages of gcc (good generated code, debuggable)
+ easier to build than gcc

As GCC is written in Ada, you need to use the GNU Ada compiler (GNAT).
I recommend to use GNAT GPL from http://libre.adacore.com (free).
If you build with the mcode backend, you need an i386 version of GNAT.

Building with mcode backend
***************************

This is as simple as:
$ ./configure --prefix=PREFIX
  where PREFIX is the directory for installation
$ make
  This builds the ghdl_mcode executable, which can be used as is.
$ make install
  To install within PREFIX

Building with the gcc backend
*****************************

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)

Building with the llvm backend
******************************

You need llvm 3.5

First configure ghdl and specify where llvm is installed
$ ./configure --with-llvm=PREFIX
  where PREFIX/bin/llvm-config is present

Notes for developpers
*********************

Developping with the gcc backend:
Once gcc (with ghdl) has been built once, it is possible to work on ghdl
sources tree without copying them in gcc tree. Commands are:
$ make ghdl1-gcc     	     # To build the compiler
$ make ghdl_gcc		     # To build the driver
$ make libs.vhdl.gcc	     # To compile the vhdl libraries
$ make grt-all		     # To build the ghdl runtime
$ make grt.links	     # To locally install the ghdl runtime
TODO: gcc object dir