-
Notifications
You must be signed in to change notification settings - Fork 16
/
vp.html
403 lines (394 loc) · 30.1 KB
/
vp.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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Virtual Platform — NVDLA Documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/nvdla.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/styles.css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Virtual Platform On AWS FPGA" href="vp_fpga.html" />
<link rel="prev" title="Test applications" href="sw/test_application.html" />
<script src="//assets.adobedtm.com/b92787824f2e0e9b68dc2e993f9bd995339fe417/satelliteLib-30c8ffcc8ece089156fd5590fbcf390ffc296f51.js"></script>
</head><body>
<header class="navbar">
<nav class="container navbar navbar-light bg-faded">
<a class="navbar-brand" href="https://www.nvidia.com/">
<div class="logo"></div>
</a>
</nav>
</header>
<div class="related" role="navigation" aria-label="related navigation">
<div class="container">
<div class="row">
<h3>Navigation</h3>
<ul>
<li class="right first">
<a href="vp_fpga.html" title="Virtual Platform On AWS FPGA"
accesskey="N">next</a></li>
<li class="right">
<a href="sw/test_application.html" title="Test applications"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">NVDLA Open Source Project</a>»</li>
<li class="nav-item nav-item-1"><a href="contents.html">Documentation</a>»</li>
</ul>
</div>
</div>
</div>
<div class="document">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-9">
<div class="section" id="virtual-platform">
<h1>Virtual Platform<a class="headerlink" href="#virtual-platform" title="Permalink to this headline">¶</a></h1>
<div class="section" id="overview">
<span id="id1"></span><h2>1. Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
<p>The NVDLA virtual platform provides a register-accurate system on which software can be quickly developed and debugged. The virtual platform is based on GreenSocs <a class="reference external" href="https://git.greensocs.com/qemu/qbox">QBOX</a>, a solution for co-simulation with QEMU and SystemC. <a class="reference internal" href="#fig-vp-top"><span class="std std-numref">Fig. 81</span></a> below shows the top level diagram of the NVDLA virtual simulator. A QEMU emulator of ARMv8 ‘virt’ SoC board is included to provide high performance CPU emulation and generic devices. The emulator is wrapped inside a standard SystemC module with a set of TLM-2.0 interfaces to interact with other SystemC modules.</p>
<div class="figure align-center" id="id8">
<span id="fig-vp-top"></span><img alt="NVDLA Virtual Platform Top Level Diagram." src="_images/nvdla-vp-top.svg" /><p class="caption"><span class="caption-number">Fig. 81 </span><span class="caption-text">NVDLA Virtual Platform.</span><a class="headerlink" href="#id8" title="Permalink to this image">¶</a></p>
</div>
</div>
<div class="section" id="using-the-virtual-simulator">
<h2>2. Using the Virtual Simulator<a class="headerlink" href="#using-the-virtual-simulator" title="Permalink to this headline">¶</a></h2>
<p>It is recommended that you use the pre-built virtual simulator binary included in the <a class="reference external" href="https://hub.docker.com/r/nvdla">docker</a> image. The <a class="reference internal" href="#running-the-virtual-simulator-from-docker">2.6 Running the Virtual Simulator From Docker</a> section describes the detail. You are also welcome to build the virtual simulator from source code and use that.</p>
<div class="section" id="system-requirements">
<span id="id2"></span><h3>2.1 System Requirements<a class="headerlink" href="#system-requirements" title="Permalink to this headline">¶</a></h3>
<p>It is recommended to build the virtual simulator in a system that meets the following requirements:</p>
<ul class="simple">
<li><p>OS: Ubuntu 14.04</p></li>
<li><p>g++ 4.8.4</p></li>
<li><p>git > 1.8.2</p></li>
<li><p>systemc 2.3.0</p></li>
<li><p>cmake > 2.8</p></li>
<li><p>libboost > 1.34</p></li>
<li><p>python dev</p></li>
<li><p>glib2 dev</p></li>
<li><p>pixman dev</p></li>
<li><p>lua 5.2 dev</p></li>
<li><p>swig</p></li>
<li><p>libcap dev</p></li>
<li><p>libattr1 dev</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>virtual simulator also can run with CentOS 7, details refer to <a class="reference internal" href="vp_fpga.html"><span class="doc">Virtual Platform On AWS FPGA</span></a></p>
</div>
<p>Several tools like Java and Perl are also required to build the NVDLA hardware tree. Please refer to <a class="reference internal" href="hw/v1/integration_guide.html#env-setup"><span class="std std-ref">Environment Setup</span></a> for details.</p>
</div>
<div class="section" id="download-the-virtual-simulator">
<span id="id3"></span><h3>2.2 Download the Virtual Simulator<a class="headerlink" href="#download-the-virtual-simulator" title="Permalink to this headline">¶</a></h3>
<p>The NVDLA virtual simulator source code can be downloaded from <a class="reference external" href="https://github.com/nvdla/vp">github</a>.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/nvdla/vp.git
<span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>vp
<span class="gp">$ </span>git<span class="w"> </span>submodule<span class="w"> </span>update<span class="w"> </span>--init<span class="w"> </span>--recursive
</pre></div>
</div>
</div>
<div class="section" id="install-dependencies">
<span id="id4"></span><h3>2.3 Install Dependencies<a class="headerlink" href="#install-dependencies" title="Permalink to this headline">¶</a></h3>
<div class="section" id="install-required-tools-and-libraries">
<h4>2.3.1 Install required tools and libraries<a class="headerlink" href="#install-required-tools-and-libraries" title="Permalink to this headline">¶</a></h4>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>sudo<span class="w"> </span>apt-get<span class="w"> </span>update
<span class="gp">$ </span>sudo<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>g++<span class="w"> </span>cmake<span class="w"> </span>libboost-dev<span class="w"> </span>python-dev<span class="w"> </span>libglib2.0-dev<span class="w"> </span>libpixman-1-dev<span class="w"> </span>liblua5.2-dev<span class="w"> </span>swig<span class="w"> </span>libcap-dev<span class="w"> </span>libattr1-dev
</pre></div>
</div>
</div>
<div class="section" id="download-and-install-systemc-2-3-0">
<h4>2.3.2 Download and install SystemC 2.3.0<a class="headerlink" href="#download-and-install-systemc-2-3-0" title="Permalink to this headline">¶</a></h4>
<p>Please be noted that SystemC 2.3.1/2.3.2 is not supported currently.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>wget<span class="w"> </span>-O<span class="w"> </span>systemc-2.3.0a.tar.gz<span class="w"> </span>https://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.0a.tar.gz
<span class="gp">$ </span>tar<span class="w"> </span>-xzvf<span class="w"> </span>systemc-2.3.0a.tar.gz
<span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>systemc-2.3.0a
<span class="gp">$ </span>sudo<span class="w"> </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/usr/local/systemc-2.3.0/
<span class="gp">$ </span>mkdir<span class="w"> </span>objdir
<span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>objdir
<span class="gp">$ </span>../configure<span class="w"> </span>--prefix<span class="o">=</span>/usr/local/systemc-2.3.0
<span class="gp">$ </span>make
<span class="gp">$ </span>sudo<span class="w"> </span>make<span class="w"> </span>install
</pre></div>
</div>
</div>
<div class="section" id="download-and-install-perl-package-required">
<h4>2.3.3 Download and install perl package required<a class="headerlink" href="#download-and-install-perl-package-required" title="Permalink to this headline">¶</a></h4>
<p>We need to install perl package YAML.pm and Tee.pm to build NVDLA CMOD.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>wget<span class="w"> </span>-O<span class="w"> </span>YAML-1.24.tar.gz<span class="w"> </span>https://search.cpan.org/CPAN/authors/id/T/TI/TINITA/YAML-1.24.tar.gz
<span class="gp">$ </span>tar<span class="w"> </span>-xzvf<span class="w"> </span>YAML-1.24.tar.gz
<span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>YAML-1.24
<span class="gp">$ </span>perl<span class="w"> </span>Makefile.PL
<span class="gp">$ </span>make
<span class="gp">$ </span>sudo<span class="w"> </span>make<span class="w"> </span>install
<span class="gp">$ </span>wget<span class="w"> </span>-O<span class="w"> </span>IO-Tee-0.65.tar.gz<span class="w"> </span>https://search.cpan.org/CPAN/authors/id/N/NE/NEILB/IO-Tee-0.65.tar.gz
<span class="gp">$ </span>tar<span class="w"> </span>-xzvf<span class="w"> </span>IO-Tee-0.65.tar.gz
<span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>IO-Tee-0.65
<span class="gp">$ </span>perl<span class="w"> </span>Makefile.PL
<span class="gp">$ </span>make
<span class="gp">$ </span>sudo<span class="w"> </span>make<span class="w"> </span>install
</pre></div>
</div>
</div>
<div class="section" id="download-and-build-nvdla-cmod">
<span id="id5"></span><h4>2.3.4 Download and build NVDLA CMOD<a class="headerlink" href="#download-and-build-nvdla-cmod" title="Permalink to this headline">¶</a></h4>
<p>Please refer to <a class="reference internal" href="hw/v1/integration_guide.html#tree-build"><span class="std std-ref">Tree Build</span></a> for details on building the NVDLA hardware tree, and make sure the required tools listed in <a class="reference internal" href="hw/v1/integration_guide.html#env-setup"><span class="std std-ref">Environment Setup</span></a> are installed first.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/nvdla/hw.git
<span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>hw
<span class="gp">$ </span>make
<span class="gp">$ </span>tools/bin/tmake<span class="w"> </span>-build<span class="w"> </span>cmod_top
</pre></div>
</div>
<p>The header files and library will be generated in <em>hw/outdir/<project>/cmod/release</em>.</p>
</div>
</div>
<div class="section" id="build-and-install-the-virtual-simulator">
<h3>2.4 Build and Install the Virtual Simulator<a class="headerlink" href="#build-and-install-the-virtual-simulator" title="Permalink to this headline">¶</a></h3>
<div class="section" id="cmake-build-under-the-vp-repository-directory">
<h4>2.4.1 Cmake build under the vp repository directory<a class="headerlink" href="#cmake-build-under-the-vp-repository-directory" title="Permalink to this headline">¶</a></h4>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>cmake<span class="w"> </span>-DCMAKE_INSTALL_PREFIX<span class="o">=[</span>install<span class="w"> </span>dir<span class="o">]</span><span class="w"> </span>-DSYSTEMC_PREFIX<span class="o">=[</span>systemc<span class="w"> </span>prefix<span class="o">]</span><span class="w"> </span>-DNVDLA_HW_PREFIX<span class="o">=[</span>nvdla_hw<span class="w"> </span>prefix<span class="o">]</span><span class="w"> </span>-DNVDLA_HW_PROJECT<span class="o">=[</span>nvdla_hw<span class="w"> </span>project<span class="w"> </span>name<span class="o">]</span>
</pre></div>
</div>
<p><em>install dir</em> is where you would like to install the virtual simulator, <em>systemc prefix</em> is the SystemC installation directory, <em>nvdla_hw prefix</em> is the local NVDLA HW repository, and <em>nvdla_hw project name</em> is the NVDLA HW project name.</p>
<p>Example:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>cmake<span class="w"> </span>-DCMAKE_INSTALL_PREFIX<span class="o">=</span>build<span class="w"> </span>-DSYSTEMC_PREFIX<span class="o">=</span>/usr/local/systemc-2.3.0/<span class="w"> </span>-DNVDLA_HW_PREFIX<span class="o">=</span>/usr/local/nvdla/hw<span class="w"> </span>-DNVDLA_HW_PROJECT<span class="o">=</span>nv_small
</pre></div>
</div>
</div>
<div class="section" id="compile-and-install">
<h4>2.4.2 Compile and install<a class="headerlink" href="#compile-and-install" title="Permalink to this headline">¶</a></h4>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>make
<span class="gp">$ </span>make<span class="w"> </span>install
</pre></div>
</div>
</div>
</div>
<div class="section" id="running-the-virtual-simulator">
<span id="id6"></span><h3>2.5 Running the Virtual Simulator<a class="headerlink" href="#running-the-virtual-simulator" title="Permalink to this headline">¶</a></h3>
<div class="section" id="prepare-kernel-image">
<h4>2.5.1 Prepare Kernel Image<a class="headerlink" href="#prepare-kernel-image" title="Permalink to this headline">¶</a></h4>
<p>A demo linux kernel image is provided in the github release. You can run this image in the virtual simulator, and run the NVDLA KMD/UMD inside it.</p>
<p>If you would like to build a linux kernel on your own, please refer to <a class="reference internal" href="#building-linux-kernel-for-nvdla-virtual-simulator">3. Building Linux Kernel for NVDLA Virtual Simulator</a>.</p>
<p>After the image is ready, modify the <em>conf/aarch64_nvdla.lua</em> for the image and rootfs file location.</p>
</div>
<div class="section" id="standard-qemu-arguments">
<h4>2.5.2 Standard QEMU Arguments<a class="headerlink" href="#standard-qemu-arguments" title="Permalink to this headline">¶</a></h4>
<p>The configuration of the virtual simulator is defined in <em>conf/aarch64_nvdla.lua</em>. You can change the standard QEMU arguments in <em>extra_arguments</em> inside the lua file.</p>
</div>
<div class="section" id="running-kernel-image-in-the-virtual-simulator">
<h4>2.5.3 Running Kernel Image In the Virtual Simulator<a class="headerlink" href="#running-kernel-image-in-the-virtual-simulator" title="Permalink to this headline">¶</a></h4>
<p>Start the virtual simulator. Pay attention that the environment variable ‘SC_SIGNAL_WRITE_CHECK’ should be set to ‘DISABLE’ before we run the virtual simulator.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">SC_SIGNAL_WRITE_CHECK</span><span class="o">=</span>DISABLE
<span class="gp">$ </span>./build/bin/aarch64_toplevel<span class="w"> </span>-c<span class="w"> </span>conf/aarch64_nvdla.lua
<span class="go">Login the kernel. The demo image uses account 'root' and password 'nvdla'.</span>
</pre></div>
</div>
<p>Some demo tests are provided in the <em>tests</em> directory, you can run them after login as root.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp"># </span>mount<span class="w"> </span>-t<span class="w"> </span>9p<span class="w"> </span>-o<span class="w"> </span><span class="nv">trans</span><span class="o">=</span>virtio<span class="w"> </span>r<span class="w"> </span>/mnt
<span class="gp"># </span><span class="nb">cd</span><span class="w"> </span>/mnt/tests/hello
<span class="gp"># </span>./aarch64_hello
</pre></div>
</div>
<p>You should be able to see ‘Hello World!’ printed in the screen. You are now ready to try out the NVDLA software in the virtual simulator! Please refer to <a class="reference internal" href="sw/contents.html"><span class="doc">Software Manual</span></a> for details.</p>
<p>If you want to exit the virtual simulator, press ‘ctrl+a x’.</p>
</div>
</div>
<div class="section" id="running-the-virtual-simulator-from-docker">
<h3>2.6 Running the Virtual Simulator From Docker<a class="headerlink" href="#running-the-virtual-simulator-from-docker" title="Permalink to this headline">¶</a></h3>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>docker<span class="w"> </span>pull<span class="w"> </span>nvdla/vp
<span class="gp">$ </span>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>-v<span class="w"> </span>/home:/home<span class="w"> </span>nvdla/vp
<span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>/usr/local/nvdla
<span class="gp">$ </span>aarch64_toplevel<span class="w"> </span>-c<span class="w"> </span>aarch64_nvdla.lua
<span class="go">Login the kernel with account 'root' and password 'nvdla'</span>
</pre></div>
</div>
<p>The NVDLA software is also provided in the docker image, please refer to <a class="reference internal" href="sw/contents.html"><span class="doc">Software Manual</span></a> on how to run the NVDLA software.</p>
</div>
<div class="section" id="debugging-the-virtual-simulator">
<span id="id7"></span><h3>2.7 Debugging the Virtual Simulator<a class="headerlink" href="#debugging-the-virtual-simulator" title="Permalink to this headline">¶</a></h3>
<p>Before debugging the virtual simulator, you need to build the debug version of the simulator:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>cmake<span class="w"> </span>-DCMAKE_INSTALL_PREFIX<span class="o">=[</span>install<span class="w"> </span>dir<span class="o">]</span><span class="w"> </span>-DSYSTEMC_PREFIX<span class="o">=[</span>systemc<span class="w"> </span>prefix<span class="o">]</span><span class="w"> </span>-DNVDLA_HW_PREFIX<span class="o">=[</span>nvdla_hw<span class="w"> </span>prefix<span class="o">]</span><span class="w"> </span>-DNVDLA_HW_PROJECT<span class="o">=[</span>nvdla_hw<span class="w"> </span>project<span class="w"> </span>name<span class="o">]</span><span class="w"> </span>-DCMAKE_BUILD_TYPE<span class="o">=</span>Debug
<span class="gp">$ </span>make
<span class="gp">$ </span>make<span class="w"> </span>install
</pre></div>
</div>
<div class="section" id="log-output-control">
<h4>2.7.1 Log Output Control<a class="headerlink" href="#log-output-control" title="Permalink to this headline">¶</a></h4>
<p>The log output of SystemC simulator is controled by a configuration string that can be set in two ways:</p>
<ul class="simple">
<li><p>The command line option ‘-s <em>control_string</em>’ or ‘–sc_log <em>control_string</em>’</p></li>
<li><p>The environment variable ‘export SC_LOG=<em>control_string</em>’</p></li>
</ul>
<p>If both control strings are set, the simulator will pick the one set by environment variable <em>SC_LOG</em>.</p>
<p>The format of the control string is:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">"outfile:<log_file>;verbosity_level:<info_level>;<msg_string>:<report_level>"</span>
<span class="go"><log_file>: log output file name</span>
<span class="go"><info_level>: info verbosity -- sc_none/sc_low/sc_medium/sc_high/sc_full/sc_debug</span>
<span class="go"><msg_string>: message string specified in sc_report.</span>
<span class="go"><report_level>: sc report level -- info/warning/error/fatal/enable/disable</span>
</pre></div>
</div>
<p>Here are some useful control string examples:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">SC_LOG</span><span class="o">=</span><span class="s2">"outfile:sc.log;verbosity_level:sc_debug;csb_adaptor:enable"</span><span class="w"> </span>--<span class="w"> </span>print<span class="w"> </span>the<span class="w"> </span>register<span class="w"> </span>access<span class="w"> </span>transaction<span class="w"> </span>from<span class="w"> </span>QEMU<span class="w"> </span>to<span class="w"> </span>NVDLA
<span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">SC_LOG</span><span class="o">=</span><span class="s2">"outfile:sc.log;verbosity_level:sc_debug;dbb_adaptor:enable;sram_adaptor:enable"</span><span class="w"> </span>--<span class="w"> </span>print<span class="w"> </span>the<span class="w"> </span>memory<span class="w"> </span>access<span class="w"> </span>from<span class="w"> </span>NVDLA<span class="w"> </span>to<span class="w"> </span>external<span class="w"> </span>memory
</pre></div>
</div>
<p>You should be able to see logs like:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">Info: nvdla.csb_adaptor: GP: iswrite=0 addr=0x300c len=4 data=0x 00000000 resp=TLM_OK_RESPONSE</span>
<span class="go">Info: nvdla.dbb_adaptor: GP: iswrite=1 addr=0xc0001e80 len=64 data=0x abcd01b0 abcd01b1 abcd01b2 abcd01b3 abcd01b4 abcd01b5 abcd01b6 abcd01b7 abcd01b8 abcd01b9 abcd01ba abcd01bb abcd01bc abcd01bd abcd01be abcd01bf resp=TLM_OK_RESPONSE</span>
</pre></div>
</div>
</div>
<div class="section" id="gdb">
<h4>2.7.2 GDB<a class="headerlink" href="#gdb" title="Permalink to this headline">¶</a></h4>
<p>You can also use GDB to debug the virtual simulator. First run the simulator, then get the PID of the process and use GDB to attach to it.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>ps<span class="w"> </span>-ef<span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span>aarch64_toplevel
<span class="gp">$ </span>gdb<span class="w"> </span>attach<span class="w"> </span><PID>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="building-linux-kernel-for-nvdla-virtual-simulator">
<span id="building-linux-kernel"></span><h2>3. Building Linux Kernel for NVDLA Virtual Simulator<a class="headerlink" href="#building-linux-kernel-for-nvdla-virtual-simulator" title="Permalink to this headline">¶</a></h2>
<p>The NVDLA virtual platform is based on QEMU aarch64 virt machine, so building a linux kernel is the same as building one for QEMU aarch64 virt machine. Here’s an example of using buildroot to build a linux kernel for NVDLA virtual platform.</p>
<div class="section" id="download">
<h3>3.1 Download<a class="headerlink" href="#download" title="Permalink to this headline">¶</a></h3>
<p>Download the buildroot from <a class="reference external" href="https://buildroot.org/download.html">https://buildroot.org/download.html</a>. This example uses the version buildroot-2017.11-rc1.</p>
</div>
<div class="section" id="configure">
<h3>3.2 Configure<a class="headerlink" href="#configure" title="Permalink to this headline">¶</a></h3>
<p>Use <em>qemu_aarch64_virt_defconfig</em> as base config, then set the customized configurations:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>make<span class="w"> </span>qemu_aarch64_virt_defconfig
<span class="gp">$ </span>make<span class="w"> </span>menuconfig
<span class="go">* Target Options -> Target Architecture -> AArch64 (little endian)</span>
<span class="go">* Target Options -> Target Architecture Variant -> cortex-A57</span>
<span class="go">* Toolchain -> Custom kernel headers series -> 4.13.x</span>
<span class="go">* Toolchain -> Toolchain type -> External toolchain</span>
<span class="go">* Toolchain -> Toolchain -> Linaro AArch64 2017.08</span>
<span class="go">* Toolchain -> Toolchain origin -> Toolchain to be downloaded and installed</span>
<span class="go">* Kernel -> () Kernel version -> 4.13.3</span>
<span class="go">* Kernel -> Kernel configuration -> Use the architecture default configuration</span>
<span class="go">* System configuration -> Enable root login with password -> Y</span>
<span class="go">* System configuration -> Root password -> nvdla</span>
<span class="go">* Target Packages -> Show packages that are also provided by busybox -> Y</span>
<span class="go">* Target Packages -> Networking applications -> openssh -> Y</span>
</pre></div>
</div>
</div>
<div class="section" id="build">
<h3>3.3 Build<a class="headerlink" href="#build" title="Permalink to this headline">¶</a></h3>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>make<span class="w"> </span>-j4
</pre></div>
</div>
<p>When it’s done, you can find the kernel image and rootfs in <em>output/image</em>.</p>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-3">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="contents.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Virtual Platform</a><ul>
<li><a class="reference internal" href="#overview">1. Overview</a></li>
<li><a class="reference internal" href="#using-the-virtual-simulator">2. Using the Virtual Simulator</a><ul>
<li><a class="reference internal" href="#system-requirements">2.1 System Requirements</a></li>
<li><a class="reference internal" href="#download-the-virtual-simulator">2.2 Download the Virtual Simulator</a></li>
<li><a class="reference internal" href="#install-dependencies">2.3 Install Dependencies</a><ul>
<li><a class="reference internal" href="#install-required-tools-and-libraries">2.3.1 Install required tools and libraries</a></li>
<li><a class="reference internal" href="#download-and-install-systemc-2-3-0">2.3.2 Download and install SystemC 2.3.0</a></li>
<li><a class="reference internal" href="#download-and-install-perl-package-required">2.3.3 Download and install perl package required</a></li>
<li><a class="reference internal" href="#download-and-build-nvdla-cmod">2.3.4 Download and build NVDLA CMOD</a></li>
</ul>
</li>
<li><a class="reference internal" href="#build-and-install-the-virtual-simulator">2.4 Build and Install the Virtual Simulator</a><ul>
<li><a class="reference internal" href="#cmake-build-under-the-vp-repository-directory">2.4.1 Cmake build under the vp repository directory</a></li>
<li><a class="reference internal" href="#compile-and-install">2.4.2 Compile and install</a></li>
</ul>
</li>
<li><a class="reference internal" href="#running-the-virtual-simulator">2.5 Running the Virtual Simulator</a><ul>
<li><a class="reference internal" href="#prepare-kernel-image">2.5.1 Prepare Kernel Image</a></li>
<li><a class="reference internal" href="#standard-qemu-arguments">2.5.2 Standard QEMU Arguments</a></li>
<li><a class="reference internal" href="#running-kernel-image-in-the-virtual-simulator">2.5.3 Running Kernel Image In the Virtual Simulator</a></li>
</ul>
</li>
<li><a class="reference internal" href="#running-the-virtual-simulator-from-docker">2.6 Running the Virtual Simulator From Docker</a></li>
<li><a class="reference internal" href="#debugging-the-virtual-simulator">2.7 Debugging the Virtual Simulator</a><ul>
<li><a class="reference internal" href="#log-output-control">2.7.1 Log Output Control</a></li>
<li><a class="reference internal" href="#gdb">2.7.2 GDB</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#building-linux-kernel-for-nvdla-virtual-simulator">3. Building Linux Kernel for NVDLA Virtual Simulator</a><ul>
<li><a class="reference internal" href="#download">3.1 Download</a></li>
<li><a class="reference internal" href="#configure">3.2 Configure</a></li>
<li><a class="reference internal" href="#build">3.3 Build</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="sw/test_application.html"
title="previous chapter">Test applications</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="vp_fpga.html"
title="next chapter">Virtual Platform On AWS FPGA</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/vp.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<div class="container">
<div class="row">
<h3>Navigation</h3>
<ul>
<li class="right first">
<a href="vp_fpga.html" title="Virtual Platform On AWS FPGA"
>next</a></li>
<li class="right">
<a href="sw/test_application.html" title="Test applications"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">NVDLA Open Source Project</a>»</li>
<li class="nav-item nav-item-1"><a href="contents.html">Documentation</a>»</li>
</ul>
</div>
</div>
</div>
<div class="footer" role="contentinfo">
<div class="container">
<div class="row">
© <a
href="copyright.html">Copyright</a> 2018 - 2024, NVIDIA Corporation.
<a href="https://www.nvidia.com/object/legal_info.html">Legal Information.</a>
<a href="https://www.nvidia.com/object/privacy_policy.html">Privacy Policy.</a>
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.5.4.
</div>
</div>
</div>
<script type="text/javascript">_satellite.pageBottom();</script>
</body>
</html>