Description It is possible to simulate interrupts (both IRQ and FIQ) with the ARMulator, to help with (for example) testing an IRQ or FIQ handler. The ARM debuggers unfortunately do not provide a button or any other direct mechanism to generate interrupts. The reason for this is that it does not reflect a realistic situation as it is fairly unlikely that someone would ever actually wire a push-button directly to the nIRQ signal. Normally the nIRQ line would be driven by a real peripheral device - so this is what needs to be modelled. Instead, we have adopted a more powerful approach, where interrupts can be generated using add-on peripheral models bolted on to the ARMulator instruction set simulator. Solution The ARMulator core represents the processor core (and cache), but the memory system is provided in C source code which can be customized to model *any* target system. The interface between the ARMulator core and the C memory model represents the pin interface of the ARM core. This includes the ability for the memory model to generate interrupts on nFIQ and nIRQ pins. The ARMulator calls the memory model once every memory cycle, with the address it wants to access. You can decode specific addresses (corresponding to h/w registers in the peripheral) by treating accesses to these addresses specially. It is also possible to cause interrupts by calling the ARMul_SetNirq function. To customize the ARMulator, you must modify the supplied memory model sources to simulate a peripheral. The ARMulator should then be rebuilt - on a PC you require Microsoft Visual C++ to rebuild "ARMULATE.DLL". This solution is independent of the ARM debugger you are using (ADW, ADU, armsd, AXD, or even a third-party debugger) because this is part of the ARMulator rather than the debugger. This is not difficult, and it is a powerful technique which can be extended to model an entire system in C. For instance, it would be possible to model a PDA development system, including a keyboard, timers, parallel port, LCD display, etc. Full details are provided in Application Note 32, The ARMulator in the ARM Application Notes. This example demonstrates creating a parallel port example which causes interrupts when characters are received by the parallel port. Please note that this Apps Note was designed for SDT 2.50/2.51. Instructions for rebuilding the ADS ARMulator are given in the ADS documentation.
|