Ted N. Booth
DesignLinx Hardware Solutions
September 2015
Ted N. Booth DesignLinx Hardware Solutions September 2015 Using - - PowerPoint PPT Presentation
Ted N. Booth DesignLinx Hardware Solutions September 2015 Using Vivado HLS for Video Algorithm Implementation for Demonstration and Validation Agenda Project Description HLS Lessons Learned Summary Project Description Create a
DesignLinx Hardware Solutions
September 2015
Real-Time (II = 1)
(3 elements/clock cycle)
Minimum Resources (II = 3)
(3 elements/3 clock cycles)
ROW_LOOP : for (row = 0; row < rows; row++) { COL_LOOP : for (col = 0; col < cols; col++) { #pragma HLS PIPELINE II=? // 1 or 3 RGB_LOOP : for (rgb = 0; rgb < 3; rgb++) {
#define MAX_WIDTH 1920 #define MAX_HEIGHT 1080 Void my_image(…, int Rows, int Cols) { … }
#define MAX_WIDTH 1920 #define MAX_HEIGHT 1080 Void my_image(…, int Rows, int Cols) { … assert(Rows<=MAX_HEIGHT); assert(Cols<=MAX_WIDTH); ROW_LOOP: for(j=0; j<Rows; j++) { COL_LOOP: for(i=0; i<Cols; i++) { … } } }
void my_filter(hls::stream<ap_axiu<16,1,1,1> >& In, hls::stream<ap_axiu<16,1,1,1> >& Out, int Rows, int Cols) { // Specify AXI4-Stream connections #pragma HLS INTERFACE axis port=In bundle=INPUT_STREAM #pragma HLS INTERFACE axis port=Out bundle=OUTPUT_STREAM // Group all other ports into an AXI4-Lite interface #pragma HLS INTERFACE s_axilite register port=Rows bundle=Ctrl #pragma HLS INTERFACE s_axilite register port=Cols bundle=Ctrl #pragma HLS INTERFACE s_axilite port=return bundle=Ctrl … }
void my_int_mult (int in1, int in2, int &out) {
} void my_ap_mult (ap_int<10> in1, ap_int<10> in2, ap_int<20> &out) {
}
void int_sum (int in1, int in2, int in3, int in4, int &out) { int temp1,temp2; temp1 = in1 + in2; temp2 = in3 + in4;
} void ap_sum (ap_int<8> in1, ap_int<9> in2, ap_int<10> in3, ap_int<11> in4, ap_int<13> &out) { int temp1, temp2; temp1 = in1 + in2; temp2 = in3 + in4;
}
void my_code1 (…, ap_uint<9> &out) { …
MY_LOOP1 : for(i=0; i<127; i++) { #pragma HLS PIPELINE II=2 sum = my_array[i] + my_array[i+1]; if (sum > thresh) { out++; } } … void my_code2 (…, ap_uint<9> &out) { … ap_uint<9> cnt = 0; MY_LOOP2 : for(i=0; i<127; i++) { #pragma HLS PIPELINE II=2 sum = my_array[i] + my_array[i+1]; if (sum > thresh) { cnt++; } }
…
transceivers, and more
DesignLinx Hardware Solutions tbooth@designlinxhs.com