Forum Discussion
Altera_Forum
Honored Contributor
20 years agonios performance
Hi all,
I have a piece of C-code which I have indicated below. { int idx_1, idx_2; for( idx_1 = 0; idx_1 < 6; idx_1++) { for(idx_2 = 0; idx_2 < 16; idx_2++) { p->a[idx_1][idx_2] = q->b[idx_1][idx_2]; } } } I ported the above code to NIOS-II/E no-cache processor. p is a hard coded pointer to a structure i.e struct xyz *p = 0x00040000; I performed verilog simulations on the above code. I found that I need 65 clock cycles between two consecutive writes. Isn't this too large for just memory transfers? Is something incorrect with what I'm doing? Thanks, Sridhar.5 Replies
- Altera_Forum
Honored Contributor
Forgot to mention in earlier post, I'm using an On chip memory using the SOPC-builder.
Regards, Sridhar. - Altera_Forum
Honored Contributor
I'd recommend looking at the resulting assembly code to figure out whether the compiler is doing a good job or not. From your code snippet it's hard to tell since we don't know what types 'a' and 'b' are and how far apart they are in memory.
You've probably already checkd but make sure optimizations are on (Release configuration). Andrew - Altera_Forum
Honored Contributor
Thanks Andrew.
Any idea how I can view assembly code in IDE? a & b are 2-d arrays of unsigned int unsigned int a[6][16]; Regards, Sridhar. --- Quote Start --- originally posted by queisser@Feb 21 2006, 12:27 PM i'd recommend looking at the resulting assembly code to figure out whether the compiler is doing a good job or not. from your code snippet it's hard to tell since we don't know what types 'a' and 'b' are and how far apart they are in memory.you've probably already checkd but make sure optimizations are on (release configuration).
andrew
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=12851)
--- quote end ---
--- Quote End ---
- Altera_Forum
Honored Contributor
In IDE: Window -> Preferences -> Nios II Tab -> turn on "Generate objdump file"
Then rebuild your project and look the .objdump file. Regards Luca --- Quote Start --- originally posted by sridhar.sr+feb 22 2006, 08:48 am--><div class='quotetop'>quote (sridhar.sr @ feb 22 2006, 08:48 am)</div>--- quote start ---
thanks andrew.
any idea how i can view assembly code in ide?
a & b are 2-d arrays of unsigned int
unsigned int a[6][16];
regards,
sridhar.
<!--quotebegin-queisser@Feb 21 2006, 12:27 PM i'd recommend looking at the resulting assembly code to figure out whether the compiler is doing a good job or not. from your code snippet it's hard to tell since we don't know what types 'a' and 'b' are and how far apart they are in memory.
you've probably already checkd but make sure optimizations are on (release configuration).
andrew
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=12851)
--- quote end ---
--- Quote End --- <div align='right'><{post_snapback}> (index.php?act=findpost&pid=12869)</div> [/b] --- Quote End ---
- Altera_Forum
Honored Contributor
i think, your code can be presented as following
so you have two multiplications and two sums plus memory copy{ int idx_1, idx_2; for( idx_1 = 0; idx_1 < 6; idx_1++) { for(idx_2 = 0; idx_2 < 16; idx_2++) { p->a = q->b; } } }