12-18-2019 04:57 AM
I am trying to design a HLS Fifo IP which records the number of times the IP has been called. I tried using a static variable which needs to start at 0 and increment by 1 each time it gets called or each time a new fifo of 2048 is generated. I used the following code but the variable gets reset to 0 each time the function is called when checking on the Simulation in HLS:
void generate_fifo(unsigned char d_out[2048]){
#pragma HLS INTERFACE ap_fifo port=d_out bundle=CRTL_BUS
#pragma HLS INTERFACE s_axilite port=return bundle=CRTL_BUS
static unsigned char counter=0;
//#pragma HLS RESET variable=counter off
for (int i=0;i<2048;i++){
d_out=...;
}
counter++;
I tried with the reset pragma set to off still doesn't work out. Is there anything I am missing? How can I implement this logic in HLS ?
12-18-2019 05:01 AM
12-22-2019 01:44 AM
@nithink nope the variable is zero at each call. It keeps getting reset.
12-22-2019 02:38 AM
@jothiadityan so you need to first fix the behaviour at c simulation. I guess gcc would give the same behaviour. You should review your code once
Thanks,
Nithin