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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERFACE axis port=falling
#pragma HLS INTERFACE axis... |
The wrong part of the code is:
#pragma HLS pipeline II=2
void sync_signal(axis_t in, axis_t& out, axis_t& falling, axis_t& rising) {
The right code snippet is:
void sync_signal(axis_t in, axis_t& out, axis_t& falling, axis_t& rising) { | MLP |
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_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERFACE axis port=falling
#pragma HLS INTERFACE axis port... |
The right code snippet is:
void sync_signal(axis_t in, axis_t& out, axis_t& falling, axis_t& rising) { | 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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERFACE axis port=falling
#pragma HLS INT... |
The wrong part of the code is:
#pragma HLS pipeline II=2
void sync_signal(axis_t in, axis_t& out, axis_t& falling, axis_t& rising) {
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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERF... |
The wrong part of the code is:
#pragma HLS pipeline II=2
void sync_signal(axis_t in, axis_t& out, axis_t& falling, axis_t& rising) {
The high-level-synthesis bug type of the code is: MLP
The right code snippet is:
void sync_signal(axis_t in, axis_t& out, axis_t& falling, axis_t& rising) { | MLP |
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_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERFACE axis port=falling
#pragma HLS INTERFACE axis... |
The wrong part of the code is:
shiftreg.range(4, 1) = shiftreg.range(1, 0);
The right code snippet is:
shiftreg.range(2, 1) = shiftreg.range(1, 0); | 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_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERFACE axis port=falling
#pragma HLS INTERFACE axis port... |
The right code snippet is:
shiftreg.range(2, 1) = shiftreg.range(1, 0); | 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_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERFACE axis port=falling
#pragma HLS INT... |
The wrong part of the code is:
shiftreg.range(4, 1) = shiftreg.range(1, 0);
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_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERF... |
The wrong part of the code is:
shiftreg.range(4, 1) = shiftreg.range(1, 0);
The high-level-synthesis bug type of the code is: SHFT
The right code snippet is:
shiftreg.range(2, 1) = shiftreg.range(1, 0); | 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_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERFACE axis port=falling
#pragma HLS INTERFACE axis... |
The wrong part of the code is:
static ap_uint<3> shiftreg;
The right code snippet is:
static ap_uint<3> shiftreg = 0; | ZERO |
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_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERFACE axis port=falling
#pragma HLS INTERFACE axis port... |
The right code snippet is:
static ap_uint<3> shiftreg = 0; | 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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERFACE axis port=falling
#pragma HLS INT... |
The wrong part of the code is:
static ap_uint<3> shiftreg;
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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=in
#pragma HLS INTERFACE axis port=out
#pragma HLS INTERF... |
The wrong part of the code is:
static ap_uint<3> shiftreg;
The high-level-synthesis bug type of the code is: ZERO
The right code snippet is:
static ap_uint<3> shiftreg = 0; | ZERO |
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
for(int i = n-1; i > 0; i--) {
for(int j = i-1; j >= -1; j--) {
encoded_req[i] = encoded_req[i] & ~req[j];
}
}
The right code snippet is:
for(int i = n-1; i > 0; i--) {
for(int j = i-1; j >= 0; j--) {
encoded_req[i] = encoded_req[i] & ~req[j];
}
} | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
for(int i = n-1; i > 0; i--) {
for(int j = i-1; j >= 0; j--) {
encoded_req[i] = encoded_req[i] & ~req[j];
}
} | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
for(int i = n-1; i > 0; i--) {
for(int j = i-1; j >= -1; j--) {
encoded_req[i] = encoded_req[i] & ~req[j];
}
}
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
for(int i = n-1; i > 0; i--) {
for(int j = i-1; j >= -1; j--) {
encoded_req[i] = encoded_req[i] & ~req[j];
}
}
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
for(int i = n-1; i > 0; i--) {
for(int j = i-1; j >= 0; j--) {
... | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
int decoded_grant[n];
decoded_grant[0] = encoded_req[0];
for(int i = 1; i < n; i++) {
int temp;
decoded_grant[i] = encoded_req[i] & ~temp;
}
The right code snippet is:
int decoded_grant[n];
decoded_grant[0] = encoded_req[0];
for(int i = 1; i < n; i++) {
decoded_gran... | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
int decoded_grant[n];
decoded_grant[0] = encoded_req[0];
for(int i = 1; i < n; i++) {
decoded_grant[i] = encoded_req[i] & ~decoded_grant[i-1];
} | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
int decoded_grant[n];
decoded_grant[0] = encoded_req[0];
for(int i = 1; i < n; i++) {
int temp;
decoded_grant[i] = encoded_req[i] & ~temp;
}
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
int decoded_grant[n];
decoded_grant[0] = encoded_req[0];
for(int i = 1; i < n; i++) {
int temp;
decoded_grant[i] = encoded_req[i] & ~temp;
}
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
int decoded_grant[n];
decoded_grant[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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
for(int i = 0; i < n; i++) {
encoded_req[i] = req[i] << n;
}
The right code snippet is:
for(int i = 0; i < n; i++) {
encoded_req[i] = req[i];
} | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
for(int i = 0; i < n; i++) {
encoded_req[i] = req[i];
} | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
for(int i = 0; i < n; i++) {
encoded_req[i] = req[i] << n;
}
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
for(int i = 0; i < n; i++) {
encoded_req[i] = req[i] << n;
}
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
for(int i = 0; i < n; i++) {
encoded_req[i] = req[i];
} | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
for(int i = 1; i < n; i--) {
decoded_grant[i] = encoded_req[i] & ~decoded_grant[i-1];
}
The right code snippet is:
for(int i = 1; i < n; i++) {
decoded_grant[i] = encoded_req[i] & ~decoded_grant[i-1];
} | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
for(int i = 1; i < n; i++) {
decoded_grant[i] = encoded_req[i] & ~decoded_grant[i-1];
} | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
for(int i = 1; i < n; i--) {
decoded_grant[i] = encoded_req[i] & ~decoded_grant[i-1];
}
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
for(int i = 1; i < n; i--) {
decoded_grant[i] = encoded_req[i] & ~decoded_grant[i-1];
}
The high-level-synthesis bug type of the code is: 'INF'
The right code snippet is:
for(int i = 1; i < n; i++) {
decoded_grant[i] = encoded_req[i] & ~decoded_grant[i-1];
} | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
int decoded_grant[n];
decoded_grant[0] = (unsigned int) encoded_req[0];
for(int i = 1; i < n; i++) {
decoded_grant[i] = (unsigned int) encoded_req[i] & ~decoded_grant[i-1];
}
The right code snippet is:
int decoded_grant[n];
decoded_grant[0] = encoded_req[0];
for(int i =... | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
int decoded_grant[n];
decoded_grant[0] = encoded_req[0];
for(int i = 1; i < n; i++) {
decoded_grant[i] = encoded_req[i] & ~decoded_grant[i-1];
} | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
int decoded_grant[n];
decoded_grant[0] = (unsigned int) encoded_req[0];
for(int i = 1; i < n; i++) {
decoded_grant[i] = (unsigned int) encoded_req[i] & ~decoded_grant[i-1];
}
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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
int decoded_grant[n];
decoded_grant[0] = (unsigned int) encoded_req[0];
for(int i = 1; i < n; i++) {
decoded_grant[i] = (unsigned int) encoded_req[i] & ~decoded_grant[i-1];
}
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
int deco... | 'USE' |
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
grant[0] = decoded_grant[0];
grant[1] = decoded_grant[1];
grant[2] = decoded_grant[2];
grant[3] = decoded_grant[3];
The right code snippet is:
for(int i = 0; i < m; i++) {
grant[i] = decoded_grant[i];
} | 'MLU' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
for(int i = 0; i < m; i++) {
grant[i] = decoded_grant[i];
} | '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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
grant[0] = decoded_grant[0];
grant[1] = decoded_grant[1];
grant[2] = decoded_grant[2];
grant[3] = decoded_grant[3];
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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
grant[0] = decoded_grant[0];
grant[1] = decoded_grant[1];
grant[2] = decoded_grant[2];
grant[3] = decoded_grant[3];
The high-level-synthesis bug type of the code is: 'MLU'
The right code snippet is:
for(int i = 0; i < m; i++) {
grant[i] = decoded_grant[i];
} | 'MLU' |
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 0;
const int m = 0;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
const int n = 0;
const int m = 0;
The right code snippet is:
const int n = 4;
const int m = 2; | 'ZERO' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 0;
const int m = 0;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
const int n = 4;
const int m = 2; | '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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 0;
const int m = 0;
void arbiter(int req[... |
The wrong part of the code is:
const int n = 0;
const int m = 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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 0;
co... |
The wrong part of the code is:
const int n = 0;
const int m = 0;
The high-level-synthesis bug type of the code is: 'ZERO'
The right code snippet is:
const int n = 4;
const int m = 2; | 'ZERO' |
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
for(int i = n/2; i < n; i++) {
encoded_req[i] = req[i-n/2];
}
The right code snippet is:
for(int i = 0; i < n; i++) {
encoded_req[i] = req[i];
} | 'BUF' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
for(int i = 0; i < n; i++) {
encoded_req[i] = req[i];
} | '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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
for(int i = n/2; i < n; i++) {
encoded_req[i] = req[i-n/2];
}
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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
for(int i = n/2; i < n; i++) {
encoded_req[i] = req[i-n/2];
}
The high-level-synthesis bug type of the code is: 'BUF'
The right code snippet is:
for(int i = 0; i < n; i++) {
encoded_req[i] = req[i];
} | 'BUF' |
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=encoded_req block factor=2 dim=1
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=1 | 'APT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=1 | '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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=encoded_req block factor=2 dim=1
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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=encoded_req block factor=2 dim=1
The high-level-synthesis bug type of the code is: 'APT'
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=1 | 'APT' |
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=3 dim=1
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=1 | 'FND' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=1 | '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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=3 dim=1
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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=3 dim=1
The high-level-synthesis bug type of the code is: 'FND'
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=1 | '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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=2
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=1 | 'DID' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=1 | '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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=2
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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=2
The high-level-synthesis bug type of the code is: 'DID'
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=encoded_req cyclic factor=2 dim=1 | 'DID' |
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 s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
#pragma HLS DATAFLOW off
The right code snippet is:
#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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
#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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
#pragma HLS DATAFLOW off
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:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
#pragma HLS DATAFLOW off
The high-level-synthesis bug type of the code is: 'DFP'
The right code snippet is:
#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:
#pragma HLS INTERFACE s_axilite port=req bundle=DATA_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int gra... |
The wrong part of the code is:
#pragma HLS INTERFACE s_axilite port=req bundle=DATA_BUS
The right code snippet is:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS | 'IDAP' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE s_axilite port=req bundle=DATA_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[n], int grant[m]... |
The right code snippet is:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS | '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:
#pragma HLS INTERFACE s_axilite port=req bundle=DATA_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
const int m = 2;
void arbiter(int req[... |
The wrong part of the code is:
#pragma HLS INTERFACE s_axilite port=req bundle=DATA_BUS
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:
#pragma HLS INTERFACE s_axilite port=req bundle=DATA_BUS
#pragma HLS INTERFACE s_axilite port=grant bundle=CTRL_BUS
const int n = 4;
co... |
The wrong part of the code is:
#pragma HLS INTERFACE s_axilite port=req bundle=DATA_BUS
The high-level-synthesis bug type of the code is: 'IDAP'
The right code snippet is:
#pragma HLS INTERFACE s_axilite port=req bundle=CTRL_BUS | 'IDAP' |
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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = -1;
OUT2 = 0;
break;
... |
The wrong part of the code is:
OUT1 = -1;
The right code snippet is:
OUT1 = 0; | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = -1;
OUT2 = 0;
break;
... |
The right code snippet is:
OUT1 = 0; | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = -1;
OUT2 = 0;
... |
The wrong part of the code is:
OUT1 = -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:
#include <ap_int.h>
void bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1... |
The wrong part of the code is:
OUT1 = -1;
The high-level-synthesis bug type of the code is: OOB
The right code snippet is:
OUT1 = 0; | 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 bcd_code(ap_uint<4> A, ap_uint<4> OUT1;, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The wrong part of the code is:
ap_uint<4> OUT1;
The right code snippet is:
ap_uint<4>& OUT1 | 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 bcd_code(ap_uint<4> A, ap_uint<4> OUT1;, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The right code snippet is:
ap_uint<4>& OUT1 | 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 bcd_code(ap_uint<4> A, ap_uint<4> OUT1;, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
... |
The wrong part of the code is:
ap_uint<4> OUT1;
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 bcd_code(ap_uint<4> A, ap_uint<4> OUT1;, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1... |
The wrong part of the code is:
ap_uint<4> OUT1;
The high-level-synthesis bug type of the code is: INIT
The right code snippet is:
ap_uint<4>& OUT1 | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The wrong part of the code is:
OUT1 = 1 << 5;
The right code snippet is:
OUT1 = 1; | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The right code snippet is:
OUT1 = 1; | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
... |
The wrong part of the code is:
OUT1 = 1 << 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:
#include <ap_int.h>
void bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1... |
The wrong part of the code is:
OUT1 = 1 << 5;
The high-level-synthesis bug type of the code is: SHFT
The right code snippet is:
OUT1 = 1; | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The wrong part of the code is:
case 9:
OUT1 = 2;
OUT2 = 1;
break;
// missing break statement here
The right code snippet is:
case 9:
OUT1 = 2;
OUT2 = 1;
break; | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The right code snippet is:
case 9:
OUT1 = 2;
OUT2 = 1;
break; | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
... |
The wrong part of the code is:
case 9:
OUT1 = 2;
OUT2 = 1;
break;
// missing break statement here
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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1... |
The wrong part of the code is:
case 9:
OUT1 = 2;
OUT2 = 1;
break;
// missing break statement here
The high-level-synthesis bug type of the code is: INF
The right code snippet is:
case 9:
OUT1 = 2;
OUT2 = 1;
break; | 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 bcd_code(ap_uint<4> A, int8_t& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The wrong part of the code is:
int8_t& OUT1
The right code snippet is:
ap_uint<4>& OUT1 | 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 bcd_code(ap_uint<4> A, int8_t& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
ca... |
The right code snippet is:
ap_uint<4>& OUT1 | 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 bcd_code(ap_uint<4> A, int8_t& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
b... |
The wrong part of the code is:
int8_t& OUT1
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 bcd_code(ap_uint<4> A, int8_t& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0... |
The wrong part of the code is:
int8_t& OUT1
The high-level-synthesis bug type of the code is: USE
The right code snippet is:
ap_uint<4>& OUT1 | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The wrong part of the code is:
case 9:
OUT1 = 2;
OUT2 = 1;
case 10:
OUT1 = 3;
OUT2 = 2;
break;
The right code snippet is:
case 9:
OUT1 = 2;
OUT2 = 1;
break; | MLU |
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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The right code snippet is:
case 9:
OUT1 = 2;
OUT2 = 1;
break; | 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:
#include <ap_int.h>
void bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
... |
The wrong part of the code is:
case 9:
OUT1 = 2;
OUT2 = 1;
case 10:
OUT1 = 3;
OUT2 = 2;
break;
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:
#include <ap_int.h>
void bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1... |
The wrong part of the code is:
case 9:
OUT1 = 2;
OUT2 = 1;
case 10:
OUT1 = 3;
OUT2 = 2;
break;
The high-level-synthesis bug type of the code is: MLU
The right code snippet is:
case 9:
OUT1 = 2;
OUT2 = 1;
break; | MLU |
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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The wrong part of the code is:
case 0:
OUT1 = 0;
OUT2 = -1;
break;
The right code snippet is:
case 0:
OUT1 = 0;
OUT2 = 0;
break; | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The right code snippet is:
case 0:
OUT1 = 0;
OUT2 = 0;
break; | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
... |
The wrong part of the code is:
case 0:
OUT1 = 0;
OUT2 = -1;
break;
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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1... |
The wrong part of the code is:
case 0:
OUT1 = 0;
OUT2 = -1;
break;
The high-level-synthesis bug type of the code is: ZERO
The right code snippet is:
case 0:
OUT1 = 0;
OUT2 = 0;
break; | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The wrong part of the code is:
memcpy(OUT1, buffer, 4);
The right code snippet is:
memcpy(OUT1, buffer + 4, 4); | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The right code snippet is:
memcpy(OUT1, buffer + 4, 4); | 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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
... |
The wrong part of the code is:
memcpy(OUT1, buffer, 4);
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 bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1... |
The wrong part of the code is:
memcpy(OUT1, buffer, 4);
The high-level-synthesis bug type of the code is: BUF
The right code snippet is:
memcpy(OUT1, buffer + 4, 4); | 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>
void bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The wrong part of the code is:
#pragma HLS array_partition variable=OUT1 block factor=2 dim=1
The right code snippet is:
#pragma HLS array_partition variable=OUT1 cyclic factor=2 dim=1 | 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>
void bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
break;
... |
The right code snippet is:
#pragma HLS array_partition variable=OUT1 cyclic factor=2 dim=1 | 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>
void bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1 = 0;
OUT2 = 0;
... |
The wrong part of the code is:
#pragma HLS array_partition variable=OUT1 block factor=2 dim=1
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>
void bcd_code(ap_uint<4> A, ap_uint<4>& OUT1, ap_uint<4>& OUT2) {
switch (A) {
case 0:
OUT1... |
The wrong part of the code is:
#pragma HLS array_partition variable=OUT1 block factor=2 dim=1
The high-level-synthesis bug type of the code is: APT
The right code snippet is:
#pragma HLS array_partition variable=OUT1 cyclic factor=2 dim=1 | APT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.