1.. zephyr:board:: generic_leon3
2
3Overview
4********
5
6This board configuration is designed to work with LEON3 processor template
7designs available in the GRLIB GPL distribution.
8It can also be used with the evaluation version of the TSIM3 LEON3 simulator.
9
10Hardware
11********
12
13The board configuration is compatible with most GRLIB LEON3 FPGA template
14designs such as the Digilent Arty A7, Terasic DE0-Nano and Microsemi
15M2GL-EVAL-KIT.
16
17Programming and Debugging
18*************************
19
20Building
21========
22
23Applications for the ``generic_leon3`` board configuration can be built as usual
24(see :ref:`build_an_application`).
25In order to build the application for ``generic_leon3``, set the ``BOARD`` variable
26to ``generic_leon3``.
27
28Running on hardware
29===================
30
31Connect with GRMON, then load and run the application. The example below uses
32the Terasic DE2-115 Cyclone IV FPGA board.
33
34.. code-block:: console
35
36    $ grmon -altjtag -u
37      GRMON debug monitor v3.2.8 eval version
38
39      Copyright (C) 2020 Cobham Gaisler - All rights reserved.
40      For latest updates, go to http://www.gaisler.com/
41      Comments or bug-reports to support@gaisler.com
42
43    JTAG chain (1): EP3C120/EP4CE115
44      GRLIB build version: 4250
45      Detected frequency:  50.0 MHz
46
47      Component                            Vendor
48      LEON3 SPARC V8 Processor             Cobham Gaisler
49      AHB Debug UART                       Cobham Gaisler
50      JTAG Debug Link                      Cobham Gaisler
51      GR Ethernet MAC                      Cobham Gaisler
52      GRDMAC DMA Controller                Cobham Gaisler
53      LEON2 Memory Controller              European Space Agency
54      AHB/APB Bridge                       Cobham Gaisler
55      LEON3 Debug Support Unit             Cobham Gaisler
56      Generic UART                         Cobham Gaisler
57      Multi-processor Interrupt Ctrl.      Cobham Gaisler
58      Modular Timer Unit                   Cobham Gaisler
59      General Purpose I/O port             Cobham Gaisler
60      SPI Controller                       Cobham Gaisler
61      AHB Status Register                  Cobham Gaisler
62
63      Use command 'info sys' to print a detailed report of attached cores
64
65    grmon3> load zephyr/zephyr.elf
66          40000000 text              16.2kB /  16.2kB   [===============>] 100%
67          400040A8 initlevel           40B              [===============>] 100%
68          400040D0 rodata             484B              [===============>] 100%
69          400042B4 datas               20B              [===============>] 100%
70          400042C8 sw_isr_table       256B              [===============>] 100%
71          400043C8 devices             36B              [===============>] 100%
72      Total size: 16.98kB (1.91Mbit/s)
73      Entry point 0x40000000
74      Image zephyr/zephyr.elf loaded
75
76    grmon3> run
77    *** Booting Zephyr OS build zephyr-v2.4.0-30-ga124c31ec4cf  ***
78    Hello World! generic_leon3
79
80
81Running in simulation
82=====================
83
84The same application binary can be simulated with the TSIM3 LEON3 simulator.
85
86.. code-block:: console
87
88    $ tsim-leon3
89     TSIM3 LEON3 SPARC simulator, version 3.0.2 (evaluation version)
90
91     Copyright (C) 2020, Cobham Gaisler - all rights reserved.
92     This software may only be used with a valid license.
93     For latest updates, go to https://www.gaisler.com/
94     Comments or bug-reports to support@gaisler.com
95
96    Number of CPUs: 2
97    system frequency: 50.000 MHz
98    icache: 1 * 4 KiB, 16 bytes/line (4 KiB total)
99    dcache: 1 * 4 KiB, 16 bytes/line (4 KiB total)
100    Allocated 4096 KiB SRAM memory, in 1 bank at 0x40000000
101    Allocated 32 MiB SDRAM memory, in 1 bank at 0x60000000
102    Allocated 2048 KiB ROM memory at 0x00000000
103
104    tsim> load zephyr/zephyr.elf
105      section: text, addr: 0x40000000, size 16552 bytes
106      section: initlevel, addr: 0x400040a8, size 40 bytes
107      section: rodata, addr: 0x400040d0, size 484 bytes
108      section: datas, addr: 0x400042b4, size 20 bytes
109      section: sw_isr_table, addr: 0x400042c8, size 256 bytes
110      section: devices, addr: 0x400043c8, size 36 bytes
111      Read 436 symbols
112    tsim> run
113      Initializing and starting from 0x40000000
114    *** Booting Zephyr OS build zephyr-v2.4.0-30-ga124c31ec4cf  ***
115    Hello World! generic_leon3
116
117References
118**********
119* `GRLIB IP Library and LEON3, GPL version <https://www.gaisler.com/index.php/downloads/leongrlib>`_
120* `TSIM3 LEON3 simulator <https://www.gaisler.com/index.php/products/simulators/tsim3/tsim3-leon3>`_
121* `GRMON3 debug monitor <https://www.gaisler.com/index.php/products/debug-tools/grmon3>`_
122