PCIExpress stack

Hi

I have no knowledge of PCIExpress protocol. The questions I have are: (1) where do I start to learn PCIE protocol ? (2) I am an experienced embedded systems programmer. How long would it take to implement PCIE stack in C/C++ ?

(3) Any pointers to documentation of this protocol or examples would be useful

thanks in advance

Abdex

--------------------------------------- Posted through

formatting link

Reply to
abradax
Loading thread data ...

PCIe doesn't have a "stack" like Ethernet or USB. The hardware uses the serial lanes to make the end device look like old PCI, which is itself a memory/IO bus without protocol. There is a lot of protocol, but it's done in hardware on both ends, for instance inside an x86 CPU, and in some hardcore logic in an FPGA or ASIC.

You can program an FPGA to be a PCIe endpoint (assuming it has the hard IP) and it can become a memory-mapped region in the CPU address space. All your program has to do is map it from its physical space (assigned by the BIOS) into something a program can reach. We do that in Linux, with dev/mem or something, and there must be some way in Windows.

PCIe is supposed to be fully transparent to PCI, so all that configuration space/BIOS/interrupt stuff is supposed to just work. It seems to.

--
John Larkin         Highland Technology, Inc 
picosecond timing   laser drivers and controllers 
 Click to see the full signature
Reply to
John Larkin

Well, you do need to set up the BARs, etc., for each device, and the mappings for most bridge chips, but in most cases that's not particularly hard.

Reply to
Robert Wessel

The BIOS generally does all that at boot time, just like PCI. Whatever OS you use, you can call whatever resources it has to find out where the configuration process put things. Or, bare metal, you can prowl config space yourself.

On the device end, you do have to set up the BAR config registers, so that the BIOS knows what resources you need. In an FPGA, you've got to do that on purpose. If you are plugging in a commercial board or using a standard peripherial chip, that's usually all done for you.

I guess an extreme do-it-yourself embedded system might not even have a BIOS, but then you could leap on the golden opportunity to NOT use PCIe.

CPUs used to have memory busses that you could hang things on. Some still do. But many now only get out over the DRAM and USB and PCIe paths, which sort of suck for real embedded design.

--
John Larkin         Highland Technology, Inc 
picosecond timing   laser drivers and controllers 
 Click to see the full signature
Reply to
John Larkin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.