Altera_Forum
Honored Contributor
13 years agoPCIe PIO Beginner Questions
I've been pouring over the documenation, examples, and forums for information on PCie HIP implementation and I'm still really struggling here so I'm hoping someone can help me in my first battle with IP cores.
Board: Cyclone IV GX Transciever Kit Goal: Have FPGA issue commands to a PCI device Basic Questions: Nios II library for PCIe PIO? PCIe required vs optional connections? Find PCI device by polling physical addresses? Note that partial answers are much appreciated, as well as pointers to useful documentation I might have missed. Below is the TL;DR version where I am explaining where my head is right now to see if I have just a gross misunderstanding. Anyone willing to tackle that entire thing would be an angel. Thanks all! So where I'm at, is I think I want regular old PIO instead of DMA because the transfers of data are very short (like a single DW every once and a while). Truth be told, I am not sure what the best way to implement this is, but its looking like using avalonMM. I was thinking a NiosII would have some header file where I could just write_pci(address,data) thing, but such libraries are either hidden or nonexistant. If niosII is the way (and I still think it might be) then I guess the plan of attack is to generate a qsys project, connect it with some memory, the PCIe compiler (Q12 doesnt have a HIP for Cyc IV?), and then program the Nios. The number of ports on the PCIe compiler however is rather intimidating to those new with PCIe, so is there any indication of what ports you actually NEED vs Extras for various... things? Assuming then that my fpga gets built right I need to program the Nios which in my mind goes the route of configuration reading the various physical addresses, finding the right ID, grabbing the BAR values, and then issuing memory writes (and waiting for ACKs before going again) to do your actual work. Some concern here to me is address translation, type 1 vs 0 commands, and how to do the physical address polling. If Nios II is NOT the way to go here, then megafunction with an awesome .v state machine might I guess work, but I feel like I will need to understand PCIe better for that which is something I am not confident in at the moment. If you have read all of the above many thanks for atleast your consideration. Any and all wisdom or shared experience would be lovely