Forum Discussion
Altera_Forum
Honored Contributor
14 years agoIf you want to read data from the PIO and write it directly to a memory location on the host side then yes reading from the BAR will do this.
If you want to buffer the PIO data locally in memory on the FPGA then read it over PCIe then you would have to DMA the data from the PIO into the local memory first, then read the data from the memory either by reading directly from the BAR or kicking off a memory --> PCIe transfer using the DMA. By any chance are you trying to sample data from the PIO? If so I wouldn't recommend this approach since the sampling interval will not be constant. You would be better off using a FIFO with one side MM/ST that you can read data out of with the other side clocked at the sampling frequency and connected to the I/O.