have you ever calculated the mips of lpc1788 board? Recently I've calculated a result via following code running in rom:
volatile uint32_t tick;
void SysTick_Handler()
{
tick++;
}
unsigned long loops_per_ms;
extern void __delay(int n);
int calculate_mips()
{
int prec = 8;
unsigned long ji;
unsigned long loop;
loops_per_ms = 1 << 12;
while (loops_per_ms) {
ji = tick;
while (ji == tick) ;
ji = tick;
__delay(loops_per_ms);
if (ji != tick)
break;
loops_per_ms <<= 1;
}
loops_per_ms >>= 1;
loop = loops_per_ms >> 1;
while (prec--) {
loops_per_ms |= loop;
ji = tick;
while (ji == tick) ;
ji = tick;
__delay(loops_per_ms);
if (ji != tick)
loops_per_ms &= ~loop;
loop >>= 1;
}
return loops_per_ms / 500;
}
delay.s:
PUBLIC __delay
SECTION .text:CODE:REORDER(2)
THUMB
__delay
subs r0, r0, #1
bhi __delay
mov pc, lr
END
With IAR ide, I got loops_per_ms is 39936 and mips will be 79M, whil with Keil, I got a loops_per_ms is 29952 which means the mips is 59M.
The MCU speed is set to 120MHz, by datasheet the MIPS should be 1.25x120=150M, I think code running in ROM slow down the mips.
any body has some comments or other result?