User`s guide

Interrupt Handling
11-9
Interrupt Handling
The Real-Time Workshop provides blocks in the Interrupt Template library
that allow you to model synchronous/asynchronous event handling, including
interrupt service routines (ISRs). These blocks include:
Asynchronous Interrupt block
Task Synchronization block
Asynchronous Buffer block (read)
Asynchronous Buffer block (write)
Asynchronous Rate Transition block
Using these blocks, you can create models that handle asynchronous events,
such as hardware generated interrupts and asynchronous read and write
operations. This chapter discusses each of these blocks in the context of
VxWorks Tornado operating system.
Asynchronous Interrupt Block
Interrupt service routines (ISR) are realized by connecting the outputs of the
VxWorks Asynchronous Interrupt block to the control input of a function-call
subsystem, the input of a VxWorks Task Synchronization block, or the input to
a Stateflow chart configured for a function-call input event.
The Asynchronous Interrupt block installs the downstream (destination)
function-call subsystem as an ISR and enables the specified interrupt level.
The current implementation of the VxWorks Asynchronous Interrupt block
supports VME interrupts 1-7 and uses the VxWorks system calls
sysIntEnable, sysIntDisable, intConnect, intLock and intUnlock. Ensure
that your target architecture (BSP) for VxWorks supports these functions.
When a function-call subsystem is connected to an Asynchronous Interrupt
block output, the generated code for that subsystem becomes the ISR. For large
subsystems, this can have a large impact on interrupt response time for
interrupts of equal and lower priority in the system. As a general rule, it is best
to keep ISRs as short as possible, and thus you should only connect
function-call subsystems that contain few blocks. A better solution for large
systems is to use the Task Synchronization block to synchronize the execution
of the function-call subsystem to an event. The Task Synchronization block is
placed between the Asynchronous Interrupt block and the function-call