Setting Up the Software Application
- Modify the software application code to enable interrupts. If there
is an interrupt controller present in the system with multiple interrupt
sources, you must enable interrupts in the processor and the interrupt
controller to allow interrupts from the profile timer to reach the processor.
Example code is shown below:
/* enable interrupt controller */ XIntc_mMasterEnable(SYSINTC_BASEADDR); /* service all interrupts */ XIntc_SetIntrSvcOption(SYSINTC_BASEADDR, XIN_SVC_ALL_ISRS_OPTION); /* enable the profile timer interrupt */ XIntc_mEnableIntr(SYSINTC_BASEADDR, PROFILE_TIMER_INTR_MASK); /* enable interrupts in the processor */ microblaze_enable_interrupts();
- If the profiling timer is the only entity that connects to the input of interrupt controller or directly to the processor, the tool sets up the interrupt for you automatically, and no change is required in the application code.
- Right-click the software application and select C/C++ Settings (or Properties > C/C++ Build > Settings).
- Select gcc compiler > Profiling and enable profiling by selecting Enable Profiling (-pg).
- Click OK.