UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Voyager
Voyager
112 Views
Registered: ‎08-16-2018

Can I reset static variables in HLS?

Jump to solution

Let's say I have some HLS block that reads from an AXI stream and processes a number of consecutive data to produce a result.

I have a counter implemented as 

int  static  i = 0;

So when it reaches some value, the result is written to the output and reset to 0.

But, is there any way reset it from the outside?

0 Kudos
1 Solution

Accepted Solutions
Participant evant_nq
Participant
102 Views
Registered: ‎07-18-2018

Re: Can I reset static variables in HLS?

Jump to solution

Hi johnvivm

 

Add the following Pragma:

static int counter;
#pragma HLS RESET variable=counter

It will let the tool know that you want the variable to be reset when the ap_rst is assrted. otherwise ap_rst simply puts it in the original start state.

0 Kudos
1 Reply
Participant evant_nq
Participant
103 Views
Registered: ‎07-18-2018

Re: Can I reset static variables in HLS?

Jump to solution

Hi johnvivm

 

Add the following Pragma:

static int counter;
#pragma HLS RESET variable=counter

It will let the tool know that you want the variable to be reset when the ap_rst is assrted. otherwise ap_rst simply puts it in the original start state.

0 Kudos