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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
adder_output = addend1[5] + addend2[5] + carry_in;
The right code snippet is:
adder_output = addend1 + addend2 + carry_in; | OOB |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
adder_output = addend1 + addend2 + carry_in; | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
adder_output = addend1[5] + addend2[5] + carry_in;
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
adder_output = addend1[5] + addend2[5] + carry_in;
The high-level-synthesis bug type of the code is: OOB
The right code snippet is:
adder_output = addend1 + addend2 + carry_in; | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry =... |
The wrong part of the code is:
bool carry = true;
The right code snippet is:
bool carry; | INIT |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry = true... |
The right code snippet is:
bool carry; | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
bool carry = true;
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
bool carry = true;
The high-level-synthesis bug type of the code is: INIT
The right code snippet is:
bool carry; | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
adder_output = addend1 << 5 + addend2 << 5 + carry_in;
The right code snippet is:
adder_output = addend1 + addend2 + carry_in; | SHFT |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
adder_output = addend1 + addend2 + carry_in; | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
adder_output = addend1 << 5 + addend2 << 5 + carry_in;
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
adder_output = addend1 << 5 + addend2 << 5 + carry_in;
The high-level-synthesis bug type of the code is: SHFT
The right code snippet is:
adder_output = addend1 + addend2 + carry_in; | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
for (int i = 0; i >= 0; i++) {
The right code snippet is:
for (int i = 0; i < 10; i++) { | INF |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
for (int i = 0; i < 10; 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:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
for (int i = 0; i >= 0; i++) {
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
for (int i = 0; i >= 0; i++) {
The high-level-synthesis bug type of the code is: INF
The right code snippet is:
for (int i = 0; i < 10; i++) { | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_int<4> adder_output;
bool carry;
... |
The wrong part of the code is:
ap_int<4> adder_output;
The right code snippet is:
ap_uint<4> adder_output; | USE |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_int<4> adder_output;
bool carry;
add... |
The right code snippet is:
ap_uint<4> adder_output; | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_int<4> adder_output;
bo... |
The wrong part of the code is:
ap_int<4> adder_output;
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
ap_int<4> adder_output;
The high-level-synthesis bug type of the code is: USE
The right code snippet is:
ap_uint<4> adder_output; | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
for (int i = 0; i < 4; i+=2) {
#pragma HLS unroll
sum[i] = adder_output[i];
}
The right code snippet is:
for (int i = 0; i < 4; i++) {
#pragma HLS unroll
sum[i] = adder_output[i];
} | MLU |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
for (int i = 0; i < 4; i++) {
#pragma HLS unroll
sum[i] = adder_output[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:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
for (int i = 0; i < 4; i+=2) {
#pragma HLS unroll
sum[i] = adder_output[i];
}
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
for (int i = 0; i < 4; i+=2) {
#pragma HLS unroll
sum[i] = adder_output[i];
}
The high-level-synthesis bug type of the code is: MLU
The right code snippet is:
for (int i = 0; i < 4; i++) {
#pragma HLS unroll
sum[i] = adder_output[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:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry =... |
The wrong part of the code is:
bool carry = 0;
The right code snippet is:
bool carry; | ZERO |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry = 0;
... |
The right code snippet is:
bool carry; | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
bool carry = 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
bool carry = 0;
The high-level-synthesis bug type of the code is: ZERO
The right code snippet is:
bool carry; | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
memcpy(buffer1, buffer2+2, sizeof(buffer1));
The right code snippet is:
memcpy(buffer1, buffer2, sizeof(buffer1)); | BUF |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
memcpy(buffer1, buffer2, sizeof(buffer1)); | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
memcpy(buffer1, buffer2+2, sizeof(buffer1));
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
memcpy(buffer1, buffer2+2, sizeof(buffer1));
The high-level-synthesis bug type of the code is: BUF
The right code snippet is:
memcpy(buffer1, buffer2, sizeof(buffer1)); | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
#pragma HLS array_partition variable=sum cyclic
The right code snippet is:
#pragma HLS array_partition variable=sum complete | APT |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
#pragma HLS array_partition variable=sum complete | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
#pragma HLS array_partition variable=sum cyclic
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
#pragma HLS array_partition variable=sum cyclic
The high-level-synthesis bug type of the code is: APT
The right code snippet is:
#pragma HLS array_partition variable=sum complete | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
#pragma HLS array_partition variable=sum factor=3
The right code snippet is:
#pragma HLS array_partition variable=sum complete | FND |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
#pragma HLS array_partition variable=sum complete | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
#pragma HLS array_partition variable=sum factor=3
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
#pragma HLS array_partition variable=sum factor=3
The high-level-synthesis bug type of the code is: FND
The right code snippet is:
#pragma HLS array_partition variable=sum complete | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
#pragma HLS array_partition variable=sum complete dim=2
The right code snippet is:
#pragma HLS array_partition variable=sum complete dim=1 | DID |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
#pragma HLS array_partition variable=sum complete 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:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
#pragma HLS array_partition variable=sum complete 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:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
#pragma HLS array_partition variable=sum complete dim=2
The high-level-synthesis bug type of the code is: DID
The right code snippet is:
#pragma HLS array_partition variable=sum complete 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:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
#pragma HLS dataflow region
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:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
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:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
#pragma HLS dataflow region
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
#pragma HLS dataflow region
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:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
#pragma HLS interface ap_none port=return
The right code snippet is:
#pragma HLS interface ap_ctrl_none port=return | IDAP |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
#pragma HLS interface ap_ctrl_none port=return | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
#pragma HLS interface ap_none port=return
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
#pragma HLS interface ap_none port=return
The high-level-synthesis bug type of the code is: IDAP
The right code snippet is:
#pragma HLS interface ap_ctrl_none port=return | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
#pragma HLS interface m_axi port=buffer1 offset=slave
The right code snippet is:
#pragma HLS interface m_axi port=buffer1 | RAMB |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
#pragma HLS interface m_axi port=buffer1 | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
#pragma HLS interface m_axi port=buffer1 offset=slave
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
#pragma HLS interface m_axi port=buffer1 offset=slave
The high-level-synthesis bug type of the code is: RAMB
The right code snippet is:
#pragma HLS interface m_axi port=buffer1 | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
#pragma HLS interface ap_memory port=buffer1
The right code snippet is:
#pragma HLS interface axis port=buffer1 | SMA |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
#pragma HLS interface axis port=buffer1 | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
#pragma HLS interface ap_memory port=buffer1
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
#pragma HLS interface ap_memory port=buffer1
The high-level-synthesis bug type of the code is: SMA
The right code snippet is:
#pragma HLS interface axis port=buffer1 | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
#pragma HLS interface axis port=buffer1
The right code snippet is:
#pragma HLS interface ap_memory port=buffer1 | AMS |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
#pragma HLS interface ap_memory port=buffer1 | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
#pragma HLS interface axis port=buffer1
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
#pragma HLS interface axis port=buffer1
The high-level-synthesis bug type of the code is: AMS
The right code snippet is:
#pragma HLS interface ap_memory port=buffer1 | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
#pragma HLS pipeline II=2
The right code snippet is:
#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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
#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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
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:
#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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
... |
The wrong part of the code is:
for (int i = 0; i < 4; i++) {
sum[i] = adder_output[i];
}
The right code snippet is:
for (int i = 0; i < 4; i++) {
#pragma HLS unroll
sum[i] = adder_output[i];
} | ILNU |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
bool carry;
ad... |
The right code snippet is:
for (int i = 0; i < 4; i++) {
#pragma HLS unroll
sum[i] = adder_output[i];
} | 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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_out
) {
ap_uint<4> adder_output;
b... |
The wrong part of the code is:
for (int i = 0; i < 4; i++) {
sum[i] = adder_output[i];
}
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 binary_adder(
const ap_uint<4> addend1,
const ap_uint<4> addend2,
const bool carry_in,
ap_uint<4>& sum,
bool& carry_o... |
The wrong part of the code is:
for (int i = 0; i < 4; i++) {
sum[i] = adder_output[i];
}
The high-level-synthesis bug type of the code is: ILNU
The right code snippet is:
for (int i = 0; i < 4; i++) {
#pragma HLS unroll
sum[i] = adder_output[i];
} | ILNU |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {
... |
The wrong part of the code is:
if (sum >= 255) {
result = sum - 256;
} else {
result = sum;
}
The right code snippet is:
if (sum > 255) {
result = sum - 256;
} else {
result = sum;
} | 'OOB' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {
resu... |
The right code snippet is:
if (sum > 255) {
result = sum - 256;
} else {
result = sum;
} | '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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} els... |
The wrong part of the code is:
if (sum >= 255) {
result = sum - 256;
} else {
result = sum;
}
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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
... |
The wrong part of the code is:
if (sum >= 255) {
result = sum - 256;
} else {
result = sum;
}
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
if (sum > 255) {
result = sum - 256;
} else {
result = sum;
} | 'OOB' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum;
if (sum > 255) {
result = sum - 256;
} else {
result ... |
The wrong part of the code is:
ap_int<16> sum;
The right code snippet is:
ap_int<16> 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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum;
if (sum > 255) {
result = sum - 256;
} else {
result = sum... |
The right code snippet is:
ap_int<16> 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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum;
if (sum > 255) {
result = sum - 256;
} else {
... |
The wrong part of the code is:
ap_int<16> sum;
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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum;
if (sum > 255) {
... |
The wrong part of the code is:
ap_int<16> sum;
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
ap_int<16> 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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {
... |
The wrong part of the code is:
if (sum > 255) {
result = sum << 8;
} else {
result = sum;
}
The right code snippet is:
if (sum > 255) {
result = sum - 256;
} else {
result = sum;
} | 'SHFT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {
resu... |
The right code snippet is:
if (sum > 255) {
result = sum - 256;
} else {
result = sum;
} | '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++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} els... |
The wrong part of the code is:
if (sum > 255) {
result = sum << 8;
} else {
result = sum;
}
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++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
... |
The wrong part of the code is:
if (sum > 255) {
result = sum << 8;
} else {
result = sum;
}
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
if (sum > 255) {
result = sum - 256;
} else {
result = sum;
} | '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++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {
... |
The wrong part of the code is:
while (sum < 256) {
result = sum;
}
The right code snippet is:
if (sum > 255) {
result = sum - 256;
} else {
result = sum;
} | 'INF' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {
resu... |
The right code snippet is:
if (sum > 255) {
result = sum - 256;
} else {
result = sum;
} | '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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} els... |
The wrong part of the code is:
while (sum < 256) {
result = sum;
}
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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
... |
The wrong part of the code is:
while (sum < 256) {
result = sum;
}
The high-level-synthesis bug type of the code is: 'INF'
The right code snippet is:
if (sum > 255) {
result = sum - 256;
} else {
result = 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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
int16_t sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {
re... |
The wrong part of the code is:
int16_t sum = A + B;
The right code snippet is:
ap_int<16> 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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
int16_t sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {
result ... |
The right code snippet is:
ap_int<16> 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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
int16_t sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {... |
The wrong part of the code is:
int16_t sum = A + B;
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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
int16_t sum = A + B;
if (sum > 255) {
... |
The wrong part of the code is:
int16_t sum = A + B;
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
ap_int<16> 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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {
... |
The wrong part of the code is:
for (int i = 0; i < 3; i++) {
#pragma HLS unroll
// loop body
}
The right code snippet is:
for (int i = 0; i < 4; i++) {
#pragma HLS unroll
// loop body
} | 'MLU' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} else {
resu... |
The right code snippet is:
for (int i = 0; i < 4; i++) {
#pragma HLS unroll
// loop body
} | '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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
result = sum - 256;
} els... |
The wrong part of the code is:
for (int i = 0; i < 3; i++) {
#pragma HLS unroll
// loop body
}
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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = A + B;
if (sum > 255) {
... |
The wrong part of the code is:
for (int i = 0; i < 3; i++) {
#pragma HLS unroll
// loop body
}
The high-level-synthesis bug type of the code is: 'MLU'
The right code snippet is:
for (int i = 0; i < 4; i++) {
#pragma HLS unroll
// loop body
} | 'MLU' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = 0;
if (sum > 255) {
result = sum - 256;
} else {
res... |
The wrong part of the code is:
ap_int<16> sum = 0;
The right code snippet is:
ap_int<16> 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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = 0;
if (sum > 255) {
result = sum - 256;
} else {
result =... |
The right code snippet is:
ap_int<16> 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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = 0;
if (sum > 255) {
result = sum - 256;
} else {
... |
The wrong part of the code is:
ap_int<16> sum = 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:
```c++
void add_subtract(
ap_int<8> A,
ap_int<8> B,
ap_int<16> &result
) {
ap_int<16> sum = 0;
if (sum > 255) {
... |
The wrong part of the code is:
ap_int<16> sum = 0;
The high-level-synthesis bug type of the code is: 'ZERO'
The right code snippet is:
ap_int<16> sum = A + B; | 'ZERO' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.