Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12599 Discussions

Slow access to avalon from NIOS

ZVere
Beginner
421 Views

Hello,

My baremetal NIOS application is writing to 32bits registers in the FGPA via AVALON bus. 

The code is:

 

void GwbrWriteWord32 (alt_u32 Offset, alt_u32 Data)
{
	IOWR_32DIRECT (0, Offset,Data);
}
void WriteMyRegister (alt_u32 Val)
{
	GwbrWriteWord32 (MY_OFFSET, Val);
}

int main (void)
{
    WriteMyRegister (17); 
    WriteMyRegister (17); 
    return 0;
}

I measured the time required to execute "WriteMyRegister" with Quartus and got 146 clock ticks. The clock is 100MHz so the time is: 1.46usec  

Does it make sense ?  It seems very slow. 

Do you think I can make it faster by changing the code ?

 

Thank you,

Zvika 

0 Kudos
1 Reply
EricMunYew_C_Intel
Moderator
382 Views

The long latency that you got is correct due to the fact that IOWR_32DIRECT is bypassing data cache.


0 Kudos
Reply