-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstallGhdlGtkWave.html
executable file
·359 lines (356 loc) · 32.2 KB
/
InstallGhdlGtkWave.html
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="De Kamiel; GHDL and GtkWave" content="">
<meta name="author" content="ZirconfleX">
<title>Install GHDL and GtkWave</title>
<!-- Bootstrap core CSS -->
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="InstallGhdlGtkWave.css" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=ABeeZee&display=swap">
<meta name="keywords" content="FPGA, Xilinx, Samtec, Blueribbon, Blue Ribbon, HDR, FMC, VITA-57, development boards,">
</head>
<body>
<div class="container" style="border-bottom: 2px solid; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 50px 50px; grid-template-rows: 50px 50px 50px 50px 20px; grid-template-areas: 'Logo Logo Title Title Title Title' 'Logo Logo Title Title Title Title' 'Logo Logo Zirco Zirco Zirco Zirco' 'Logo Logo Web Web Zirco Zirco' '. . . . . .'; margin-top: -50px;">
<img src="Figures/Kamiel_2.svg" style=" width: 100%; height: 100%; object-fit: fill;grid-area:1 / 1 / 5 / 3;" data-html="false">
<h1 style=" font-weight: bold; text-align: right; font-family: 'ABeeZee', sans-serif; align-self: center; font-size: 70px; line-height: 97px;grid-area:1 / 3 / 3 / 7;">De Kamiel</h1>
<img src="Figures/ZirconfleX_Logo_Web_45_Jun20.svg" style="width: 100%; height: 100%; object-fit: fill; grid-area: 3 / 5 / 5 / 7;">
<p style="font-family: 'ABeeZee', sans-serif; text-align: right; grid-area: 3 / 3 / 4 / 5; width: 100%; height: 100%; padding-top: 24px;">Offered by: ZirconfleX</p>
<p style="grid-area: 4 / 3 / 5 / 5; text-align: right; font-family: 'ABeeZee', sans-serif; color: #1d5de4; width: 100%; height: 100%;">http://www.<a href="http://www.zirconflex.be" target="_blank">zirconflex</a>.be</p>
</div>
<div class="container" style="padding-top: 30px;">
<h1 id="Install and use GHDL and GtkWave">Install and use GHDL and GtkWave
<a href="Figures/Pdfs/Install GHDL and GtkWave.pdf" download>
<img src="Figures/acroread.png" alt="pdf" style="zoom: 80%;">
</a></h1>
<h2 id="ghdl">GHDL</h2>
<p>GHDL is an open-source simulator for the VHDL hardware language. GHDL is not an interpreter; it allows you to analyze and elaborate sources to generate machine code from your design. Native program execution is the only way for high speed simulation.<br>
Features as given on the official <a href="https://github.com/ghdl/ghdl">GHDL Github</a> page.</p>
<ul>
<li>GHDL fully supports the 1987, 1993, 2002 versions of the IEEE 1076 VHDL standard, and the latest 2008 revision.</li>
<li>Partial support of <a href="https://en.wikipedia.org/wiki/Property_Specification_Language">PSL</a>.</li>
<li>By using a code generator (<a href="http://llvm.org/">LLVM</a>, <a href="http://gcc.gnu.org/">GCC</a> or, <a href="https://en.wikipedia.org/wiki/X86-64">x86_64</a>/<a href="https://en.wikipedia.org/wiki/Intel_80386">i386</a> only, a built-in one), it is much faster than any interpreted simulator. It can handle very large designs, such as <a href="http://www.gaisler.com/index.php/downloads/leongrlib">leon3/grlib</a>.</li>
<li>GHDL runs on <a href="http://en.wikipedia.org/wiki/Linux_distribution">GNU/Linux</a>, <a href="http://en.wikipedia.org/wiki/Microsoft_Windows">Windows</a> and <a href="http://en.wikipedia.org/wiki/MacOS">macOS</a>, both on <code>x86</code> and on <code>x86_64</code>.</li>
<li>GHDL can write waveforms to a <a href="http://ghdl.readthedocs.io/en/latest/using/Simulation.html?highlight=GHW#cmdoption-wave">GHW</a>, <a href="https://en.wikipedia.org/wiki/Value_change_dump">VCD</a> or FST file. Combined with a <a href="http://en.wikipedia.org/wiki/Graphical_user_interface">GUI</a>-based <a href="https://en.wikipedia.org/wiki/Waveform_viewer">waveform viewer</a> and a good text editor, GHDL is a very powerful tool for writing, testing and simulating code.</li>
<li>Supported third party projects: <a href="https://vunit.github.io/">VUnit</a>, <a href="http://osvvm.org/">OSVVM</a>, <a href="https://github.com/potentialventures/cocotb">cocotb</a> (through the <a href="https://en.wikipedia.org/wiki/Verilog_Procedural_Interface">VPI interface</a>), ...</li>
</ul>
<h2 id="gtkwave">GtkWave</h2>
<p>GTKWave is a fully featured <a href="http://www.gtk.org/">GTK+</a> based <a href="https://en.wikipedia.org/wiki/Waveform_viewer">waveform viewer</a> for Unix, Win32, and Mac OSX which reads LXT, LXT2, VZT, FST, and GHW files as well as standard Verilog VCD/EVCD files and allows their viewing.</p>
<h2 id="get-the-necessary-programs-and-tools">Get the necessary programs and tools</h2>
<p>This is a guide to install both tools on Linux-Mint_20.4 or Ubuntu_20.04 and possibly coming releases of Linux-Mint and Ubuntu. Download GHDL and GtkWave and download tools and programs necessary to install and run both tools.</p>
<h3 id="ghdl-">GHDL:</h3>
<ul>
<li>This guide describes the GHDL - LLVM installation.</li>
<li>Download the GHDL source files from its <a href="https://github.com/ghdl/ghdl">GitHub</a> location.
Click the [code] button and download the ZIP file.
This file is called <strong>ghdl-master.zip</strong> and should be saved in <em>~/Downloads/Ghdl</em>.</li>
<li>Uncompress the zip file and let it store itself in the directory set in the zip file.</li>
<li>Other tools necessary to install GHDL-LLVM are:</li>
<ul>
<li>GNAT - ADA compiler: The latest community version at the time of writing/rewriting was/is <strong>gnat-2020-20200429-x86_64-linux-bin</strong>. Get it <a href="https://www.adacore.com/community">here</a>.</li>
<li>LLVM - Low Level Virtual Machine.</li>
</ul>
</ul>
<h3 id="gtkwave">GtkWave</h3>
<ul>
<li>Download GtkWave from <a href="https://sourceforge.net/projects/gtkwave/">here</a>(1) or from <a href="http://gtkwave.sourceforge.net/">here</a>(2)
At time of writing/rewriting this article the latest version Linux Ubuntu it was "<strong>gtkwave-3.3.105.tar.gz</strong>".</li>
<li>(1) Just click the big [Download] button and the latest version for the used operating system is selected and downloaded.</li>
<li>(2) In the first line of text "<em>... You can grab version 3.3.105 <a href="http://gtkwave.sourceforge.net/gtkwave-3.3.105.tar.gz">here</a>. Documentation in pdf format can be found <a href="http://gtkwave.sourceforge.net/gtkwave.pdf">here</a></em>." click the blue <code>here</code>button to download the latest .tar.gz file and the latest version of the GtkWave documentation.</li>
<li>Save the downloaded file under <em>/Downloads/Ghdl</em> as you did for other files related to GHDL.</li>
<li>Uncompress the .tar.gz file and let it occupy it's own directory under <em>/Downloads/Ghdl</em></li>
</ul>
<h2 id="install-the-tools">Install the tools</h2>
<h3 id="install-gnat">Install GNAT</h3>
<ul>
<li>Assumed is that the earlier downloaded files are stored in <em>/Downloads/Ghdl</em></li>
<li>Make the downloaded file executable:</li>
<code>cd \Downloads\Ghdl
chmod <span class="hljs-number">766</span> gnat<span class="hljs-number">-2020</span><span class="hljs-number">-20200429</span>-x86_64-linux-bin
</code>
<li>Run the file and install the ADA compiler under <em>/opt/Gnat</em>/<year>
Be aware that installing software in /opt requires one to be sudo or root.</year></li>
<code>sudo ./gnat-2020-20200429-x86_64-linux-bin</code>
<li>Add following line to your <em>.bashrc</em> or better <em>.bash_aliases</em> file.</li>
<code><span class="hljs-comment"># GNAT GPL (ADA compiler) for GHDL</span>
export PATH=<span class="hljs-variable">$PATH</span><span class="hljs-symbol">:/opt/Gnat/<year>/bin</span>
</code>
<li>The tool is installed and usable in command line mode. It is possible to install a GNAT studio.
To do this, go to were the GNAT tool is installed, in this case <em>/opt/Gnat/2020</em> and run the <em>doinstall</em> script.</li>
<code><span class="hljs-keyword">cd</span> /<span class="hljs-keyword">opt</span>/Gnat/<span class="hljs-number">2020</span>
sudo ./doinstall
</code>
<li>Follow the instructions of the installer.</li>
<li>GNAT Studio will automatically add itself to the PATH.
<strong>Note:</strong> that GNAT Studio path will be add at the end of the PATH, meaning that it will find first any other GNAT installations that you have in your PATH.
<strong>Hint:</strong> Remove the automatically add entry for GNAT-studio from the path and add it manually to the path, but do it at the same place where the other GNAT options have been add to the <em>.bashrc</em> or better <em>.bash_aliases</em> file.</p>
</li>
</ul>
<h3 id="install-llvm">Install LLVM</h3>
<ul>
<li>Browse to this page: <a href="https://apt.llvm.org/">https://apt.llvm.org/</a></li>
<li>On the page go to the Ubuntu section and copy the two text lines for the latest stable released version and for the latest version of Ubuntu <em>Focal (20.04)</em></li>
<ul>
<li>This are the lines:<br>
<code>deb http:<span class="hljs-regexp">//</span>apt.llvm.org<span class="hljs-regexp">/focal/</span> llvm-toolchain-focal main</code><br>
<code>deb-src http:<span class="hljs-regexp">//</span>apt.llvm.org<span class="hljs-regexp">/focal/</span> llvm-toolchain-focal main</code><br>
Adding above two lines to the repositories of your system will search for what's called <em>(old stable branch)</em>, during time of writing this was version 9 of LLVM.<br>
If you want to install from repositories a newer version, like the <em>(stable branch)</em>, or version 10 during time of writing, the you need to add the version number to the <br>
repository lines. Like this:<br>
<code>deb http:<span class="hljs-regexp">//</span>apt.llvm.org<span class="hljs-regexp">/focal/</span> llvm-toolchain-focal-<span class="hljs-number">10</span> main</code><br>
<code>deb-src http:<span class="hljs-regexp">//</span>apt.llvm.org<span class="hljs-regexp">/focal/</span> llvm-toolchain-focal-<span class="hljs-number">10</span> main</code><br>
</li>
</ul>
<li>Press the windows key and start typing <strong>Software & Updates</strong>. As soon as some letters are typed, icons will appear. Click the [Software & Update] icon and select the [Other Software] tab. Click [Add] and enter the first “deb ...” line in the new popup. Click [Add Source] and provide the sudo(root) password.
Add the second ”deb ...“ line the same way.</li>
<li>Hit [Close] and allow a new scan of the repositories.</li>
<li>Install the stable version of all key packages</li>
<ul>
<li>Lower on the page with repository archive information find how to install all key packages or just read on here.</li>
<li>Open a terminal (Right click the desktop and select [Open Terminal]).</li>
<li>Type or better copy, one by one, following lines in the terminal:
<ul>
<li>
<code>wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -</code><br>
provide the sudo password to install the archive signature.
<p><strong>Remark:</strong>
From here on the LLVM tools will be installed.
I've set the repository lines for the <em>(old stable release)</em> in my system. Reason release shift trough and now I'm sure I always get an update installed that is just one behind the newest stable released version.</p>
<p>To install the tools that go together with the added repository lines, mention the correct version in the install commands. In this case it's version 9.
</li>
<li>Install LLVM<br>
<code>apt-get install libllvm-9-ocaml-dev libllvm9 llvm-9 llvm-9-dev llvm-9-doc llvm-9-examples llvm-9-runtime</code><br>
</li>
<li>Install Clang & co<br>
<code>apt-get install clang-9 clang-tools-9 clang-9-doc libclang-common-9-dev libclang-9-dev libclang1-9 clang-format-9 python-clang-9</code><br>
</li>
<li>Libfuzzer<br>
<code>apt-get install libfuzzer-9-dev</code><br>
</li>
<li>lldb<br>
<code>apt-get install lldb-9</code><br>
</li>
<li>lld (linker)<br>
<code>apt-get install lld-9</code><br>
</li>
<li>libc++<br>
<code>apt-get install libc++-9-dev libc++abi-9-dev</code><br>
</li>
<li>OpenMP<br>
<code>apt-get install libomp-9-dev</code><br>
</li>
</ul>
</li>
<li>To make use of this latest version of LLVM tools some settings need to be done. In the terminal continue typing or copying and executing following lines one after the other.
<code>sudo update-alternatives --install <span class="hljs-regexp">/usr/</span>bin<span class="hljs-regexp">/clang clang /u</span>sr<span class="hljs-regexp">/bin/</span>clang-<span class="hljs-number">9</span> <span class="hljs-number">100</span></code><br>
<code>sudo update-alternatives --install <span class="hljs-regexp">/usr/</span>bin<span class="hljs-regexp">/clang++ clang++ /u</span>sr<span class="hljs-regexp">/bin/</span>clang++-<span class="hljs-number">9</span> <span class="hljs-number">100</span></code><br>
<code>sudo update-alternatives --install <span class="hljs-regexp">/usr/</span>bin<span class="hljs-regexp">/clang-apply-replacements clang-apply-replacements /u</span>sr<span class="hljs-regexp">/bin/</span>clang-apply-replacements-<span class="hljs-number">9</span> <span class="hljs-number">100</span></code><br>
<code>sudo update-alternatives --install <span class="hljs-regexp">/usr/</span>bin<span class="hljs-regexp">/clang-check clang-check /u</span>sr<span class="hljs-regexp">/bin/</span>clang-check-<span class="hljs-number">9</span> <span class="hljs-number">100</span></code><br>
<code>sudo update-alternatives --install <span class="hljs-regexp">/usr/</span>bin<span class="hljs-regexp">/clang-query clang-query /u</span>sr<span class="hljs-regexp">/bin/</span>clang-query-<span class="hljs-number">9</span> <span class="hljs-number">100</span></code><br>
<code>sudo update-alternatives --install <span class="hljs-regexp">/usr/</span>bin<span class="hljs-regexp">/clang-tidy clang-tidy /u</span>sr<span class="hljs-regexp">/bin/</span>clang-tidy-<span class="hljs-number">9</span> <span class="hljs-number">100</span></code><br>
<code>sudo update-alternatives --install <span class="hljs-regexp">/usr/</span>bin<span class="hljs-regexp">/scan-build scan-build /u</span>sr<span class="hljs-regexp">/bin/</span>scan-build-<span class="hljs-number">9</span> <span class="hljs-number">100</span></code><br>
<code>sudo update-alternatives --install <span class="hljs-regexp">/usr/</span>bin<span class="hljs-regexp">/scan-view scan-view /u</span>sr<span class="hljs-regexp">/bin/</span>scan-view-<span class="hljs-number">9</span> <span class="hljs-number">100</span></code><br>
The above lines set a permanent link for the system to use the newly installed LLVM tools instead of possible pre-installed or earlier installed versions.</p>
</li>
</ul>
</li>
</ul>
<h3 id="install-ghdl">Install GHDL</h3>
<p>In the assumption that GNU-ADA and LLVM are installed and the downloaded <em>ghdl-master.zip</em> file is uncompressed in <em>/Downloads/Ghdl/ghdl-master</em> , do following to install GHDL.</p>
<ul>
<li>Open a terminal window and change directory (cd) to the <em>/opt</em> folder.
Create here a new directory called /Ghdl <code>sudo mkdir Ghdl</code>.</li>
<li>Change the owner and group of the directory;
<code>sudo chown <user> Ghdl</code><br>
<code>sudo chgrp <user> Ghdl</code><br>
<user> = your user name.
This is done to make later modifications and additions easier.
</li>
<li>Change directory to the folder used by the uncompressed GHDL files, <code>cd /home/Downloads/Ghdl</code>.</li>
<li>Run the terminal command:<br>
<code>.<span class="hljs-regexp">/configure --with-llvm-config=/u</span>sr<span class="hljs-regexp">/lib/</span>llvm-<span class="hljs-number">9</span><span class="hljs-regexp">/bin/</span>llvm-config --prefix=<span class="hljs-regexp">/opt/</span>Ghdl</code></li>
<li>When the previous run is done, type <code>make</code> and let run again.</li>
<li>Run <code>make install</code> when previous run has finished.</li>
<li>The tool should now be installed in <em>/opt/Ghdl</em>, showing three folders (bin, include, lib).</p>
</li>
<li>Add the path <em>/opt/Ghdl/bin</em> to the systems path by editing the <em>.bashrc</em> or <em>.bash_aliases</em> file.
<code><span class="hljs-comment"># GHDL simulator</span></code><br>
<code><span class="hljs-built_in">export</span> GHDL_ROOT=<span class="hljs-string">"/opt/Ghdl"</span></code><br>
<code><span class="hljs-built_in">export</span> PATH=<span class="hljs-variable">$PATH</span>:<span class="hljs-variable">$GHDL_ROOT</span>/bin</code><br>
</li>
<li>Change directory to <em>/opt/Ghdl/bin</em> and create a symbolic link for ghdl.
<code></code>sudo ln -s <span class="hljs-regexp">/opt/</span>Ghdl<span class="hljs-regexp">/bin/g</span>hdl <span class="hljs-regexp">/usr/</span>bin<span class="hljs-regexp">/ghdl</span></code><br>
</li>
</ul>
<h3 id="install-ghdl-vendor-libraries">Install GHDL vendor libraries</h3>
<p>The GHDL simulator tool is installed on the system but only usable for generic VHDL simulations. The guess is that GHDL has been installed for simulations using a specific FPGA vendor. GHDL does not contain contains libraries for FPGA or other device vendors but contains scripts allowing to easily compile and install vendor supplied libraries. There are ready made scripts available for Altera/Intel, Lattice, Xilinx, OSVVM and UVVM. These scripts can be found in <em>/opt/Ghdl/lib/ghdl/vendors</em>.</p>
<h4 id="xilinx">Xilinx</h4>
<p>Lets use the script to compile and install libraries for Xilinx components using the Vivado tools.<br>
<strong>Remark:</strong> Be sure to have the Xilinx Vivado tools installed on your system! If not, install these tools first.</p>
<ul>
<li>As first we need to tell, in a script (sh file) where the Xilinx tools are installed and were the vendor library sources are stored and were we ant the compiled libraries to be written.
To do that go to the <code>/opt/Ghdl/lib/ghdl/vendors</code> directory.
</li>
<li>Open with a text editor the <code>config.sh</code> file and modify following lines:
<ul>
<li>In the file section <em>declare -A InstallationDirectories</em> modify the line <code>InstallationDirectories[XilinxVivado]=""</code> by adding the main install path of the Xilinx Vivado tools. On my system the line looks like: <code>InstallationDirectories[XilinxVivado]="/opt/Xilinx/Vivado/2020.1"</code></li>
<li>In the file section <em>declare -A DestinationDirectories</em> modify the line <code>DestinationDirectories[XilinxVivado]="xilinx-vivado"</code> to point to the directory were the compiled libraries must fit. In my case the line looks as: <code>DestinationDirectories[XilinxVivado]="/opt/Ghdl/lib/ghdl/Xilinx93"</code></li>
<li>As last modification, in the file section <em>declare -A SourceDirectories</em> modify the line <code>SourceDirectories[XilinxVivado]="data/vhdl/src"</code>. In fact this line doesn't need any modification because the Xilinx VHDL source libraries are stored at Xilinx tool install in the given directory. </li>
</ul>
</li>
<li>If you did not start a terminal for previous actions, launch a terminal window and now and chnage directory to: <code>cd /opt/Ghdl/lib/ghdl/vendors</code>.</li>
<li>Run in the terminal the <code>compile-xilinx-vivado.sh</code> script with the required options.
in this case the libraries need to be compiled for VHDL-93, and all Xilinx libraries must be generated.<br>
The command must be run as: <code>`./compile-xilinx-vivado.sh --vhdl93 --all</code>
</li>
<li>When other libraries must be compiled for Xilinx or for other vendors or VHDL library suppliers consult the <em>readme.md</em> file in the vendors directory.</li>
</ul>
<p><strong>Remark:</strong> The above described process fails when the target directory already exist!
In other words: when <em>DestinationDirectories[XilinxVivado]</em> gets a path to a already existing directory (with or without content) the library compile process mentions at the end of it's run <em>"Compiling Xilinx Vivado libraries [FAILED]"</em></p>
<h4 id="uvvm">UVVM</h4>
<p>A second example of VHDL simulation library is the Universal VHDL Verification Methodology (UVVM) library that can be downloaded <a href="https://github.com/UVVM/UVVM">here</a> . UVVM Utility Library is tool and library independent, but it must be compiled with VHDL 2008.</p>
<ul>
<li>Download the library by hitting the [code] button and downloading the <em>UVVM-master.zip</em> file.</li>
<li>Copy the <em>UVVM-master.zip</em> into the /opt/Ghdl/lib/ghdl/vendors directory.</li>
<li>Uncompress the file and let it store everything in the directory available in the zip file (UVVM-master).</li>
<li>Go to the <em>/opt/Ghdl/lib/ghdl/vendors directory and open with a text editor the </em>config.sh* file and change following:
<ul>
<li>in the file section <em>declare -A InstallationDirectories</em> modify the line <code>InstallationDirectories[UVVM]=""</code> by adding the main install path of the Xilinx Vivado tools. On my system the line looks like: <code>InstallationDirectories[UVVM]="/opt/Ghdl/bin/ghdl/UVVM-master"</code> This is the directory of the unzipped UVVM-master.zip file from GitHub.</li>
<li>In the file section <em>declare -A DestinationDirectories</em> modify the line <code>DestinationDirectories[UVVM]="xilinx-vivado"</code> to point to the directory were the compiled libraries must fit. In my case the line looks as: <code>DestinationDirectories[UVVM]="/opt/Ghdl/lib/ghdl/UVVM"</code></li>
<li>As last modification, in the file section <em>declare -A SourceDirectories</em> modify the line <code>SourceDirectories[XilinxVivado]="."</code>. In fact this line doesn't need any modification because the Xilinx VHDL source libraries are stored at Xilinx tool install in the given directory. </li>
</ul>
</li>
<li>If you did not start a terminal for previous actions, launch a terminal window and now and chnage directory to: <code>cd /opt/Ghdl/lib/ghdl/vendors</code>.</li>
<li>Run in the terminal the <code>compile-xilinx-vivado.sh</code> script with the required options.<br>
in this case the libraries need to be compiled for VHDL-93, and all Xilinx libraries must be generated.<br>
The command must be run as: <code>`./compile-xilinx-uvvm.sh --all</code>
</li>
<li>Find, when the command finishes successful under the UVVM directory a set of directories containing simulatable code.</li>
</ul>
<strong>Remark:</strong>
<ul>
<li>Some restrictions and remarks:
<ul>
<li>The same issue applies here as when compiling the Xilinx libraries. Compilation fails at the end of the compilation when the destination directory already exists.</li>
<li>In the UVVM documentation, in step 2 of the "For developers who understand ....." paragraph it is mentioned that a 'compile_order.txt' file must be used. Don't know why, but I compiled the libraries without this file. In fact this file does not even exist in the vendors directory of GHDL.</li>
<li>Instead of the 'compile_order.txt' file, the things to compile or compile order is given in the <em>compile-uvvm.sh</em> script. The script by default contains a set of UVVM modules. In mean time the UVVm library has been expanded with new components. Thus what we need to do is:
<ul>
<li>Open the <em>compile-uvvm.sh</em> script with a text editor.<br>
The near top of the file shows something like this:<br>
<code>uvvm_pkgs=<span class="hljs-string">"uvvm_util</span></code><br>
<code>uvvm_vvc_framework<span class="hljs-string">"</span></code><br>
<code>uvvm_vips=<span class="hljs-string">"</span></code><br>
<code>bitvis_vip_scoreboard</code><br>
<code>bitvis_vip_sbi</code><br>
<code>bitvis_vip_avalon_mm</code><br>
<code>bitvis_vip_axilite</code><br>
<code>bitvis_vip_axistream</code><br>
<code>bitvis_vip_gpio</code><br>
<code>bitvis_vip_i2c</code><br>
<code>bitvis_vip_spi</code><br>
<code>bitvis_vip_uart</code><br>
<code>bitvis_vip_wishbone</code><br>
<code>bitvis_vip_clock_generator</code><br>
<code><span class="hljs-string">"</span></code><br>
<li>Open the UVVM-master directory and compare the contents with the list in the script (above text). Add the missing parts.
<li>Add to uvvm_pkgs:</li>
<code><span class="hljs-attribute">xConstrRandFuncCov</span></code>
<li>Add to uvvm_vips</li>
<code><span class="hljs-keyword">bitvis_irqc</span></code><br>
<code><span class="hljs-keyword">bitvis_vip_spec_cov</span></code><br>
<code><span class="hljs-keyword">bitvis_vip_avalon_st</span></code><br>
<code><span class="hljs-keyword">bitvis_vip_error_injection</span></code><br>
<code><span class="hljs-keyword">bitvis_vip_gmii</span></code><br>
<code><span class="hljs-keyword">bitvis_vip_rgmii</span></code><br>
<li>DO NOT ADD:
<code><span class="hljs-keyword">bitvis_vip_hvvc_to_vvc_bridge</span></code><br>
<code></code><span class="hljs-keyword">bitvis_vip_ethernet</span></code><br>
If add the compilation will fail due to an error in the files of the <em>bitvis_vip_hvvc_to_vvc_bridge</em> model.
</li>
</ul>
</li>
<li><p>Save the file and compile the library as discussed above.</p>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="gtkwave">GtkWave</h3>
This is a similar install procedure as for GHDL, do following:<br>
<ul>
<li>Open a terminal window and change directory (cd) to the <em>/opt</em> folder.<br>
Create a new directory called <em>/GtkWave</em> (<em>sudo mkdir GtkWave</em>).
</li>
<li>Change the owner and group of the directory<br>
<code>sudo chown <user> GtkWave</code><br>
<code>sudo chgrp <user> GtkWave</code><br>
<user> = your user name.<br>
This is done to make later modifications and additions easier.
</li>
<li>Change directory to the folder used for the uncompressed files;<br>
<code>cd /home/Downloads/Ghdl/GtkWave<version></code>.
</li>
<li>Run the terminal command: <code>./configure --prefix=/opt/GtkWave</code>
<ul>
<li>The above command should do the job when the configure script can find the Tcl/TK tools installed on the machine. The tool must be able to find following files: tclConfig.sh and tkConfig.sh. When the configure script cannot find one of the files check if tcl and tk are installed. When not install both and try again. When tcl and tk are installed run the script with following options:</li>
<li><em>./configure --prefix=/opt/GtkWave --with-tcl=/opt/ActiveTcl/lib/tcl8.6 --with-tk=/opt/ActiveTcl/lib/tk8.6</em> (replace the path /opt/ActiveTcl/lib/tcl8.6 (tk8.) by the appropriate path on your system).</li>
<li>Another thing where the configuration script can trip over are the xz-utils (zip utilities). To avoid problems run the command:
<em>./configure --prefix=/opt/GtkWave --with-tcl=/opt/ActiveTcl/lib/tcl8.6 --with-tk=/opt/ActiveTcl/lib/tk8.6 --disable-xz</em></li>
</ul>
</li>
<li>When the previous run is done, type <code>make</code> and let it run again.
</li>
<li>Type <em>su</em> and provide the root or sudo password then type <code>make install</code> and let run again until finished.
</li>
<li>Check the install by running: <code>make installcheck</code>.
</li>
<li>The tool should now be installed in <em>/opt/GtkWave</em>, showing three folders (bin, lib, share).
</li>
<li>Add the path <em>/opt/GtkWave/bin</em> to the systems path by editing the <em>.bashrc</em> file.
<code><span class="hljs-comment"># GtkWave viewer</span></code><br>
<code></code><span class="hljs-built_in">export</span> GTKWAVE_ROOT=<span class="hljs-string">"/opt/GtkWave"</span></code><br>
<code></code><span class="hljs-built_in">export</span> PATH=<span class="hljs-variable">$PATH</span>:<span class="hljs-variable">$GTKWAVE_ROOT</span>/bin</code><br>
</li>
<li>Change directory to <em>/opt/GtkWave/bin</em> and create a symbolic link for ghdl.
<ul>
<li>sudo ln -s /opt/GtkWave/bin/gtkwave /usr/bin/gtkwave</li>
</ul>
</li>
</ul>
<h3 id="the-end">The end</h3>
Both tools are installed.<br>
Under Linux/Ubuntu opening a terminal and typing:
<ul>
<li>ghdl<br>
Shows <strong>ghdl:error: missing command, try ghdl --help</strong>
</li>
<li>gtkwave<br>
Shows an empty black pop-up screen normally used for waveforms.
</li>
</ul>
The tools are installed and functional.
<h2 id="tools-documentation">Tools Documentation</h2>
<h5 id="ghdl">GHDL</h5>
<ul>
<li><a href="https://ghdl.readthedocs.io/en/latest/index.html">https://ghdl.readthedocs.io/en/latest/index.html</a></li>
</ul>
<h5 id="gtkwave">GtkWave</h5>
<ul>
<li><a href="http://gtkwave.sourceforge.net/gtkwave.pdf">http://gtkwave.sourceforge.net/gtkwave.pdf</a></li>
<li>VCD writer: [<a href="http://pyvcd.readthedocs.io/en/latest/index.html](">http://pyvcd.readthedocs.io/en/latest/index.html](</a></li>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/popper.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</body>
</html>