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# 58744

2014.3 Vivado HLS - How to add latency for memory read and write in HLS?

Description

Is there any way to specify arbitrary memory read and write timing in HLS? 

By default, HLS expects read data to come back in one cycle after the address is supplied. 
 
Is there any way to make that two, three, or some arbitrary number of cycles?

Solution

You can use RESOURCE directive with latency option to add latency to memory read and write, for example:

#pragma HLS RESOURCE variable=memcore=RAM_2P_BRAM latency=[number]

Or

set_directive_resource -core RAM_2P_BRAM -latency 2 "array_RAM" mem

Where [number] = 2,3,4 etc and shows how many clock cycles are between the memory read/write address and output data.


For arrays on the top-level function interface, a latency greater than 1 allows Vivado HLS to model RAMs external to the FPGA.

For example, if the latency is set to 3, the design waits 3 clock cycles before reading data from the RAM data input port. 

 

For internal RAMs, the following rules apply:

  • If the latency is specified as 1 cycle more than the latency decided by Vivado HLS, Vivado HLS adds new output registers to the output of the operator.
     
  • If the latency is specified as 2 more than the latency decided by Vivado HLS, Vivado HLS adds registers to the output of the operation and to the input side of the operation.
     
  • If the latency is specified as 3 or more cycles than the latency decided by Vivado HLS, Vivado HLS adds registers to the output of the operation and to the input side of the operation.
    Vivado HLS automatically determines the location of any additional registers.

For more details, please refer to (UG902)

http://www.xilinx.com/support/documentation/sw_manuals/xilinx2014_4/ug902-vivado-high-level-synthesis.pdf

AR# 58744
Date Created 12/10/2013
Last Updated 03/23/2015
Status Active
Type General Article
Tools
  • Vivado Design Suite - 2013.4
  • Vivado Design Suite - 2014.1
  • Vivado Design Suite - 2014.2
  • More
  • Vivado Design Suite - 2014.3
  • Vivado Design Suite - 2014.4
  • Less