Microblaze [ PART3 ]

: Presentation
: eCos HAL
: Virtex5 Target board
: Footprint / Dhrystone Benchmark
: Creating external IPs

I. Running eCos on Virtex5

In this section the microblaze eCos HAL is tested on a Virtex 5 device. The Xilinx Spartan3adsp 1800 plaftorm HAL is used as template, the following peripherals are included in the design:
- 128KB of BRAM memory mapped at @ 0x00000000
- XPS irq controller mapped at @ 0x81800000 ( IVR is available )
- XPS UARTLite serial mapped at @ 0x84000000 with IRQ mapped to # 1
- XPS timers mapped at @ 0x83C00000 with IRQ mapped to # 0
- MDM (Microblaze Debug Module) at @ 0x84400000

The microblaze debug module is the interface between the Xilinx probe and the microblaze core and is mandatory to load the application from GDB.

- Compile eCos HAL plus kernel:

$ ecosconfig new spartan3adsp minimal
$ ecosconfig add kernel
$ configtool ecos.ecc -> select BRAM startup type
$ ecosconfig tree
$ make
$ make -s tests IGNORE_LINK_ERRORS=y

- Create microblaze architecture and load the bit file:

From Xilinx EDK, configure the microblaze and its peripherals as described in PART1. Build the test application provided by Xilinx (Right click on the project -> Select Build Project). The default Xilinx libraries and test application will be compiled. Note that from Xilinx EDK release 13, it is no longer possible to build application from the Xilinx Platform Studio, instead, the Xilinx Software Development Kit must be used.

Update the bit stream with the application code inluded as the initial BRAM content (Hardware->Generate bitstream):

Connect the target to the host machine using the Xilinx probe and load the bit stream down to the FPGA (Device configuration->Download Stream). Launch the Xilinx® Microprocessor Debugger engine (Also from EDK: Debug->Launch XMD). Check that the connection with the target is successful. If the connection does not establish when starting XDM, connect manually:

XMD% connect mb mdm

Connect the GDB client to XMD (TCP port 1234), load the application (does not have to be the same application as used to initialise the BRAM) and start:
$ microblaze-elf-gdb $HOME/xilinx_k/install/tests/kernel/current/tests/kclock1
$ target remote localhost:1234
$ load
$ set $pc=0x00000000
$ stepi

$ c

Dump from the RS232 port:

II. Initialising the BRAM memory with the eCos test application

From the EDK, go to the Applications tab and select -> Add software application project...
You can select any ELF file to be used to initialise the BRAM memory. Note that the ELF file must be copied over to the project location in the form projectname\executable.elf in order for it to work properly.