cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
derickshi
Adventurer
Adventurer
1,003 Views
Registered: ‎11-25-2015

Enable both Ready and Done interrupts in HLS IP

Hello, 

 

I'm trying to figure out how to use the ready/done interrupts to control the HLS IP core. I noticed that there is only ONE 'interrupt ' signal as output from HLS IP. So we can program our IP core through AXI-Lite interface to use either 'ready' or 'done' at one time. Here is what I managed to do:

 

int main(){
    configure_everything_properly();
    start_my_ip();
    while(1);
    return 0;
}

void ap_done_interrupt_handler(){
    disable_interrupt();
    read_output();    
    set_ip_input_offset(); // update input data address
    set_ip_output_offset(); // update output data address
    start_my_ip();
    clear_interrupt();
    enable_interrupt();
}

 

If the HLS IP core is pipelined or DATAFLOW is applied, the initial interval will be less than the latency, which means that the IP core will be ready earlier than done. So I want to do something like this to keep the pipeline 'fully occupied':

 

int main(){
    configure_everything_properly();
    start_my_ip();
    while(1);
    return 0;
}

void ap_ready_interrupt_handler(){
    disable_interrupt();    
    set_ip_input_offset(); // update input data address
    start_my_ip();
    clear_interrupt();
    enable_interrupt();
}

void ap_done_interrupt_handler(){
    disable_interrupt();
    read_output();    
    set_ip_output_offset(); // update output data address
    clear_interrupt();
    enable_interrupt();
}

 I'm aware that I can change the mask between 1 and 2 when enabling interrupt to switch between ready and done interrupts. However, the pseudo code above needs these 2 interrupts enabled simultaneously. So my question is, how to enable ready and done interrupts simultaneously? Or, I'm thinking in a completely wrong way that it can be done with just one interrupt?

 

Many thanks,

 

Derick  

0 Kudos
1 Reply
crystal
Contributor
Contributor
599 Views
Registered: ‎02-24-2018

Dear derickshi,

There are two interrupts (for done and ready) for the generated HLS IP. You can enable them using X/*IP_Name*/_InterruptEnable(&ip, 3). For the dataflow part, ready will be raised earlier. 

Best Regards,

Crystal 

0 Kudos