UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor rfalise
Visitor
6,288 Views
Registered: ‎04-15-2009

Interrupt problem

Hi,

 

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);
  begin

    if ( Bus2IP_Clk'event and Bus2IP_Clk = '1' ) then
      if ( Bus2IP_Reset = '1' ) then
        counter := (others => '0');
        interrupt <= (others => '0');
      else
        counter := counter + 1;
        if ( counter = ALL_ONES ) then
          interrupt <= (others => '1');
          else
          interrupt <= (others => '0');
        end if;
      end if;
    end if;

  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,

 

~Ron

0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
6,284 Views
Registered: ‎09-10-2008

Re: Interrupt problem

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?

 

-- John

 

 

0 Kudos
Visitor rfalise
Visitor
6,279 Views
Registered: ‎04-15-2009

Re: Interrupt problem

The interrupt is connected to the interrupt controller.

 

 # cat /proc/interrupts
           CPU0       
 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?

 

~Ron

 

0 Kudos
Xilinx Employee
Xilinx Employee
6,272 Views
Registered: ‎09-10-2008

Re: Interrupt problem

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.

 

-- John

 

 

0 Kudos
Anonymous
Not applicable
6,263 Views

Re: Interrupt problem

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? 

 

 

Terry

 

0 Kudos
Visitor rfalise
Visitor
6,033 Views
Registered: ‎04-15-2009

Re: Interrupt problem

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.

 

~Ron

0 Kudos