Altera_Forum
Honored Contributor
16 years agoread and write timings on avalon interface
Hello!
I'm having some issues with the timings of read and write operations to my custom peripherals. I am using a Nios 2 processor a PIO peripheral for testing and my custom peripheral. The problem is the duration of the read and write operations. I am going to refer only to write operation. The testing procedure involved making writes to my peripheral and writing 1s and 0s to the PIO and watching the whole mess on a scope. I also examined the objdump from Nios 2 IDE to see that whose writes are the only thing that it is doing. My peripheral works at 50MHz and I have tested the following working configurations (among others...): - Processor at 100MHz and my peripheral at 50MHz. In this case the write operation took 140ns or 14!!! clock cycles. - Processor and peripheral at 50MHz. In this case the write operation has a variable(!!!) length, namely for writing 0 it needs 2 clock cycles and for writing something else about 6 cycles. (I must say that I am referring only to the execution of iowr operation, without other register loads). Writing to the PIO always took 2 clock cycles (so 40ns or 20ns, depending on the clock speed). The timings for read and write operations of the avalon MM slave interface of my peripheral are all 0 so no delay there. Could someone explain this behaviour? I would like my Nios 2 core to run at 100MHz so the 14 cycle operation is unacceptable. I was thinking of using a memory or a fifo to communicate with my peripheral... Thank you!