Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20677 Discussions

changing C code run time with changing variable name in NIOS Eclipse

töz00
New Contributor I
466 Views

Hello dear Intel,

 

I really appriciate for your precios helps.

 

I want to ask a question about NIOS Eclipse C code running.

For example, i run a line about sinus calculation (e.g." a = sin(x);" )

let's say its working time is 10 ms. This time is changing when i change the variable name, like a11 instead of a. with name 'a', code run 10 ms, with name 'a11', code run 8 ms. So what does affect that time?

0 Kudos
4 Replies
EricMunYew_C_Intel
Moderator
436 Views

Hi, Taha

 

It depends on where you store the variable, the run time may be longer for external RAM, and shorter for internal RAM.

Also, a long int type may take longer run time than int.

 

As long as the variable follows the naming rule, it shouldn't affect the run time.

 

Thanks.

 

Eric

 

 

0 Kudos
töz00
New Contributor I
436 Views

thanks for replying sir,

i have a system that include 2 nios processor which are connected the same sdram memory (assigning spesific address range) and a dual port internal ram for transferring data (for the data communication) . i am writing a data from 1st nios to 2nd nios. for1st nios to 2nd nios, if i assign an int variable with name a, data sending run time is 10 ms. if i name it 'a11' sending run time is being 8 ms. so i am writing the data on the same ram address with different name and run time is chaging like this.

0 Kudos
EricMunYew_C_Intel
Moderator
436 Views

Hi, Taha

 

May be a better way is to use pointer for the variable.

 

Thanks.

 

Eric

0 Kudos
EricMunYew_C_Intel
Moderator
436 Views

Hi, Taha

 

Can we close this ?

 

Thanks.

 

Eric

0 Kudos
Reply