Forum Discussion
18 Replies
- Altera_Forum
Honored Contributor
Hi,
This is a good little refdesign. Thanks! I hope you dont mind but I have taken your design and ported it across to Arria GX and the Altera Arria Gx PCI Express Dev Kit. The design doesnt completely meet timing (yet) but I have tested it on the Altera Arria Gx PCI Express Development board using the GUI attached in your original zip file using the SIIGX drivers and it appears to work fine. I havent documented the LED, Switch, or CLK pin mapping that I chose or the pin placement that I selected but you should be able to read this out of the pin planner, Assignment editor, or QSF file and map against the schematics supplied with the kit. I hope this is helpful. - Altera_Forum
Honored Contributor
too difficult pro at this one?
- Altera_Forum
Honored Contributor
Thank you for the example code. I've been doing something similar using an Arria GX device and I have a couple of questions. First, I was quite unable to make the DMA controller work with memory without adding several pipeline delays in between the memory and the DMA component. I read about this fix in Altera's knowledge base. However, I notice that the Stratix reference design doesn't seem to need the pipeline delays and I wondered why.
My second question is about the PC software side. I'm trying to set up a DMA such that data are copied from my Arria memory and into the PC's memory. Using Jungo's driver software I can get kernel-mode physical memory pointers and I can set up a DMA transaction within the DMA controller which completes OK but nothing turns up in the PC's memory. Presumably the example program PCIe.exe must do all this but Altera won't release the source code so I can't figure out what I'm doing wrong. Any help greatly appreciated. Kind regards - Altera_Forum
Honored Contributor
Andy, how do you know the dma transfer occurred correctly? Did you check the dma status register?
Here are a couple of tips from my experience with getting the dma working (only doing single pages so far): 1. Make sure your PCIe simulation works correctly. Reference the control signals used in the simulation testbench (inside altpcietb_bfm_driver.vhd) to see which addresses the DMA control registers are mapped to .. I found that they differed from the address map for the PCIe user guide example. 2. Base your software off the Jungo driver code provided in the WinDriver PCI User's Manual. I'm not sure, but I think using the windriver API calls for word writes are better for writing to the dma control registers rather than using the kernel-mode physical memory pointers you mentioned. I suspect caching can cause problems when attempting to write to a memory mapped hardware peripheral register. On a similar note, be sure to syncCpu and syncIo as shown in the sample code. 3. There is some jungo sample code also available under the altera directory. I've found the code there to be incorrect for the pcie example, but it serves as a useful guide for how to write your own. Good luck! - Altera_Forum
Honored Contributor
Thank you. There are some very helpful points here that I shall give careful consideration to. I was basing my notion that DMA had completed successfully on the final state of the status register.
I have made one significant discovery which may be helpful to novices like me, however, since posting the note. When locking memory for DMA within Windriver, the call returns three pointers (more for scatter/gather DMA.) I was mistaking the kernel mode pointer for the physical address pointer. Because the context-sensitive auto-complete element of my programming environment was hiding the physical memory pointer array, I didn't see it at first. The physical pointers appear in an array at the end of the DMA structure. Kind regards - Altera_Forum
Honored Contributor
Andy ! Can you help me with some small example for build PC software in Jungo Win driver. I was create SOPC system and can start and stop DMA, read status register e.t.s. Create for Borland Builder small application for Sample Contiguous Buffer DMA Implementation from WinDriver™ PCI/ISA/CardBus User’s Manual Version 9.21 . But I can not see data from on board memory in DMA write cycle.
Thanks a lot !!!! Vladimir - Altera_Forum
Honored Contributor
Dear Vladimir,
while I doubt that I could find it again, if you dig deep enough into the DMA data sheets you'll find that it doesn't, in fact, work. It turns out that you have to add some pipe line delays (at least, that's how I solved this - there may be better ways.) I've tried to attach a jpeg of the final architecture around the DMA controller that I ended up with. I hope this helps you because this was a very frustrating journey for me. While this workd, in my application I managed in the end to avoid the DMA controller by using the NIOS processor to read/write directly into the PCIe address space. Kind regards Andy - Altera_Forum
Honored Contributor
Dear Andy !
thank you for your answer ! At present I do not understand why my project SOPC PCIexpress for Stratix II GX board work with Altera driver and simple_dma.exe or pcie.exe, but not work with my WinXP application with I create with help jungo win driver library. I have create my Altera Stratix progect following AN532, complile, make pof, sof files, programm flash memory on board. After then use windriver_811 progect from Altera arhive (AN532_PCIe_sopc_s2gx_x4). And all work good ! But my own application - is in state of nonoperability. I want look small small small example witch work with board in contig.DMA mode. thank very much !!!! Vladimir - Altera_Forum
Honored Contributor
Dear Vladimir,
I seem to recall that either Jungo or SOPC builder with PCIe (can't remember which) does not support legacy system interrupts. As a result, you have to use message signalled interrupts (msi.) Sadly, only Vista and W7 support msi so, if you're relying on message signalled interrupts and using XP, it won't work. The simplest way to see if this is the problem is to try your application on a Vista machine. Like you, I found Altera's application worked but mine didn't at first and this was one of the principal reasons. Kind regards Andy - Altera_Forum
Honored Contributor
thank you for your answer !
But if I have a lot of answers then I have a lot of misunderstanding :confused:. First - PCIe the principally use MSI ??? interrupt. or INT emulation. But how Altera's progect work in example AN532? With out interrupts :confused:. Thanks !