加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

HLS Optimization: Local Memory Bandwidth

发布时间:2020-12-14 04:45:23 所属栏目:大数据 来源:网络整理
导读:Array Partition #pragma HLS array_partition variable=variable block,cyclic,complete factor=int dim=int Array Reshape #pragma HLS array_reshape variable=variable block,complete factor=int dim=int Example 1 Reshapes (partition and maps) an 8

Array Partition

#pragma HLS array_partition variable=<variable> <block,cyclic,complete> factor=<int> dim=<int>

Array Reshape

#pragma HLS array_reshape variable=<variable> <block,complete> factor=<int> dim=<int>

Example 1

Reshapes (partition and maps) an 8-bit array with 17 elements,AB[17],into a new 32-bit array with five elements using block mapping.

#pragma HLS array_reshape variable=AB block factor=4

TIP: factor=4 indicates that the array should be divided into four. So 17 elements is reshaped into an array of 5 elements,with four times the bit-width. In this case,the last element,is mapped to the lower eight bits of the fifth element,and the rest of the fifth element is empty.

Example 2

Reshapes the two-dimensional array AB[6][4] into a new array of dimension [6][2],in which dimension 2 has twice the bit-width:

#pragma HLS array_reshape variable=AB block factor=2 dim=2

Example 3

Reshapes the three-dimensional 8-bit array,AB[4][2][2] in function foo,into a new single element array (a register),128 bits wide (4*2*2*8):

#pragma HLS array_reshape variable=AB complete dim=0

TIP: dim=0 means to reshape all dimensions of the array.

?Reference:

1. https://www.xilinx.com/support/documentation/sw_manuals/xilinx2015_2/sdsoc_doc/topics/calling-coding-guidelines/concept_increasing_local_memory_bandwidth.html

2. https://japan.xilinx.com/html_docs/xilinx2017_4/sdaccel_doc/mrl1504034361747.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读