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: ```c++ #include <ap_int.h> void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { ap_int<5> temp_sum; temp_sum = a + b + cin; sum ...
The wrong part of the code is: temp_sum = a + b + cin; sum = temp_sum.range(3, -1); cout = temp_sum[5]; The right code snippet is: temp_sum = a + b + cin; sum = temp_sum.range(3, 0); cout = temp_sum[4];
SHFT
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ```c++ #include <ap_int.h> void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { ap_int<5> temp_sum; temp_sum = a + b + cin; sum = tem...
The right code snippet is: temp_sum = a + b + cin; sum = temp_sum.range(3, 0); cout = temp_sum[4];
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: ```c++ #include <ap_int.h> void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { ap_int<5> temp_sum; temp_sum = a + b + ci...
The wrong part of the code is: temp_sum = a + b + cin; sum = temp_sum.range(3, -1); cout = temp_sum[5]; 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: ```c++ #include <ap_int.h> void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { ap_int<5...
The wrong part of the code is: temp_sum = a + b + cin; sum = temp_sum.range(3, -1); cout = temp_sum[5]; The high-level-synthesis bug type of the code is: SHFT The right code snippet is: temp_sum = a + b + cin; sum = temp_sum.range(3, 0); cout = temp_sum[4];
SHFT
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ```c++ #include <ap_int.h> #pragma HLS array_partition variable=a cyclic factor=2 void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { a...
The wrong part of the code is: #pragma HLS array_partition variable=a cyclic factor=2 void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { The right code snippet is: void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) ...
APT
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ```c++ #include <ap_int.h> #pragma HLS array_partition variable=a cyclic factor=2 void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { ap_int...
The right code snippet is: void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) {
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: ```c++ #include <ap_int.h> #pragma HLS array_partition variable=a cyclic factor=2 void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& co...
The wrong part of the code is: #pragma HLS array_partition variable=a cyclic factor=2 void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { 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: ```c++ #include <ap_int.h> #pragma HLS array_partition variable=a cyclic factor=2 void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<...
The wrong part of the code is: #pragma HLS array_partition variable=a cyclic factor=2 void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { The high-level-synthesis bug type of the code is: APT The right code snippet is: void four_bit_adder(ap_int<4> a, ap_...
APT
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ```c++ #include <ap_int.h> #pragma HLS interface m_axi port=a void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { ap_int<5> temp_sum; ...
The wrong part of the code is: #pragma HLS interface m_axi port=a void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { The right code snippet is: void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) {
RAMB
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ```c++ #include <ap_int.h> #pragma HLS interface m_axi port=a void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { ap_int<5> temp_sum; te...
The right code snippet is: void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) {
RAMB
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: ```c++ #include <ap_int.h> #pragma HLS interface m_axi port=a void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { ap_int<5> ...
The wrong part of the code is: #pragma HLS interface m_axi port=a void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { The high-level-synthesis bug type of the code is: RAMB
RAMB
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: ```c++ #include <ap_int.h> #pragma HLS interface m_axi port=a void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& s...
The wrong part of the code is: #pragma HLS interface m_axi port=a void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1> cin, ap_int<4>& sum, ap_int<1>& cout) { The high-level-synthesis bug type of the code is: RAMB The right code snippet is: void four_bit_adder(ap_int<4> a, ap_int<4> b, ap_int<1>...
RAMB
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: bool x_or_y = x | y | z; The right code snippet is: bool x_or_y = x | y;
'OOB'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: bool x_or_y = x | y;
'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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: bool x_or_y = x | y | z; 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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: bool x_or_y = x | y | z; The high-level-synthesis bug type of the code is: 'OOB' The right code snippet is: bool x_or_y = x | y;
'OOB'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: bool x_xor_z; if (x) { x_xor_z = z; } else { x_xor_z = false; } The right code snippet is: bool x_xor_z = x ^ z;
'INIT'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: bool x_xor_z = x ^ z;
'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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: bool x_xor_z; if (x) { x_xor_z = z; } else { x_xor_z = false; } 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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: bool x_xor_z; if (x) { x_xor_z = z; } else { x_xor_z = false; } The high-level-synthesis bug type of the code is: 'INIT' The right code snippet is: bool x_xor_z = x ^ z;
'INIT'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: bool x_xor_z = x << 3 ^ z; The right code snippet is: bool x_xor_z = x ^ z;
'SHFT'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: bool x_xor_z = x ^ z;
'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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: bool x_xor_z = x << 3 ^ z; 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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: bool x_xor_z = x << 3 ^ z; The high-level-synthesis bug type of the code is: 'SHFT' The right code snippet is: bool x_xor_z = x ^ z;
'SHFT'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: while (true) {} The right code snippet is: N/A (This code is guaranteed to terminate)
'INF'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code is guaranteed to terminate)
'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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: while (true) {} 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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: while (true) {} The high-level-synthesis bug type of the code is: 'INF' The right code snippet is: N/A (This code is guaranteed to terminate)
'INF'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: int32_t x_xor_z_int = x_xor_z; bool x_xor_z = (bool) x_xor_z_int; The right code snippet is: bool x_xor_z = x ^ z;
'USE'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: bool x_xor_z = x ^ z;
'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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: int32_t x_xor_z_int = x_xor_z; bool x_xor_z = (bool) x_xor_z_int; 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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: int32_t x_xor_z_int = x_xor_z; bool x_xor_z = (bool) x_xor_z_int; The high-level-synthesis bug type of the code is: 'USE' The right code snippet is: bool x_xor_z = x ^ z;
'USE'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: for (int i = 0; i < 3; i++) { bool x_or_y = x | y; bool x_xor_z = x ^ z; f = x_or_y & x_xor_z; } The right code snippet is: N/A (Manual loop unrolling is not used in this code)
'MLU'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (Manual loop unrolling is not used in this code)
'MLU'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: for (int i = 0; i < 3; i++) { bool x_or_y = x | y; bool x_xor_z = x ^ z; f = x_or_y & x_xor_z; } The high-level-synthesis bug type of the code is: 'MLU'
'MLU'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: for (int i = 0; i < 3; i++) { bool x_or_y = x | y; bool x_xor_z = x ^ z; f = x_or_y & x_xor_z; } The high-level-synthesis bug type of the code is: 'MLU' The right code snippet is: N/A (Manual loop unrolling is not used in this code)
'MLU'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: bool x_xor_z = 0; The right code snippet is: bool x_xor_z = x ^ z;
'ZERO'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: bool x_xor_z = x ^ z;
'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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: bool x_xor_z = 0; 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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: bool x_xor_z = 0; The high-level-synthesis bug type of the code is: 'ZERO' The right code snippet is: bool x_xor_z = x ^ z;
'ZERO'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: bool x_or_y = y | z; The right code snippet is: bool x_or_y = x | y;
'BUF'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: bool x_or_y = x | y;
'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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: bool x_or_y = y | z; 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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: bool x_or_y = y | z; The high-level-synthesis bug type of the code is: 'BUF' The right code snippet is: bool x_or_y = x | y;
'BUF'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: #pragma HLS array_partition variable=x cyclic factor=3 The right code snippet is: N/A (This code does not use '#pragma HLS array_partition')
'APT'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code does not use '#pragma HLS array_partition')
'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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: #pragma HLS array_partition variable=x cyclic factor=3 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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: #pragma HLS array_partition variable=x cyclic factor=3 The high-level-synthesis bug type of the code is: 'APT' The right code snippet is: N/A (This code does not use '#pragma HLS array_partition')
'APT'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: #pragma HLS array_partition variable=x cyclic factor=4 The right code snippet is: N/A (This code does not use '#pragma HLS array_partition')
'FND'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code does not use '#pragma HLS array_partition')
'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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: #pragma HLS array_partition variable=x cyclic factor=4 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: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: #pragma HLS array_partition variable=x cyclic factor=4 The high-level-synthesis bug type of the code is: 'FND' The right code snippet is: N/A (This code does not use '#pragma HLS array_partition')
'FND'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: #pragma HLS array_partition variable=x dim=2 cyclic factor=3 The right code snippet is: N/A (This code does not use '#pragma HLS array_partition')
'DID'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code does not use '#pragma HLS array_partition')
'DID'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: #pragma HLS array_partition variable=x dim=2 cyclic factor=3 The high-level-synthesis bug type of the code is: 'DID'
'DID'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: #pragma HLS array_partition variable=x dim=2 cyclic factor=3 The high-level-synthesis bug type of the code is: 'DID' The right code snippet is: N/A (This code does not use '#pragma HLS array_partition')
'DID'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: #pragma HLS dataflow The right code snippet is: N/A (This code does not use '#pragma HLS dataflow')
'DFP'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code does not use '#pragma HLS dataflow')
'DFP'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: #pragma HLS dataflow The high-level-synthesis bug type of the code is: 'DFP'
'DFP'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: #pragma HLS dataflow The high-level-synthesis bug type of the code is: 'DFP' The right code snippet is: N/A (This code does not use '#pragma HLS dataflow')
'DFP'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: #pragma HLS interface ap_fifo port=x The right code snippet is: N/A (This code does not use '#pragma HLS interface')
'IDAP'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code does not use '#pragma HLS interface')
'IDAP'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: #pragma HLS interface ap_fifo port=x The high-level-synthesis bug type of the code is: 'IDAP'
'IDAP'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: #pragma HLS interface ap_fifo port=x The high-level-synthesis bug type of the code is: 'IDAP' The right code snippet is: N/A (This code does not use '#pragma HLS interface')
'IDAP'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: #pragma HLS interface m_axi port=x The right code snippet is: N/A (This code does not use 'm_axi' interface)
'RAMB'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code does not use 'm_axi' interface)
'RAMB'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: #pragma HLS interface m_axi port=x The high-level-synthesis bug type of the code is: 'RAMB'
'RAMB'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: #pragma HLS interface m_axi port=x The high-level-synthesis bug type of the code is: 'RAMB' The right code snippet is: N/A (This code does not use 'm_axi' interface)
'RAMB'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: #pragma HLS interface s_axilite port=x The right code snippet is: N/A (This code does not use array interfaces)
'SMA'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code does not use array interfaces)
'SMA'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: #pragma HLS interface s_axilite port=x The high-level-synthesis bug type of the code is: 'SMA'
'SMA'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: #pragma HLS interface s_axilite port=x The high-level-synthesis bug type of the code is: 'SMA' The right code snippet is: N/A (This code does not use array interfaces)
'SMA'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: #pragma HLS interface ap_memory port=x The right code snippet is: N/A (This code does not use scalar interfaces)
'AMS'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code does not use scalar interfaces)
'AMS'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: #pragma HLS interface ap_memory port=x The high-level-synthesis bug type of the code is: 'AMS'
'AMS'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: #pragma HLS interface ap_memory port=x The high-level-synthesis bug type of the code is: 'AMS' The right code snippet is: N/A (This code does not use scalar interfaces)
'AMS'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: #pragma HLS pipeline II=2 The right code snippet is: N/A (This code does not use '#pragma HLS pipeline')
'MLP'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code does not use '#pragma HLS pipeline')
'MLP'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: #pragma HLS pipeline II=2 The high-level-synthesis bug type of the code is: 'MLP'
'MLP'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: #pragma HLS pipeline II=2 The high-level-synthesis bug type of the code is: 'MLP' The right code snippet is: N/A (This code does not use '#pragma HLS pipeline')
'MLP'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pr...
The wrong part of the code is: #pragma HLS unroll factor=2 The right code snippet is: N/A (This code does not use '#pragma HLS unroll')
'ILNU'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` void bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none port=z #pragma ...
The right code snippet is: N/A (This code does not use '#pragma HLS unroll')
'ILNU'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y #pragma HLS INTERFACE ap_none por...
The wrong part of the code is: #pragma HLS unroll factor=2 The high-level-synthesis bug type of the code is: 'ILNU'
'ILNU'
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 bool_func(bool x, bool y, bool z, bool &f) { #pragma HLS INTERFACE ap_none port=x #pragma HLS INTERFACE ap_none port=y ...
The wrong part of the code is: #pragma HLS unroll factor=2 The high-level-synthesis bug type of the code is: 'ILNU' The right code snippet is: N/A (This code does not use '#pragma HLS unroll')
'ILNU'
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uint_w prev_va...
The wrong part of the code is: for (i = 1; i <= n; i++) { // Accessing one element beyond the array size curr_val = in[i]; } The right code snippet is: for (i = 1; i < n; i++) {
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uint_w prev_val; ...
The right code snippet is: for (i = 1; i < n; i++) {
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uin...
The wrong part of the code is: for (i = 1; i <= n; i++) { // Accessing one element beyond the array size curr_val = in[i]; } 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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w enco...
The wrong part of the code is: for (i = 1; i <= n; i++) { // Accessing one element beyond the array size curr_val = in[i]; } The high-level-synthesis bug type of the code is: OOB The right code snippet is: for (i = 1; i < n; i++) {
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uint_w prev_va...
The wrong part of the code is: uint_w count = 0; // count is not initialized and may contain garbage value // This can lead to incorrect results during encoding operation if (curr_val == prev_val) { count++; } The right code snippet is: uint_w count;
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uint_w prev_val; ...
The right code snippet is: uint_w count;
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uin...
The wrong part of the code is: uint_w count = 0; // count is not initialized and may contain garbage value // This can lead to incorrect results during encoding operation if (curr_val == prev_val) { count++; } 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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w enco...
The wrong part of the code is: uint_w count = 0; // count is not initialized and may contain garbage value // This can lead to incorrect results during encoding operation if (curr_val == prev_val) { count++; } The high-level-synthesis bug type of the code is: INIT The right code snippet is: uint_...
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uint_w prev_va...
The wrong part of the code is: enc_count = enc_count << 3; // Shifting the value of enc_count by an out-of-bounds amount // This can lead to incorrect results during encoding operation The right code snippet is: enc_count++;
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uint_w prev_val; ...
The right code snippet is: enc_count++;
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uin...
The wrong part of the code is: enc_count = enc_count << 3; // Shifting the value of enc_count by an out-of-bounds amount // This can lead to incorrect results during encoding operation 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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w enco...
The wrong part of the code is: enc_count = enc_count << 3; // Shifting the value of enc_count by an out-of-bounds amount // This can lead to incorrect results during encoding operation The high-level-synthesis bug type of the code is: SHFT The right code snippet is: enc_count++;
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uint_w prev_va...
The wrong part of the code is: for (i = 0; i >= 0; i++) { // This creates an infinite loop as the loop counter never reaches the exit condition enc_val = encoded[i*w]; enc_count = encoded[i*w+w]; for (int j = 0; j < enc_count; j++) { decoded[dec_count] = enc_val; dec_count++; } } The righ...
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uint_w prev_val; ...
The right code snippet is: for (i = 0; i < m; i++) {
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w encoded[m*w], uint_w decoded[n]) { uin...
The wrong part of the code is: for (i = 0; i >= 0; i++) { // This creates an infinite loop as the loop counter never reaches the exit condition enc_val = encoded[i*w]; enc_count = encoded[i*w+w]; for (int j = 0; j < enc_count; j++) { decoded[dec_count] = enc_val; dec_count++; } } The high...
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> const int n = 16; const int m = 8; const int w = 8; typedef ap_uint<w> uint_w; void RLE(uint_w in[n], uint_w enco...
The wrong part of the code is: for (i = 0; i >= 0; i++) { // This creates an infinite loop as the loop counter never reaches the exit condition enc_val = encoded[i*w]; enc_count = encoded[i*w+w]; for (int j = 0; j < enc_count; j++) { decoded[dec_count] = enc_val; dec_count++; } } The high...
INF