Application Acceleration With FPGAs
Programmable Acceleration Cards (PACs), DCP, DLA, Software Stack, and Reference Designs
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
422 Discussions

Double Buffering on Intel FPGA?

RJin1
Beginner
1,141 Views

Hi all,

I read the paper "Best-Effort FPGA Programming: A Few Steps Can Go a Long Way". They used HLS on Xilinx devices as example. Besides the normal optimization, I found the double buffering is interesting:

void aes(...) { ... }

void load(...) { ... }

void store(...) { ... }

void compute(...) { ... }

void kernel(char *data, int size) {

char buf_data[3][PE_NUM][PE_BATCH];

 

#pragma HLS array_partition var=buf_data complete dim=1

#pragma HLS array_partition var=buf_data cyclic=PE_NUM dim=2

 

for (int i=0; i < size/BATCH_SIZE; i++) {

switch (i % 3) {

case 0:

load(buf_data[0], data+i*BATCH_SIZE);

compute(buf_data[1]);

store(data+i*BATCH_SIZE, buf_data[2]);

break;

case 1:

load(buf_data[1], data+i*BATCH_SIZE);

compute(buf_data[2]);

store(data+i*BATCH_SIZE, buf_data[0]);

break;

case 2:

load(buf_data[2], data+i*BATCH_SIZE);

compute(buf_data[0]);

store(data+i*BATCH_SIZE, buf_data[1]);

break;

}

}

}

Can the Intel compiler successfully imply this pipeline? I tried this on compiler version 16 but it seems that the throughput improvement is very limited.

0 Kudos
1 Reply
MuhammadAr_U_Intel
302 Views
Hi, There is continuous improvements on HLS software with every release. I would suggest using the latest version of HLS compiler 18.1 to see what optimization/ pipelining are done by software. Thanks, Arslan
Reply