Tutorial 1
FPGA based Soft core processor LEON3 running fundamental application
Procedure
1- Install tool chain available at gaisler.com. it is an executable file . Just click and run it.
Figure 1.1GRTools installer for Windows
2- Download latest version of grlib IPs from gaisler.com and extract it in a folder.
Figure 1.2grlib at gaisler.com
3- open \..\grlib-master\designs\leon3-xilinx-ml50x in linux terminal and run command 'make xconfig'. Do remember that 'make xconfig' reguires latest version of tcl/tk so install tcl/tk in order to run 'make xconfig'(We are targeting LEON3 for ml509. So next all instructions will be in reference to ml509.)
Figure 1.2 Configuration GUI for Leon3
4- Explore different options in the form of push buttons and select desired configuration. Do remember always select size of cache set same as MMU page size else page faults will occur.
Figure 1.3 Configuration options for Leon3
5- After configuring processor run 'make ise'. if PATH variable in LINUX is set to Xilinx ISE tool then this will generate leon3mp.bit file else it will create project file leon3mp.xise which could be synthesized in windows XIlinx tools. Ultimate outcome is leon3mp.bit.
6- Transfer that bit file to ml509 kit as standard procedure. and connect ml509 to workstation via usb-jtag interface.
Figure 1.4 Downloading Leon3 bitstream on ml509
7- Write HelloWorld.c file and place it in\..\grmon-eval\win32 as sparc compiler for gcc resides there. grmon-eval can also be downloaded from gaisler.com
8-Now open command prompt in Window and go to \..\grmon-eval\win32 and compile HelloWorld.c with :
sparc-elf-gcc -g HelloWorld.c -o HelloWorld.exe
This will create sparc compatible executable file.
Figure 1.6 Compiling sample application on sparc-gcc compiler
9- After creation of executable file go to \..\grmon-eval\win32\bin , open grmon with these switches as shown in Figure 1.7.
grmon -jtag -xilusb-nb
This will detect the processor platform and display its specifications. To get detailed specification type 'info sys'.
Figure 1.7 Detecting H/W platform
10- After detecting the H/W processor platform it is about time to load our software application on it and run it . For this purpose load and run HelloWorld.exe using these commands. Shown in Figure 1.8.
load hello.exe
run
Figure 1.8 Loading and running sample application on Leon3
11- Output can be seen at HyperTerminal/putty as shown in Figure 1.9
Figure 1.9 Output Display on puTTy
11- sample outputs for benchmarks e-g dhrystone MIPS and stanford_sort are shown in figure 1.10 (a)&(b).
(a)
(b)
Figure 1.10 Benchmarks running on Leon3 (a) dhrystoneMIPS (b) stanford_sort)