instruction
stringlengths
139
357k
response
stringlengths
36
4.54k
buggy_type
stringclasses
745 values
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1[1] : in0[0]; } ```
The wrong part of the code is: out = sel ? in1[1] : in0[0]; The right code snippet is: out = sel ? in1 : in0;
'OOB': Out-of-bounds array access
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1[1] : in0[0]; } ``` The wrong part of the code is: out = sel ? in1[1] : in0[0];
The right code snippet is: out = sel ? in1 : in0;
'OOB': Out-of-bounds array access
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1[1] : in0[0]; } ```
The wrong part of the code is: out = sel ? in1[1] : in0[0]; The high-level-synthesis bug type of the code is: 'OOB': Out-of-bounds array access
'OOB': Out-of-bounds array access
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1[1] : in0[0]; } ```
The wrong part of the code is: out = sel ? in1[1] : in0[0]; The high-level-synthesis bug type of the code is: 'OOB': Out-of-bounds array access The right code snippet is: out = sel ? in1 : in0;
'OOB': Out-of-bounds array access
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp; out = sel ? temp : in0; } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp; out = sel ? temp : in0; } The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'INIT': Read of uninitialized variable
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp; out = sel ? temp : in0; } ``` The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, b...
The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'INIT': Read of uninitialized variable
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp; out = sel ? temp : in0; } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp; out = sel ? temp : in0; } The high-level-synthesis bug type of the code is: 'INIT': Read of uninitialized variable
'INIT': Read of uninitialized variable
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp; out = sel ? temp : in0; } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp; out = sel ? temp : in0; } The high-level-synthesis bug type of the code is: 'INIT': Read of uninitialized variable The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out)...
'INIT': Read of uninitialized variable
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? (in1 << 3) : (in0 >> 2); } ```
The wrong part of the code is: out = sel ? (in1 << 3) : (in0 >> 2); The right code snippet is: out = sel ? in1 : in0;
'SHFT': Bit shift by an out-of-bounds amount
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? (in1 << 3) : (in0 >> 2); } ``` The wrong part of the code is: out = sel ? (in1 << 3) : (in0 >> 2);
The right code snippet is: out = sel ? in1 : in0;
'SHFT': Bit shift by an out-of-bounds amount
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? (in1 << 3) : (in0 >> 2); } ```
The wrong part of the code is: out = sel ? (in1 << 3) : (in0 >> 2); The high-level-synthesis bug type of the code is: 'SHFT': Bit shift by an out-of-bounds amount
'SHFT': Bit shift by an out-of-bounds amount
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? (in1 << 3) : (in0 >> 2); } ```
The wrong part of the code is: out = sel ? (in1 << 3) : (in0 >> 2); The high-level-synthesis bug type of the code is: 'SHFT': Bit shift by an out-of-bounds amount The right code snippet is: out = sel ? in1 : in0;
'SHFT': Bit shift by an out-of-bounds amount
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { while(sel) { out = in1; } out = in0; } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { while(sel) { out = in1; } out = in0; } The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'INF': An infinite loop arising from an incorrect loop termination
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { while(sel) { out = in1; } out = in0; } ``` The wrong part of the code is: void mux_2to1(bool in0, bool in1, boo...
The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'INF': An infinite loop arising from an incorrect loop termination
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { while(sel) { out = in1; } out = in0; } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { while(sel) { out = in1; } out = in0; } The high-level-synthesis bug type of the code is: 'INF': An infinite loop arising from an incorrect loop termination
'INF': An infinite loop arising from an incorrect loop termination
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { while(sel) { out = in1; } out = in0; } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { while(sel) { out = in1; } out = in0; } The high-level-synthesis bug type of the code is: 'INF': An infinite loop arising from an incorrect loop termination The right code snippet is: void mux_2to1(bool...
'INF': An infinite loop arising from an incorrect loop termination
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? (signed)in1 : (signed)in0; } ```
The wrong part of the code is: out = sel ? (signed)in1 : (signed)in0; The right code snippet is: out = sel ? in1 : in0;
'USE': Unintended sign extension
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? (signed)in1 : (signed)in0; } ``` The wrong part of the code is: out = sel ? (signed)in1 : (signed)in0;
The right code snippet is: out = sel ? in1 : in0;
'USE': Unintended sign extension
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? (signed)in1 : (signed)in0; } ```
The wrong part of the code is: out = sel ? (signed)in1 : (signed)in0; The high-level-synthesis bug type of the code is: 'USE': Unintended sign extension
'USE': Unintended sign extension
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? (signed)in1 : (signed)in0; } ```
The wrong part of the code is: out = sel ? (signed)in1 : (signed)in0; The high-level-synthesis bug type of the code is: 'USE': Unintended sign extension The right code snippet is: out = sel ? in1 : in0;
'USE': Unintended sign extension
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { #pragma HLS unroll factor(2) for(int i = 0; i < 2; i++) { out = sel ? in1 : in0; } } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { #pragma HLS unroll factor(2) for(int i = 0; i < 2; i++) { out = sel ? in1 : in0; } } The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'MLU': Errors in manual loop unrolling
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { #pragma HLS unroll factor(2) for(int i = 0; i < 2; i++) { out = sel ? in1 : in0; } } ``` The wrong part of the code...
The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'MLU': Errors in manual loop unrolling
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { #pragma HLS unroll factor(2) for(int i = 0; i < 2; i++) { out = sel ? in1 : in0; } } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { #pragma HLS unroll factor(2) for(int i = 0; i < 2; i++) { out = sel ? in1 : in0; } } The high-level-synthesis bug type of the code is: 'MLU': Errors in manual loop unrolling
'MLU': Errors in manual loop unrolling
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { #pragma HLS unroll factor(2) for(int i = 0; i < 2; i++) { out = sel ...
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { #pragma HLS unroll factor(2) for(int i = 0; i < 2; i++) { out = sel ? in1 : in0; } } The high-level-synthesis bug type of the code is: 'MLU': Errors in manual loop unrolling The right code snippet is: ...
'MLU': Errors in manual loop unrolling
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp = 0; out = sel ? in1 : temp; } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp = 0; out = sel ? in1 : temp; } The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'ZERO': Variable initialized to zero instead of nonzero initializer
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp = 0; out = sel ? in1 : temp; } ``` The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool se...
The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'ZERO': Variable initialized to zero instead of nonzero initializer
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp = 0; out = sel ? in1 : temp; } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp = 0; out = sel ? in1 : temp; } The high-level-synthesis bug type of the code is: 'ZERO': Variable initialized to zero instead of nonzero initializer
'ZERO': Variable initialized to zero instead of nonzero initializer
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp = 0; out = sel ? in1 : temp; } ```
The wrong part of the code is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { bool temp = 0; out = sel ? in1 : temp; } The high-level-synthesis bug type of the code is: 'ZERO': Variable initialized to zero instead of nonzero initializer The right code snippet is: void mux_2to1(bool in...
'ZERO': Variable initialized to zero instead of nonzero initializer
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0[2], bool in1[2], bool sel, bool& out) { out = sel ? in1[0] : in0[1]; } ```
The wrong part of the code is: void mux_2to1(bool in0[2], bool in1[2], bool sel, bool& out) { out = sel ? in1[0] : in0[1]; } The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'BUF': Copying from the wrong half of a split buffer
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void mux_2to1(bool in0[2], bool in1[2], bool sel, bool& out) { out = sel ? in1[0] : in0[1]; } ``` The wrong part of the code is: void mux_2to1(bool in0[2], bool in1[2], bool se...
The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'BUF': Copying from the wrong half of a split buffer
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` void mux_2to1(bool in0[2], bool in1[2], bool sel, bool& out) { out = sel ? in1[0] : in0[1]; } ```
The wrong part of the code is: void mux_2to1(bool in0[2], bool in1[2], bool sel, bool& out) { out = sel ? in1[0] : in0[1]; } The high-level-synthesis bug type of the code is: 'BUF': Copying from the wrong half of a split buffer
'BUF': Copying from the wrong half of a split buffer
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` void mux_2to1(bool in0[2], bool in1[2], bool sel, bool& out) { out = sel ? in1[0] : in0[1]; } ```
The wrong part of the code is: void mux_2to1(bool in0[2], bool in1[2], bool sel, bool& out) { out = sel ? in1[0] : in0[1]; } The high-level-synthesis bug type of the code is: 'BUF': Copying from the wrong half of a split buffer The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel...
'BUF': Copying from the wrong half of a split buffer
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #pragma HLS array_partition variable=in1 cyclic factor=2 dim=1 void mux_2to1(bool in0, bool in1[2], bool sel, bool& out) { out = sel ? in1[1] : in0; } ```
The wrong part of the code is: #pragma HLS array_partition variable=in1 cyclic factor=2 dim=1 void mux_2to1(bool in0, bool in1[2], bool sel, bool& out) { out = sel ? in1[1] : in0; } The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'APT': Array partition type error for the pragma '#pragma HLS array_partition'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #pragma HLS array_partition variable=in1 cyclic factor=2 dim=1 void mux_2to1(bool in0, bool in1[2], bool sel, bool& out) { out = sel ? in1[1] : in0; } ``` The wrong part of the cod...
The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'APT': Array partition type error for the pragma '#pragma HLS array_partition'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #pragma HLS array_partition variable=in1 cyclic factor=2 dim=1 void mux_2to1(bool in0, bool in1[2], bool sel, bool& out) { out = sel ? in1[1] : in0; } ```
The wrong part of the code is: #pragma HLS array_partition variable=in1 cyclic factor=2 dim=1 void mux_2to1(bool in0, bool in1[2], bool sel, bool& out) { out = sel ? in1[1] : in0; } The high-level-synthesis bug type of the code is: 'APT': Array partition type error for the pragma '#pragma HLS array_parti...
'APT': Array partition type error for the pragma '#pragma HLS array_partition'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #pragma HLS array_partition variable=in1 cyclic factor=2 dim=1 void mux_2to1(bool in0, bool in1[2], bool sel, bool& out) { out = se...
The wrong part of the code is: #pragma HLS array_partition variable=in1 cyclic factor=2 dim=1 void mux_2to1(bool in0, bool in1[2], bool sel, bool& out) { out = sel ? in1[1] : in0; } The high-level-synthesis bug type of the code is: 'APT': Array partition type error for the pragma '#pragma HLS array_parti...
'APT': Array partition type error for the pragma '#pragma HLS array_partition'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #pragma HLS array_partition variable=in1 cyclic factor=3 dim=1 void mux_2to1(bool in0, bool in1[3], bool sel, bool& out) { out = sel ? in1[2] : in0; } ```
The wrong part of the code is: #pragma HLS array_partition variable=in1 cyclic factor=3 dim=1 void mux_2to1(bool in0, bool in1[3], bool sel, bool& out) { out = sel ? in1[2] : in0; } The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'FND': Factor not divisible for the pragma '#pragma HLS array_partition'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #pragma HLS array_partition variable=in1 cyclic factor=3 dim=1 void mux_2to1(bool in0, bool in1[3], bool sel, bool& out) { out = sel ? in1[2] : in0; } ``` The wrong part of the cod...
The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'FND': Factor not divisible for the pragma '#pragma HLS array_partition'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #pragma HLS array_partition variable=in1 cyclic factor=3 dim=1 void mux_2to1(bool in0, bool in1[3], bool sel, bool& out) { out = sel ? in1[2] : in0; } ```
The wrong part of the code is: #pragma HLS array_partition variable=in1 cyclic factor=3 dim=1 void mux_2to1(bool in0, bool in1[3], bool sel, bool& out) { out = sel ? in1[2] : in0; } The high-level-synthesis bug type of the code is: 'FND': Factor not divisible for the pragma '#pragma HLS array_partition'
'FND': Factor not divisible for the pragma '#pragma HLS array_partition'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #pragma HLS array_partition variable=in1 cyclic factor=3 dim=1 void mux_2to1(bool in0, bool in1[3], bool sel, bool& out) { out = se...
The wrong part of the code is: #pragma HLS array_partition variable=in1 cyclic factor=3 dim=1 void mux_2to1(bool in0, bool in1[3], bool sel, bool& out) { out = sel ? in1[2] : in0; } The high-level-synthesis bug type of the code is: 'FND': Factor not divisible for the pragma '#pragma HLS array_partition' ...
'FND': Factor not divisible for the pragma '#pragma HLS array_partition'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #pragma HLS array_partition variable=in1 ```
The wrong part of the code is: #pragma HLS array_partition variable=in1 The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'DID': Dim incorrect dimension for the pragma '#pragma HLS array_partition'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #pragma HLS array_partition variable=in1 ``` The wrong part of the code is: #pragma HLS array_partition variable=in1
The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1 : in0; }
'DID': Dim incorrect dimension for the pragma '#pragma HLS array_partition'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #pragma HLS array_partition variable=in1 ```
The wrong part of the code is: #pragma HLS array_partition variable=in1 The high-level-synthesis bug type of the code is: 'DID': Dim incorrect dimension for the pragma '#pragma HLS array_partition'
'DID': Dim incorrect dimension for the pragma '#pragma HLS array_partition'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #pragma HLS array_partition variable=in1 ```
The wrong part of the code is: #pragma HLS array_partition variable=in1 The high-level-synthesis bug type of the code is: 'DID': Dim incorrect dimension for the pragma '#pragma HLS array_partition' The right code snippet is: void mux_2to1(bool in0, bool in1, bool sel, bool& out) { out = sel ? in1...
'DID': Dim incorrect dimension for the pragma '#pragma HLS array_partition'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C; sum = C + B; } ``` Note: The `ap_uint` data type from the Vivado HLS libr...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C; sum = C + B; } The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
INIT
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C; sum = C + B; } ``` Note: The `ap_uint` data type from the Vivado HLS library i...
The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
INIT
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C; sum = C + B; } ``` Note: The `ap_uint` data type from the Viva...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C; sum = C + B; } The high-level-synthesis bug type of the code is: INIT
INIT
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C; sum = C + B; } ``` Note: ...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C; sum = C + B; } The high-level-synthesis bug type of the code is: INIT The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
INIT
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A[9] + B; } ``` Note: The `ap_uint` data type from the Vivado HLS library is used to ...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A[9] + B; } The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
OOB
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A[9] + B; } ``` Note: The `ap_uint` data type from the Vivado HLS library is used to repre...
The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
OOB
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A[9] + B; } ``` Note: The `ap_uint` data type from the Vivado HLS library ...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A[9] + B; } The high-level-synthesis bug type of the code is: OOB
OOB
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A[9] + B; } ``` Note: The `ap_uint` d...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A[9] + B; } The high-level-synthesis bug type of the code is: OOB The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
OOB
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A << 10 + B; } ``` Note: The `ap_uint` data type from the Vivado HLS library is used ...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A << 10 + B; } The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
SHFT
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A << 10 + B; } ``` Note: The `ap_uint` data type from the Vivado HLS library is used to re...
The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
SHFT
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A << 10 + B; } ``` Note: The `ap_uint` data type from the Vivado HLS libra...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A << 10 + B; } The high-level-synthesis bug type of the code is: SHFT
SHFT
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A << 10 + B; } ``` Note: The `ap_uint...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A << 10 + B; } The high-level-synthesis bug type of the code is: SHFT The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
SHFT
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i>=0; i++){ sum = A + B; } } ``` Note: The `ap_uint` data type fro...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i>=0; i++){ sum = A + B; } } The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
INF
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i>=0; i++){ sum = A + B; } } ``` Note: The `ap_uint` data type from the...
The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
INF
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i>=0; i++){ sum = A + B; } } ``` Note: The `ap_uint` da...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i>=0; i++){ sum = A + B; } } The high-level-synthesis bug type of the code is: INF
INF
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i>=0; i++){ sum = A + B...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i>=0; i++){ sum = A + B; } } The high-level-synthesis bug type of the code is: INF The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ...
INF
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_int<8> C = -1; sum = A + B + C; } ``` Note: The `ap_uint` data type from the Vivado ...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_int<8> C = -1; sum = A + B + C; } The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
USE
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_int<8> C = -1; sum = A + B + C; } ``` Note: The `ap_uint` data type from the Vivado HLS l...
The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
USE
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_int<8> C = -1; sum = A + B + C; } ``` Note: The `ap_uint` data type from ...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_int<8> C = -1; sum = A + B + C; } The high-level-synthesis bug type of the code is: USE
USE
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_int<8> C = -1; sum = A + B + C; } ```...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_int<8> C = -1; sum = A + B + C; } The high-level-synthesis bug type of the code is: USE The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B;...
USE
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C = 0; sum = C + A + B; } ``` Note: The `ap_uint` data type from the Vivado ...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C = 0; sum = C + A + B; } The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
ZERO
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C = 0; sum = C + A + B; } ``` Note: The `ap_uint` data type from the Vivado HLS l...
The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
ZERO
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C = 0; sum = C + A + B; } ``` Note: The `ap_uint` data type from ...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C = 0; sum = C + A + B; } The high-level-synthesis bug type of the code is: ZERO
ZERO
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C = 0; sum = C + A + B; } ```...
The wrong part of the code is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { ap_uint<8> C = 0; sum = C + A + B; } The high-level-synthesis bug type of the code is: ZERO The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B...
ZERO
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<16> A, ap_uint<16> B, ap_uint<8> &sum) { sum = A.range(15,8) + B.range(15,8); } ``` Note: The `ap_uint` data type from the Vivado ...
The wrong part of the code is: void adder_8bit(ap_uint<16> A, ap_uint<16> B, ap_uint<8> &sum) { sum = A.range(15,8) + B.range(15,8); } The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
BUF
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<16> A, ap_uint<16> B, ap_uint<8> &sum) { sum = A.range(15,8) + B.range(15,8); } ``` Note: The `ap_uint` data type from the Vivado HLS l...
The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
BUF
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<16> A, ap_uint<16> B, ap_uint<8> &sum) { sum = A.range(15,8) + B.range(15,8); } ``` Note: The `ap_uint` data type from ...
The wrong part of the code is: void adder_8bit(ap_uint<16> A, ap_uint<16> B, ap_uint<8> &sum) { sum = A.range(15,8) + B.range(15,8); } The high-level-synthesis bug type of the code is: BUF
BUF
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> void adder_8bit(ap_uint<16> A, ap_uint<16> B, ap_uint<8> &sum) { sum = A.range(15,8) + B.range(15,8); } ```...
The wrong part of the code is: void adder_8bit(ap_uint<16> A, ap_uint<16> B, ap_uint<8> &sum) { sum = A.range(15,8) + B.range(15,8); } The high-level-synthesis bug type of the code is: BUF The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B;...
BUF
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<3; i++){ su...
The wrong part of the code is: #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<3; i++){ sum[i] = A[i] + B[i]; } } The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &su...
APT
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <ap_int.h> #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<3; i++){ sum[i] ...
The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
APT
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <ap_int.h> #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<3; i++){...
The wrong part of the code is: #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<3; i++){ sum[i] = A[i] + B[i]; } } The high-level-synthesis bug type of the code is: APT
APT
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8...
The wrong part of the code is: #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<3; i++){ sum[i] = A[i] + B[i]; } } The high-level-synthesis bug type of the code is: APT The right code snippet is: ...
APT
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<2; i++){ su...
The wrong part of the code is: #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<2; i++){ sum[i] = A[i] + B[i]; } } The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &su...
FND
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <ap_int.h> #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<2; i++){ sum[i] ...
The right code snippet is: void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { sum = A + B; }
FND
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <ap_int.h> #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<2; i++){...
The wrong part of the code is: #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<2; i++){ sum[i] = A[i] + B[i]; } } The high-level-synthesis bug type of the code is: FND
FND
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <ap_int.h> #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8...
The wrong part of the code is: #pragma HLS array_partition variable=sum cyclic factor=3 void adder_8bit(ap_uint<8> A, ap_uint<8> B, ap_uint<8> &sum) { for(int i=0; i<2; i++){ sum[i] = A[i] + B[i]; } } The high-level-synthesis bug type of the code is: FND The right code snippet is: ...
FND
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && ...
The wrong part of the code is: if (a <= b && a <= c && a <= d) min = a; else if (b <= a && b <= c && b <= d) min = b; else if (c <= a && c <= b && c <= d) min = c; else min = d + 1; The right code snippet is: if (a <= b && a <= c && a <= d) min = a; else if (b <= a && b <= c && b <=...
'OOB'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && a <= ...
The right code snippet is: if (a <= b && a <= c && a <= d) min = a; else if (b <= a && b <= c && b <= d) min = b; else if (c <= a && c <= b && c <= d) min = c; else min = d;
'OOB'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b &&...
The wrong part of the code is: if (a <= b && a <= c && a <= d) min = a; else if (b <= a && b <= c && b <= d) min = b; else if (c <= a && c <= b && c <= d) min = c; else min = d + 1; The high-level-synthesis bug type of the code is: 'OOB'
'OOB'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c,...
The wrong part of the code is: if (a <= b && a <= c && a <= d) min = a; else if (b <= a && b <= c && b <= d) min = b; else if (c <= a && c <= b && c <= d) min = c; else min = d + 1; The high-level-synthesis bug type of the code is: 'OOB' The right code snippet is: if (a <= b && a <=...
'OOB'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && ...
The wrong part of the code is: static int counter; The right code snippet is: static int counter = 0;
'INIT'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && a <= ...
The right code snippet is: static int counter = 0;
'INIT'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b &&...
The wrong part of the code is: static int counter; The high-level-synthesis bug type of the code is: 'INIT'
'INIT'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c,...
The wrong part of the code is: static int counter; The high-level-synthesis bug type of the code is: 'INIT' The right code snippet is: static int counter = 0;
'INIT'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && ...
The wrong part of the code is: q = counter_out - (min_value_out << 32); The right code snippet is: q = counter_out - (min_value_out & 0xF); // Extract the lower 4 bits
'SHFT'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && a <= ...
The right code snippet is: q = counter_out - (min_value_out & 0xF); // Extract the lower 4 bits
'SHFT'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b &&...
The wrong part of the code is: q = counter_out - (min_value_out << 32); The high-level-synthesis bug type of the code is: 'SHFT'
'SHFT'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c,...
The wrong part of the code is: q = counter_out - (min_value_out << 32); The high-level-synthesis bug type of the code is: 'SHFT' The right code snippet is: q = counter_out - (min_value_out & 0xF); // Extract the lower 4 bits
'SHFT'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && ...
The wrong part of the code is: while (true) { counter++; } The right code snippet is: if (reset) counter = 0; else if (clk) counter++;
'INF'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && a <= ...
The right code snippet is: if (reset) counter = 0; else if (clk) counter++;
'INF'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b &&...
The wrong part of the code is: while (true) { counter++; } The high-level-synthesis bug type of the code is: 'INF'
'INF'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c,...
The wrong part of the code is: while (true) { counter++; } The high-level-synthesis bug type of the code is: 'INF' The right code snippet is: if (reset) counter = 0; else if (clk) counter++;
'INF'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && ...
The wrong part of the code is: void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && a <= d) min = a; else if (b <= a && b <= c && b <= d) min = b; else if (c <= a && c <= b && c <= d) min = c; else min = (unsigned int)d; } The right ...
'USE'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && a <= ...
The right code snippet is: void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && a <= d) min = a; else if (b <= a && b <= c && b <= d) min = b; else if (c <= a && c <= b && c <= d) min = c; else min = d; }
'USE'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c, int d, int &min) { if (a <= b &&...
The wrong part of the code is: void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && a <= d) min = a; else if (b <= a && b <= c && b <= d) min = b; else if (c <= a && c <= b && c <= d) min = c; else min = (unsigned int)d; } The high-l...
'USE'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: #pragma HLS INTERFACE ap_none port=a,b,c,d,clk,reset #pragma HLS INTERFACE ap_ctrl_none port=return void min_value(int a, int b, int c,...
The wrong part of the code is: void min_value(int a, int b, int c, int d, int &min) { if (a <= b && a <= c && a <= d) min = a; else if (b <= a && b <= c && b <= d) min = b; else if (c <= a && c <= b && c <= d) min = c; else min = (unsigned int)d; } The high-l...
'USE'