Specifications

Embedded System Tools Guide (EDK 6.2i) www.xilinx.com 211
UG111 (v1.4) January 30, 2004 1-800-255-7778
MicroBlaze Simulator Target
R
Platform Generator can create a system that includes a JTAG Uart or a Uart, if
specified in the system’s mhs file. For more information on creating a system with
a Uart or a JTAG Uart, refer to the MicroBlaze Hardware Specification Format
chapter. The cables supported with the xmdstub mode are : Xilinx Parallel Cable
III and Parallel Cable IV.
x xmdstub on the board uses the JTAG Uart or Uart to communicate with the host
computer. Hence, it must be configured to use the JTAG Uart or Uart in the
MicroBlaze system.
Library Generator can configure the xmdstub to use the
XMDSTUB_PERIPHERAL in the system. libgen will generate a xmdstub
configured for the XMDSTUB_PERIPHERAL and put it in code/xmdstub.elf
as specified by the XMDSTUB attribute in the mss file. For more information, refer
to the Library Generator chapter.
x xmdstub executable must be included in the MicroBlaze local memory at system
startup.
Data2MEM can populate the MicroBlaze memory with xmdstub. libgen generates
a Data2MEM script file that can be used to populate the BRAM contents of a
bitstream containing a MicroBlaze system. It uses the executable specified in the
DEFAULT_INIT.
x Any user program that has to be downloaded on the board for debugging should
have a program start address higher than 0x400 and the program should be linked
with the startup code in crt1.o
mb-gcc can compile programs satisfying the above two conditions when it is run
with the option -xl-mode-xmdstub
. For source level debugging, programs
should also be compiled with
-g option. While initially verifying the functional
correctness of a C program, it is advisable to not use any mb-gcc optimization
option like -O2 or -O3 as mb-gcc does aggressive code motion optimizations which
may make debugging difficult to follow.
MicroBlaze Simulator Target
You can use mb-gdb and xmd to debug programs on the cycle-accurate simulator built in
XMD. A sample session of XMD and GDB is shown below.
XMD% mbconnect sim
Connected to MicroBlaze “sim” target. id = 0
Starting Remote GDB server for “sim” target (id = 0) at TCP port no 1234
XMD%
Now XMD is running with the simulator target and waiting for a connection from mb-gdb.
The xmd Tcl prompt can also be used simultaneously for executing xmd commands.
Refer to the MicroBlaze GNU Debugger document to see how to start mb-gdb, make a
remote connection from mb-gdb to xmd, download a program onto the target and debug
the program. With xmd and mb-gdb, the debugging user interface is uniform with
simulation or hardware targets.
MicroBlaze Simulation Target Options
mbconnect sim [-memsize <size>]
x memsize <size>