Two FPGA processor interrupt modes

All beginners know that the interrupt mode of the processor is edge trigger and level trigger.

Edge triggering is rarely used, and falling edge triggering is the main method. When the device completes a data, it will output a falling edge to trigger the processor. The level trigger is to output a level, and will maintain this level, until the system processes or clears the interrupt before outputting another level.

Two FPGA processor interrupt modes

In FPGA, AXI bus or AVALON bus is often encountered, and the bus interface is often level triggered. If the fpga end is the master end. Need to design interrupt trigger state machine and clear interrupt operation.

always@(clk)

begin

if (rst)

...

else if(irq)

state <= irq_state;

else case (state)

....

end

There is no problem with the above code visually, but the problem is that irq is level triggered, the code will always be in if (irq) and will not enter the case statement, this will cause irq to be unable to clear all the time, and the code will always die in if (irq) in.

To solve the above methods, one is to get the irq edge trigger, if the high level is valid, it is the rising edge. If it is low, it is a falling edge.

So the code is

if (rst)

else if (irq_rising)

...

else case(state)

This state can also cause a problem, that is, if you enter the normal state and transition to this state, it will cause all the data to be messed up. Of course, it is better to use polling status opportunities. That is to say, use polling irq in the state machine to see if it is high.

case(state)

idle:

normal_irq_sw:

begin

if (normal_req)

. . .

else if (irq)

state <=irq——state

end

Onlyrelx Bar800

Onlyrelx bar800 disposable vape pen is portable and fashion disposable electronic cigarette, disposable ecigs pen are trending featured vape pen for vapors as it's safety and easy to use. Disposable vape pod,disposable vape, wholesale vape,vape wholesale,vape pen manufacturer and supplier.disposable vape pen,disposable electronic cigarette,disposable ecigs pen,disposable ecigs stick,disposable e-cigs pen,disposable vape factory,disposable vape pod,disposable vape device,vape pen,vape stick, vape wholesale,wholesale vape,customized dispsoable vape pen,customized vape pen,OEM&ODM disposable ecigs pen,disposable electronic cigarette wholesale, wholesale disposable electronic cigarette,distribute vape pen,vape pen distribute,high quality vape pen,high quality vape pod.

Onlyrelx Bar800,Vape Pen,Vape Pod,Onlyrelx Vape

Shenzhen Onlyrelx Technology Co.,Ltd , https://www.onlyrelxtech.com