cornell-zhang/heterocl

Support moving data to on-chip memory storage

Closed this issue · 0 comments

HCL has the support of data movement to any memory space that is shared between host and accelerator, i.e. DRAM and HBM. Aside from that, we should also provide the options to move data to a specific on-chip memory space. e.g. BRAM , LUTRAM (distributed RAM), URAM, or register files.

Currently, we only support creating on-chip buffer for the input argument -- the on-chip buffer is created to fetch the data from off-chip memory in the burst mode. This burst buffer is only accessible from the FPGA side and is by default implemented using BRAM.

I am considering using a new API s.bind() to bind certain variables or tensors to specific memory space, like what has been done in Vivaod HLS pragma syntax. Or we can just reuse the .to() primitive.

// python interface 
s.bind(temp, hcl.FPGA.BRAM, port=2)

// generated HLS code
int temp;
#pragma HLS RESOURCE variable=temp core=RAM_2P_BRAM