Frequently used commands

This document summarizes a number of frequently-used commands that can be run using the command line.

XCC

To compile a program for your development board, enter the following commands:

  1. xcc -print-targets

    XCC displays a list of supported development boards.

  2. xcc <file> -target=<board> -o <binary>

    XCC compiles the file, generating an executable binary for your target board.

XRUN

To load a compiled program onto your development board, enter the following commands:

  1. xrun -l

    XRUN prints an enumerated list of all JTAG adapters connected to your PC and the devices on each JTAG chain, in the form:

    ID        Name        Adapter ID        Devices

    --        ----        ----------        -------

  2. xrun –id <n> –io <binary>

    XRUN loads your binary onto the hardware connected to the adapter with the specified ID.

    The --io option causes XRUN to remain connected to the adapter, providing the standard output stream from your hardware to the terminal.

XGDB

To compile and debug your program, enter the following commands:

  1. xcc <file> -target=<board> -o <binary> -g

    XCC compiles your file with debugging information enabled.

  2. xgdb bin.xe

    GDB loads with a prompt.

  3. list-devices

    GDB prints an enumerated list of all JTAG adapters connected to your PC and the devices on each JTAG chain, in the form:

    ID        Name        Adapter ID        Devices

    --        ----        ----------        -------

  4. connect –id <id>

    GDB connects to your target hardware.

  5. load

    GDB loads your binary.

  6. break main

    GDB adds a breakpoint to the function main.

  7. continue

    GDB runs the program until it reaches main.

XSIM

To run your program on the simulator, enter the following command:

xsim <binary>

To launch the simulator from within the debugger, at the GDB prompt enter the command:

connect -s

You can then load your program onto the simulator in the same way as if using a development board.