Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Bare-metal Execution Is Slow

Honored Contributor II

I am using DE1-SoC to start bare-metal programming for dual-core Cortex-A9 ARM hard processor, Cyclone V. 



I configured hps output clocks in qsys as follow 

MPU clock=800 Mhz, L3 MP clk = 200Mhz, L3 SP = 100Mhz, L4 (MP and SP) = 100Mhz. 



I write a code just to toggle hps pin, then a code to toggle fpga pin through h2f bridge as follow 



// my code to toggle hps hps_GPIO1[23] pin 

int main() { 


while (true) { 

alt_xorbits_word(hps_addr, 0x800000 );  



// my code to toggle fpga AJ22 pin 

int main() { 


uint32_t *PIO_addr = 0xC0000000 + PIO_0_BASE; 

while (true) { 

alt_xorbits_word(PIO_addr, 1 );  



The code worked but its toggling speed around 500 Khz, as you see it's very slow compared to ARM capabilities 



Then I turned on MMU unit and enabled cache system as follow 






where mmu_init() get from


here the frequency of toggling increased to 1.3 Mhz. 



My Questions are, 



How could I increase the toggling speed? 

Is this the maximum frequency I can get? 

Is there a problem in hps init or configuration? 

I tested ARM clocks using alt_clk_freq_get( any_clk, &clk_freq)), I got frequencies as expected, but I am still not sure about this function.
0 Kudos
0 Replies