04-30-2009 07:13 AM
I am trying to produce an interrupt on a custom board running Linux 2.6.29. I am using the following generic counter...
INTR_PROC : process( Bus2IP_Clk ) is
constant COUNT_SIZE : integer := 30;
constant ALL_ONES : std_logic_vector(0 to COUNT_SIZE-1) := (others => '1');
variable counter : std_logic_vector(0 to COUNT_SIZE-1);
if ( Bus2IP_Clk'event and Bus2IP_Clk = '1' ) then
if ( Bus2IP_Reset = '1' ) then
counter := (others => '0');
interrupt <= (others => '0');
counter := counter + 1;
if ( counter = ALL_ONES ) then
interrupt <= (others => '1');
interrupt <= (others => '0');
end process INTR_PROC;
IP2Bus_IntrEvent <= interrupt;
When I look at /proc/interrupts, I never see a change on my custom peripheral. Am I missing something in the above code?
Thanks in advance,
04-30-2009 07:28 AM
There's a lot of details missing there, and not exactly the right crowd for reviewing hdl possibly.
I have not tried what you're doing, so not an expert here.
I'm not sure if proc interrupts will show anything as you may need device tree entries for a device connected to the interrupt. To my knowledge, proc/interrupts only shows the devices that drivers have been found for.
Is the interrupt connected to the interrupt controller?
04-30-2009 07:54 AM
The interrupt is connected to the interrupt controller.
# cat /proc/interrupts
16: 1204 Xilinx INTC Edge serial
19: 0 Xilinx INTC Edge digital-drop-receiver-0
My peripheral is the digital-drop-receiver. I was under the impression that when an interrupt occurs, the values above would reflect that.
My peripheral has an IRQ=9 (from the DTS file) and this corresponds to IER= 0x00000280. So, I believe I have enabled the interrupt properly?
I understand this may not be the place to ask questions regarding VHDL. The code was generated by the Peripheral Wizard (hopefully it is correct) and I was hoping to get a verification as to its correctness. Any other info I can provide?
04-30-2009 08:05 AM
Everything you said makes sense. Interesting... haven't used that part of the EDK.
Do you have a device driver that got installed for the device?
I'm not sure if you have to connect the interrupt handler to get all that to work or not? Until a handler is connected it may consider it a spurious interrupt and then not count it, not sure?
I'd create a simple device driver and if I didn't see interrupts, I'd probably put a chipscope in to verify the interrupt is toggling or I'd put it out to a GPIO pin and put a scope on it.
Sorry I'm not more help here.
04-30-2009 08:17 AM
A few questions:
Have you verified that this HDL works in simulation? In hardware?
Have you tested this out with a driver in a non-Linux system (i.e. using standalone BSP) to make sure you get interrupts?
05-27-2009 05:08 AM
Sorry it took so long to get back to this...got pulled in a different direction for a while.
I did verify that this works in simulation. Using Chipscope I never see a change in the interrupt line, and I have a standalone BSP to monitor the interrupt line and again, no change.