FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5925 Discussions

Baremetal Application Running Very Slow on Arria 10 ARM

SFost3
Beginner
862 Views

Hello,

 

I have being trying to run a Baremetal Application on the Arria 10 ARM but it is running very slow. I wrote some test code and ran it on the Arria 10 system and a Xilinx system. The Xilinx system is about 25x faster.

Test Code below:

#include <time.h> #include <stdio.h> #include <string.h>   unsigned char testBuffer[500];   void testFunction1(void); void testFunction2(int m);   int main(void) { clock_t start, end, total;   start = clock();   testFunction1();   end = clock();   total = end - start;   printf("Total = %d\r\n", total);   return 0; }   void testFunction1(void) { int i = 0; int j = 0;   for(i = 0; i < 200; i++) { for(j = 0; j < 200; j++) { memset(testBuffer, j, 500); testFunction2(200); } } }   void testFunction2(int m) { int i = 0;   for(i = 0; i < m; i++) { memset(testBuffer, i, 500); } }

The scatter file I am using:

OCRAM 0xFFE00000 0x40000 { APP_CODE +0   { * (+RO, +RW, +ZI) }   ARM_LIB_STACKHEAP 0xFFE20000 EMPTY 0x20000 ; Application heap and stack { } }

I am using the Arm Compiler 5 (DS-5 built-in) and I have followed the steps in this guide: https://fpgawiki.intel.com/wiki/SoCEDSGettingStarted but I can't get any baremetal applications to run at a reasonable speed.

 

Thank you.

0 Kudos
3 Replies
Fawaz_Al-Jubori
Employee
491 Views

Hello sir,

May I know if you have any information about this execution speed?

I need to know what is the meaning of "slow" in terms of numbers. Once you send me this information, I can replicate the case here and debug the code.

 

 

Thanks

0 Kudos
SFost3
Beginner
491 Views

Hello,

When the code hits the return the "total" variable will be about 5400. The CLOCKS_PER_SEC in the time library is 100 so 5400/100 = 54s. I verified this with a stopwatch as well. Running the same code on a Xilinx system takes about 2 seconds.

 

Thank you for your assistance.

0 Kudos
Fawaz_Al-Jubori
Employee
491 Views

Hello,

I am sorry for the late reply.

I didnt get any feedback yet from our internal team.

 

Once I get it I will let you know.

 

Thanks

0 Kudos
Reply