Specifications

330 www.xilinx.com Embedded System Tools Guide (EDK 6.2i)
1-800-255-7778 UG111 (v1.4) January 30, 2004
Chapter 23: Interrupt Management
R
The interrupt controller driver uses the priorities and the maximum number of interrupt
sources in a system as #defines. Libgen generates priorities for each of the interrupt signals
as #defines in xparameters.h using the following naming convention:
XPAR_<INTC_INSTANCE_NAME>_<PERIHPERAL_INSTANCE_NAME>_<PERIPHERA
L_INTERRUPT_SIGNAL_NAME>_INTR
XPAR_<PERIHPERAL_INSTANCE_NAME>_<PERIPHERAL_INTERRUPT_SIGNAL_NA
ME>_MASK
For example, the priority 1 interrupt is defined as
XPAR_OPB_INTC_0_PERIPHERAL_1_PRIORITY_1_INTERRUPT_INTR
XPAR_OPB_INTC_0_PERIPHERAL_1_PRIORITY_1_INTERRUPT_MASK
in xparameters.h, where opb_intc_0 is the instance name of the interrupt controller
peripheral. Libgen also generates a XPAR_INTC_MAX_NUM_INTR_INPUTS to be the
total number of interrupting sources (which is 4 for Figure 23-2 scenario)connected to the
interrupt controller peripheral.
Example Systems
System without Interrupt Controller (Single Interrupt Signal)
An interrupt controller is not required if there is a single interrupting peripheral or an
external interrupting pin and its interrupt signal is level sensitive. Note that a single
peripheral may raise multiple interrupts. In this case, an interrupt controller is required.
Procedure
To set up a system without an interrupt controller that handles only one level sensitive
interrupt signal, the following steps must be taken:
1. The MHS and MSS file must be set up as follows:
i The interrupt signal of the peripheral(or the external interrupt signal) must be
connected to the interrupt input of the MicroBlaze in the MHS file.
i The peripheral must be given an instance name using the INSTANCE keyword in
the MHS file. Libgen creates a definition in xparameters.h (OUTPUT_DIR/PROC
INST NAME/include) for XPAR_INSTANCE_NAME_BASEADDR mapped to
the base address of this peripheral.
2. The interrupt handler routine that handles the signal should be written. The base
address of the peripheral instance is accessed as
XPAR_INSTANCE_NAME_BASEADDR.
3. The handler function is then designated to be an interrupt handler for the signal using
the INT_HANDLER keyword in the MSS file. Refer to Chapter 19, “Microprocessor
Software Specification (MSS)” for more information. The peripheral instance is first
selected in the MSS file, and then the INT_HANDLER attribute is given the function
name. In case of an external interrupt signal, the INT_HANDLER attribute is given as
a global parameter in the MSS file. The attribute is not part of any block in the MSS.
4. Libgen and mb-gcc are executed. This operation has the following implications:
i the function is automatically registered with the exception table. This ensures that
MicroBlaze calls the function on interrupts. By default, MicroBlaze turns off
interrupts from the time an interrupt is recognized until the corresponding rtid
instruction is executed.