--- Quote Start ---
originally posted by fplank@Sep 19 2006, 02:14 AM
hello
again...
perhaps you can tell me whats the fastest way to send the nios from a hw 32bits and receive again 32 bits. in between there are some small calculations.
thanks again
flo
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=18319)
--- quote end ---
--- Quote End ---
Hi,
From my pass experience using Nios (not Nios II) which communicate to a user peripheral, using fixed-wait-state = 1 clock cycle. Writing to or reading from a avalon interface register (32-bit) takes more than 10 clock cycles to complete.
Even we need only a line of C code for that data transfer (either write or read 32-bit), the GNU compiler generates few lines of assembly code (around 5-6 lines), this is why it takes more than 10 clock cycles. That few lines of assembly code is essential for Nios processor to initiate its window registers for the data transfer. Such condition is just like when we invoke a function, it actually involves pushing parameters on stack, adjust the stack pointer, adjust the base pointer, store the return address, etc.
In my work, I write 4 sets of 32-bit data, I thought it would takes only 4 or 8 clock cycles, but it turns out to be 42 clock cycles (10 times more than the expectation). If I encapsule the 4 write operations in a function, then invoke that function and pass in 2 parameters, then the 4 write operations are executed, and return; it takes me about 90 clock cycles.
I don't think using DMA would help if your program execution is highly sequential, and you only need a few times of data transfer through Avalon Bus.
Hope this would help.
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif