FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6343 Discussions

Get BAR contents from PCIe ipcore application side

Altera_Forum
Honored Contributor II
839 Views

Hi all, 

 

I want to get the RC (host) give access to the memory on the FPGA board via PCIe. In order to do this the application code running in the FPGA needs to know the contents of the BAR used to access that memory. This is needed because PCIe transaction contains the mapped address as seen from the host. To calculate the memory address as seen by the FPGA I need to subtract the BAR contents from the address in the transaction. 

 

I've googled around and have read the PCIe core documentation but did not find a good way to read the BARs. There is the LMI but the documentation says that one should not use it except for writing AER stuff. 

 

If reading the BAR is complicated (as via LMI) I would also need a signal that the BAR has changed, because the host may change it at any time and to correctly process a transaction I need the actual value. Reading the BAR via LMI for every transaction does not look reasonable. 

 

So how is this supposed to be done? 

 

Thanks, 

harti
0 Kudos
0 Replies
Reply