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!

AR# 60236

Vivado HLS 2014.2: How do I add or remove Reset for global or static variables?

Description

How do I add or remove Reset for global or static variables in Vivado HLS?

For example, I have a static variable defined as below:
 

static int a = 2;


How can I ensure that the required logic for reset is generated for variable "a"?

Solution

There are a number of options available:

1. Place the pragma in the C source within the boundaries of the variables life cycle.
 

#pragma HLS reset variable=a 

If you want to turn off generation of reset for the specific variable, off can be used with the pragma as below:
 

#pragma HLS reset variable=a off


2. Use set_directive_reset [OPTIONS] <location> <variable> in directives file.
 
Options:
 

<location> <string>

The location (in the format function[/label]) at which the variable is defined.
 

<variable> <string>

The variable to which the directive is applied.
 

<variable> <string> -off

If -off is specified, reset is not generated for the specified variable.
 
If -off is not specified, reset is generated for the specified variable.
 
For example:
set_directive_reset foo a
set_directive_reset -off foo a
 
3. Globally, you can control this using:
 

config_rtl -reset (none|control|state|all) -reset_level (low|high) -reset_async

The setting applied with the -reset option determines how registers and memories are reset:
 
Options:
 

none

No reset is added to the design.
 

control (default)

Resets control registers, such as those used in state machines and those used to generate I/O protocol signals.
 

state

Resets control registers and registers or memories derived from static or global variables in the C code.
Any static or global variable initialized in the C code is reset to its initialized value.
 

all

Resets all registers and memories in the design.
Any static or global variable initialized in the C code is reset to its initialized value.
 

-reset_async

Causes all registers to use a asynchronous reset.
If this option is not specified, a synchronous reset is used.
 

-reset_level (low|high)

Allows the polarity of the reset signal to be either active-Low or active-High.
AR# 60236
Date Created 04/10/2014
Last Updated 12/19/2014
Status Active
Type General Article
Tools
  • Vivado Design Suite - 2013.4
  • Vivado Design Suite