Altera_Forum
Honored Contributor
21 years agoStreaming DMA into NiosI
Hello,
Great Forum! Love the Nios! (but that's not the subject of this post http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif We're having much trouble streaming data into a Nios UDL port. The Nios is clocked at 75 MHz, is running in a Cyclone EP1C12, and we are trying to use Dataavailable_n to control the flow for 1-2MHz 32 bit values. The idea is we setup a dma for a packet of anywhere from 1K to 11K 32 bit values from this single address port into 32 bit SDRAM. (same as on the Cyclone devkit) So the dma is setup and then the transfer begins and when a value is ready the external (to the Nios, but inside the Cyc) logic pulls DAVn low and waits for RDn from the Nios. Once RDn is detected, DAVn goes high until the next value is ready. Once the proper number of values is transfered everyone is happy. Two problems. 1. We're getting both double reads and skipped values (never more than one skip) (We can detect this because the lower 2 bits of the 32 bit value are a counter) 2. The first RDn can take upto 30 xfer times (missing these values) before it comes. Once the first one asserts, its pretty timely after that. First of all, after trying timing variations and this and that for several weeks we wonder if it is possbile or not? We've tried deasserting on the falling edge of RDn but we miss many reads that way - meaning it appears that the read doesn't actually occur if DAVn deasserts too early. (even though RDn looks good on the LA) We've tried deasserting DAVn on the rising edge of RDn, but that leads to double reads. (looks like a glitch on the LA) Adding waits and holds doesn't help this. Any suggestions? Our next try will be to deassert DAVn on the next rising edge of the clock after RDn goes low. To address 2. we're going to try raising the priority of the port. Think this might work? Any chance the newer versions of periphs in Nios II kit would help? The other idea is to abandon this approach and make the peripheral an Avalon Master, but I wonder if the problem in 2. will show up as an extended waitrequest. Any comments or suggestions are greatly appreciated. Ken