[FONT=Lucida Console]STM32F4 (168MHz and FPU) 8.6 seconds LCPXpresso 1769 (120MHz) 15.1 seconds mbed (96MHz) 16.2 seconds[/FONT] |
#define SCB_BASE_ADDR 0x400FC000 /* Phase Locked Loop (Main PLL0) */ #define PLL0CON (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x080)) #define PLL0CFG (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x084)) #define PLL0STAT (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x088)) #define PLL0FEED (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x08C)) |
#include "LPC17xx.h" #include "leds.h" const float m1[5][5] = { {0.0001, 0.001, 0.01, 0.1, 1},{0.001, 0.01, 0.1, 1, 10},{0.01, 0.1, 1, 10, 100},{0.1, 1.0, 10, 100, 1000},{1, 10, 100, 1000, 10000} }; const float m2[5][5] = { {0.0001, 0.001, 0.01, 0.1, 1},{0.001, 0.01, 0.1, 1, 10},{0.01, 0.1, 1, 10, 100},{0.1, 1.0, 10, 100, 1000},{1, 10, 100, 1000, 10000} }; float m3[5][5]; int matrix(void) { int m, n, p; long j; for(j = 0; j < 100000; j++) { for(m = 0; m < 5; m++) { for(p = 0; p < 5; p++) { m3[m][p] = 0; for(n = 0; n < 5; n++) { m3[m][p] += m1[m][n] * m2[n][p]; } } } } return 0 ; } int main(void) { led2_init(); led2_on(); while(1) { matrix(); led2_invert(); } return 0 ; } |
[FONT=Lucida Console]STM32F4 (168MHz and FPU) 8.6 seconds[/FONT][FONT=Lucida Console] [/FONT][FONT=Lucida Console]mbed (96MHz) 16.2 seconds LCPXpresso 1769 (120MHz) 19.4 seconds [/FONT] |
//clkout (P1.27) to cpu clock LPC_PINCON->PINSEL3 &=~(3<<22); LPC_PINCON->PINSEL3 |= (1<<22); LPC_SC->CLKOUTCFG = (1<<8)|(11<<4); //enable and divide by 12 |
#include "LPC17xx.h" #include "leds.h" const float m1[5][5] = { {0.0001, 0.001, 0.01, 0.1, 1},{0.001, 0.01, 0.1, 1, 10},{0.01, 0.1, 1, 10, 100},{0.1, 1.0, 10, 100, 1000},{1, 10, 100, 1000, 10000} }; const float m2[5][5] = { {0.0001, 0.001, 0.01, 0.1, 1},{0.001, 0.01, 0.1, 1, 10},{0.01, 0.1, 1, 10, 100},{0.1, 1.0, 10, 100, 1000},{1, 10, 100, 1000, 10000} }; int main(void) { led2_init(); led2_on(); int j, m, n, p; volatile float m3[5][5]; while(1) { // Start 100,000 iterations of [5x5] matrix multiplication for(j = 0; j < 100000; j++) { for(m = 0; m < 5; m++) { for(p = 0; p < 5; p++) { m3[m][p] = 0; for(n = 0; n < 5; n++) { m3[m][p] += m1[m][n] * m2[n][p]; } } } } // End benchmark and indicate with LED2 led2_invert(); // Loop and repeat forever } return 0 ; } |
make all Building target: LPCX176x_cmsis2_systick.axf Invoking: MCU Linker .... cannot find -lCMSISv2p00_LPC17xx collect2: ld returned 1 exit status make: *** [LPCX176x_cmsis2_systick.axf] Error 1 |
#include "LPC17xx.h" #include "leds.h" #include <NXP/crp.h> __CRP const unsigned int CRP_WORD = CRP_NO_CRP ; const float m1[5][5] = { {0.0001, 0.001, 0.01, 0.1, 1},{0.001, 0.01, 0.1, 1, 10},{0.01, 0.1, 1, 10, 100},{0.1, 1.0, 10, 100, 1000},{1, 10, 100, 1000, 10000} }; const float m2[5][5] = { {0.0001, 0.001, 0.01, 0.1, 1},{0.001, 0.01, 0.1, 1, 10},{0.01, 0.1, 1, 10, 100},{0.1, 1.0, 10, 100, 1000},{1, 10, 100, 1000, 10000} }; int main(void) { led2_init(); led2_on(); int j, m, n, p; volatile float m3[5][5]; while(1) { // Start 100,000 iterations of [5x5] matrix multiplication for(j = 0; j < 100000; j++) { for(m = 0; m < 5; m++) { for(p = 0; p < 5; p++) { m3[m][p] = 0; for(n = 0; n < 5; n++) { m3[m][p] += m1[m][n] * m2[n][p]; } } } } // End benchmark and indicate with LED2 led2_invert(); // Loop and repeat forever } return 0 ; } |
[FONT=Lucida Console]STM32F4 (168MHz and FPU) 12.2 seconds[/FONT] [FONT=Lucida Console]mbed (96MHz) 16.2 seconds LCPXpresso 1769 (120MHz) 26.7 seconds TI Piccolo (80MHz and FPU) 43.7 seconds Coldfire 5270 (150MHz) 60.2 seconds[/FONT] |