Visible to Intel only — GUID: xfy1508937381235
Ixiasoft
Visible to Intel only — GUID: xfy1508937381235
Ixiasoft
7.3.2. Example: Merging Memories Width-Wise
Use the hls_merge("<mem_name>","width") attribute to force the Intel® HLS Compiler Pro Edition to implement variables in the same memory system, merging their memories by width.
All variables with the same <mem_name> label set in their hls_merge attributes are merged.
Consider the following component code:
component short width_manual (int raddr, int waddr, short wdata) {
short a[256];
short b[256];
short rdata = 0;
// Lock step write
a[waddr] = wdata;
b[waddr] = wdata;
// Lock step read
rdata += a[raddr];
rdata += b[raddr];
return rdata;
}
In this case, the Intel® HLS Compiler Pro Edition can coalesce the load and store instructions to local memories a and b because their accesses are to the same address, as shown below.
component short width_manual (int raddr, int waddr, short wdata) {
short a[256] hls_merge("mem","width");
short b[256] hls_merge("mem","width");
short rdata = 0;
// Lock step write
a[waddr] = wdata;
b[waddr] = wdata;
// Lock step read
rdata += a[raddr];
rdata += b[raddr];
return rdata;
}