Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
39 Views

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

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
Highlighted
9 Views

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

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
Highlighted
Beginner
9 Views

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

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
Highlighted
9 Views

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

Hi, Taha

 

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

 

Thanks.

 

Eric

0 Kudos
Highlighted
9 Views

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

Hi, Taha

 

Can we close this ?

 

Thanks.

 

Eric

0 Kudos