Specifications

Embedded System Tools Guide (EDK 6.2i) www.xilinx.com 329
UG111 (v1.4) January 30, 2004 1-800-255-7778
Libgen Customization
R
On interrupts, PowerPC jumps to the handler registered in the exception table. The user is
required to register the handler of the interrupt source with the PowerPC exception table
using a function(XExc_RegisterHandler) in the PowerPC Board Support Package (BSP).
This function is provided by Xilinx. The Interrupt Source connected to PowerPC could be
any of the following :
x “Interrupt Controller Peripheral.”
x “Peripheral with an Interrupt port.”
x “External Interrupt Port.”
For PowerPC, the interrupt handler of either an interrupt controller(in systems using
interrupt controller), or a perpheral/global port handler should be registered with the
exception table. Registering such handler should be part of the user code. The handler can
be for either non-critical interrupt port or critical interrupt port based on the connection
defined in the MHS file. The following is an example snippet that shows how to register a
handler for non-critical interrupts for PowerPC :
/* Initialize the ppc405 exception table*/
XExc_Init();
/* Register the interrupt controller handler with the exception table*/
XExc_RegisterHandler(XEXC_ID_NON_CRITICAL_INT,
(XExceptionHandler)XIntc_DeviceInterruptHandler,
XPAR_OPB_INTC_0_DEVICE_ID);
Apart from the registering of the handler with the exception table, the rest of the
processing for all the three cases listed above are similar to the explanation in MicroBlaze
sections.
Libgen Customization
Libgen tool generates the address map of the hardware system defined. The address map
is defines the base and high addresses of each of the peripherals connected to the
processor. It also generates interrupt priorities for each of the peripheral connected to an
interrupt controller peripheral. The information are generated in the header file
xparameters.h.Based on the MSS file, libgen does the following for interrupt management :
x Register an handler with the exception table for MicroBlaze
x If interrupt controller peripheral is used, generate the vector table for the interrupt
controller peripheral.
x Register handlers of each of the peripheral interrupt signal connected to the interrupt
controller peripheral in the vector table, if defined in the MSS file.
xparameters.h
The xparameters.h file defines the hardware system that is used by the software. The file
includes an address map of the hardware system which includes the base and high
addresses of each of the peripherals connected to a processor. The naming convention used
by the tool for generating base and high addresses are :
XPAR_<PERIPHERAL_INSTANCE_NAME>_BASE_ADDR
XPAR_<PERIPHERAL_INSTANCE_NAME>_HIGH_ADDR