Altera_Forum
Honored Contributor
15 years agoPIO Interrupts PCIe
Hello,
i'm a student from germany and new in this forum. I have found many answers to my questions, but i stuck on a problem. i have the Cyclone IV GX Transceiver Starter Kit and i'm trying to implement some simple PCIe Designs first, to get close with the PCIe and Driver writing stuff. I have implemented an PIO ( Output ) for the four LEDs on the Board and write a little Driver to access the LEDs, that worked fine. Next i integrated an PIO ( INPUT ) for the two switches on board. In the SOPC Builder i select "Synchronously Capture - Falling Edge - Enable bit-clearing for edge capture register" and "Generate IRQ - Edge", so i think i'm getting an IRQ on every switch push ( LOW Active ). I connected the irq line with the RxmIrq of the PCIe Compiler. My driver requests the Interrupt (request_irq as IRQF_SHARED) and is connected to a small IRQ Handler, which only counts the IRQs and returns IRQ_HANDLED, is see in /proc/interrupts my drivername. But there always stand 0, so no Interrupt comes across, and my Counter also not increments, so i think there really comes no IRQ. On the FPGA i set the AVL_IRQ Bit in the CRA ( 0x50) to activate the IRQs. In the description of the PIO there are some registers (interruptmask), to activate the IRQ to the corresponding bit, but if i write to this register i only read 0s back, so i think i can't access this Register. Perhaps its just because the SOPC Builder hard wired these Bits? I looked in the PIO VHDL File generated by SOPC an on reset the mask is written to "00". I changed it to "11", so IRQs are default activated. If i do, i press a button and get many Interrupts. It seems that i must clear a bit in the edgecapture register, but it doesn't work. The interrupts still comes across. Only clearing the AVL_IRQ bit stops the flood of IRQs. But i think there is another problem with my design, because this can't be the solution? I can read out the data register from my PIO and there always are the right values. But the other registers doesn't exists? Is there another options i must probably turn on in SOPC builder? I also have a question of the register width. In the Datasheet stands the register length 1 to (n-1), does this mean every register has a width of ( in my Example) 2 bits or only the first? In the description stands " controlled by four 32 bit registers ", but it seems there are six registers? I'm a little confused :confused: Thanks for reading, ringo Ps: Sorry for my horrible english :oops: