summaryrefslogtreecommitdiffstats
path: root/zpu/hdl/example_ghdl/README
blob: a098c0cc13da98cef3bd6c46382162f3a3f37cd1 (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
This directory contains a quick setup of the helloworld example for
the GHDL simulator.

  http://ghdl.free.fr/

Compiled by Arnim Laeuger, 17-Apr-2008.
Removed ROC/unisim dependency 16-Jun-2008.

Compiling the example
---------------------

Make all shell scripts executable:
  $ chmod +x *.sh

On Linux, convert files from DOS format:
  $ dos2unix *.sh

You need to import the project sources once by running
  $ ./ghdl_import.sh

Compilation (using GHDL's make feature) is invoked by
  $ ./ghdl_make.sh

Whenever the VHDL sources change, it's enough to execute ghdl_make.sh. GHDL
will trace the dependencies and will rebuild only the modified sources.


Simulation
----------

Simulation finally happens by running the fpga_top executable generated by the
compilation step. Don't forget to set a stop time or the testbench might run
forever:

  $ ./fpga_top --stop-time=2100us

The log.txt and trace.txt files are generated as simulation progresses. They
should be compared to the files given in the example directory.

Waveforms can be obtained by specifying the ghw file name:

  $ ./fpga_top --stop-time=1ms --wave=zpu.ghw

They can be inspected with gtkwave from http://home.nc.rr.com/gtkwave/.
OpenPOWER on IntegriCloud