Jump to content
  • 0

Custom IP interrupt


HasanWAVE

Question

Hi,
So I created a custom IP which just reads the data_read from the FIFO buffer. I would like to generate an interrupt when the FIFO buffer exceeds a certain amount. I have enabled the interrupt when making my custom IP. There is an example in the INTR.v file which generates an interrupt after a certain time. I would like to generate an interrupt as soon as the data_read exceeds. I understand I will have to set the intr register. How do I use the intr register from the top module ? 

This is what I have done, its obviously wrong.


// Users to add ports here

input wire clk,

        input wire [31:0]ReadData,

// User ports ends

// Do not modify the ports beyond this line

,...

...

...

 

// Instantiation of Axi Bus Interface S_AXI_INTR

myip_v1_0_S_AXI_INTR # (

.C_S_AXI_DATA_WIDTH(C_S_AXI_INTR_DATA_WIDTH),

...

.S_AXI_RREADY(s_axi_intr_rready),

.intr(),

.irq(irq)

);

 

// Add user logic here

always @ ( posedge clk )                                          

        begin                                                                    

            if ( s_axi_intr_aresetn == 1'b0)                                          

              begin                                                              

                assign myip_v1_0_S_AXI_INTR_inst.intr = {C_NUM_OF_INTR{1'b0}};                                  

              end                                                                

            else                                                                

              begin                                                              

                if (ReadData >= 1024)                                    

                  begin                                                          

                    assign myip_v1_0_S_AXI_INTR_inst.intr = {C_NUM_OF_INTR{1'b1}};                              

                  end                                                            

                else                                                            

                  begin                                                          

                    assign myip_v1_0_S_AXI_INTR_inst.intr = {C_NUM_OF_INTR{1'b0}};                              

                  end                                                            

              end                                                                

        end    

// User logic ends

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...