Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
9 years ago

Bare-metal Execution Is Slow

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() {

setup_peripherals();

while (true) {

alt_xorbits_word(hps_addr, 0x800000 );

}

}

// my code to toggle fpga AJ22 pin

int main() {

setup_peripherals();

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

mmu_init();

alt_cache_system_enable();

where mmu_init() get from http://www.alteraforum.com/forum/archive/index.php/t-46180.html.

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.
No RepliesBe the first to reply