cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
6,688 Views
Registered: ‎12-05-2012

How to generate an interrupt in programmable logic ???

Jump to solution

Hello I have initilialized an interrupt in EDK but I dont know the how to generate an interrupt in programmable logic which will be carried over to the processor system to change the data in my peripherals.

 

Any ideas or atleast in what way I should change the bits in IRQ line which causes the interrupts ??

 

Thanks in advance

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Teacher
Teacher
8,574 Views
Registered: ‎11-14-2011

Re: How to generate an interrupt in programmable logic ???

Jump to solution

The interrupt you generate is just a signal. You make it external to your custom logic and map it to the IRQ_F2P in your processor system. That's it. In your processor system, the IRQ_F2P port should be identified in your MHS as an interrupt, of whatever polarity and whatever sensitivity. 

 

How you assert the interrupt based on your flags in your custom logic is up to you. I gave an example, it might not be what you want but it's an example.

 

Is this clear?

 

Regards,

 

Howard

 

----------
"That which we must learn to do, we learn by doing." - Aristotle

View solution in original post

0 Kudos
8 Replies
Highlighted
Teacher
Teacher
6,686 Views
Registered: ‎11-14-2011

Re: How to generate an interrupt in programmable logic ???

Jump to solution

Will this interrupt be level or edge sensitive? Synchronous to a clock or not?

 

Under what circumstances will this interrupt be generated? i.e., what event shall cause the interrupt?

 

I used an interrupt based on the value of the LSB of a software accessible register, e.g.

 

  my_irq <= my_register(31);

 

and this works fine (level sensitive). The clearing mechanism is another part of the software writing a '0' to the register. Does this idea fit the bill?

 

Regards,

 

Howard

 

----------
"That which we must learn to do, we learn by doing." - Aristotle
0 Kudos
Highlighted
Anonymous
Not applicable
6,682 Views

Re: How to generate an interrupt in programmable logic ???

Jump to solution
0 Kudos
Highlighted
Explorer
Explorer
6,672 Views
Registered: ‎12-05-2012

Re: How to generate an interrupt in programmable logic ???

Jump to solution

Thanks for the quick reply.

My interrupt is synchronous and edge sensitive.

I need to generate an interrupt based on the status of my flags which are input to my design.

So can you explain how is it possible to generate an interrupt on the IRQ line and how can I connect to the processor system.

 

thanka in advance

0 Kudos
Highlighted
Teacher
Teacher
6,665 Views
Registered: ‎11-14-2011

Re: How to generate an interrupt in programmable logic ???

Jump to solution

I don't really know what you mean by "initialised an interrupt in EDK". Are you using the Interrupt Controller, or are you going to connect directly to the processor?

 

In any case, your custom IP will have an IRQ output and, in XPS, you simply connect this to the relevant input (i.e. either the Int Controller or the Processor) like you would connect any two ports in XPS. Realistically, you are simply connecting a signal from one point to another.

 

To generate it in your custom IP based on your flags status should be easy as pie, something like:

 

if rising_edge (clock) then

  if ((flag_old = '0') and (flag_new = '1')) then -- positive change in flag status

    my_irq <= '1';

  elsif (clear = '1') then -- proposed clearance mechanism for interrupt

    my_irq <= '0';

  else

    my_irq <= my_irq;

  end if;

end if;

 

The interrupt set up at the receivng end should be set up for edge sensitivity, rising or falling as you see fit. Does this help?

 

Regards,

 

Howard

 

----------
"That which we must learn to do, we learn by doing." - Aristotle
0 Kudos
Highlighted
Explorer
Explorer
6,659 Views
Registered: ‎12-05-2012

Re: How to generate an interrupt in programmable logic ???

Jump to solution

Hello Howard,

 

I will explain you what I want to do.

 

I have designed a state machine in the programmable logic, the state machine is based on the inputs of the 2 flags.

NOW I HAVE To GENERATE AN Interrupt based on the states of my state machine and when the interrupt is generated it  should be carried to the processor system(PS). which will change the data I am sending through the I2c line.

 

I have also enabled the IRQ_F2P line by making it external in the ports tab( EDK.).

 

Now my question is which  signal or pin should I configure or create to enable an interrupt on IRQ_F2P. In otherwords how should I send the interrupt from my design to the PS using IRQ_F2P.

 

I hope it is clear now or please tell me which part is not clear

 

regards 

 

Pruthvi

 

0 Kudos
Highlighted
Teacher
Teacher
8,575 Views
Registered: ‎11-14-2011

Re: How to generate an interrupt in programmable logic ???

Jump to solution

The interrupt you generate is just a signal. You make it external to your custom logic and map it to the IRQ_F2P in your processor system. That's it. In your processor system, the IRQ_F2P port should be identified in your MHS as an interrupt, of whatever polarity and whatever sensitivity. 

 

How you assert the interrupt based on your flags in your custom logic is up to you. I gave an example, it might not be what you want but it's an example.

 

Is this clear?

 

Regards,

 

Howard

 

----------
"That which we must learn to do, we learn by doing." - Aristotle

View solution in original post

0 Kudos
Highlighted
Anonymous
Not applicable
6,648 Views

Re: How to generate an interrupt in programmable logic ???

Jump to solution

In the AR that I mentioned (http://www.xilinx.com/support/answers/51138.htm) uses a axi custom IP in the pl to connect to the PS. There is also example test code for both the Microblaze and the ARM to test this.

 

In the test code, the interrupt is enabled, handler is registered, and the interrupt controller on the PS is configured to accept the interrupt on the rising edge.

 

I would recommend that you try folllow this AR as it seems to be answering the questions that you have

Highlighted
Explorer
Explorer
6,643 Views
Registered: ‎12-05-2012

Re: How to generate an interrupt in programmable logic ???

Jump to solution

Hello stephan,

 

Thanks for the link . it was quite helpful.

But now I am thinking of  connecting the flags to both the processor system and programmable logic.

Because I felt only an interrupt will not help.

 

with regards

Pruthvi

0 Kudos