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:
#include <ap_int.h>
void top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variable=ap_clk_divider
#pragma HLS INTERFACE ap_no... |
The wrong part of the code is:
#pragma HLS interface ap_array port=in
The right code snippet is:
#pragma HLS interface ap_none port=in | 'AMS' |
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 top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variable=ap_clk_divider
#pragma HLS INTERFACE ap_none po... |
The right code snippet is:
#pragma HLS interface ap_none port=in | '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:
#include <ap_int.h>
void top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variable=ap_clk_divider
#pragma HLS INTE... |
The wrong part of the code is:
#pragma HLS interface ap_array port=in
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:
#include <ap_int.h>
void top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variabl... |
The wrong part of the code is:
#pragma HLS interface ap_array port=in
The high-level-synthesis bug type of the code is: 'AMS'
The right code snippet is:
#pragma HLS interface ap_none port=in | 'AMS' |
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 top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variable=ap_clk_divider
#pragma HLS INTERFACE ap_no... |
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:
#include <ap_int.h>
void top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variable=ap_clk_divider
#pragma HLS INTERFACE ap_none po... |
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:
#include <ap_int.h>
void top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variable=ap_clk_divider
#pragma HLS INTE... |
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:
#include <ap_int.h>
void top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variabl... |
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:
#include <ap_int.h>
void top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variable=ap_clk_divider
#pragma HLS INTERFACE ap_no... |
The wrong part of the code is:
#pragma HLS unroll factor=2
The right code snippet is:
#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:
#include <ap_int.h>
void top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variable=ap_clk_divider
#pragma HLS INTERFACE ap_none po... |
The right code snippet is:
#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:
#include <ap_int.h>
void top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variable=ap_clk_divider
#pragma HLS INTE... |
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:
#include <ap_int.h>
void top_function(ap_clk_divider, ap_uint<8> in, ap_uint<4> &q) {
#pragma HLS INTERFACE ap_clk_divider variabl... |
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:
#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:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[5], b[... |
The wrong part of the code is:
FullAdder(a[5], b[0], cin, temp_sum[0], temp_cout);
The right code snippet is:
FullAdder(a[0], b[0], cin, temp_sum[0], temp_cout); | 'OOB' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[5], b[0], c... |
The right code snippet is:
FullAdder(a[0], b[0], cin, temp_sum[0], temp_cout); | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
FullAdder(a[5], b[0], cin, temp_sum[0], temp_cout);
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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
FullAdder(a[5], b[0], cin, temp_sum[0], temp_cout);
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
FullAdder(a[0], b[0], cin, temp_sum[0], temp_cout); | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4] = {0};
int temp_cout;
// Full adder for bit 0
FullAdder(a[... |
The wrong part of the code is:
int temp_sum[4] = {0};
The right code snippet is:
int temp_sum[4]; | 'INIT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4] = {0};
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b... |
The right code snippet is:
int temp_sum[4]; | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4] = {0};
int temp_cout;
// Full adder for bit 0
F... |
The wrong part of the code is:
int temp_sum[4] = {0};
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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4] = {0};
int temp_cou... |
The wrong part of the code is:
int temp_sum[4] = {0};
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
int temp_sum[4]; | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
sum[i] = temp_sum[i] << 5;
The right code snippet is:
sum[i] = temp_sum[i]; | 'SHFT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
sum[i] = temp_sum[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:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
sum[i] = temp_sum[i] << 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:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
sum[i] = temp_sum[i] << 5;
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
sum[i] = temp_sum[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:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
for (int i = 0; i >= 0; i++) {
sum[i] = temp_sum[i];
}
The right code snippet is:
for (int i = 0; i < 4; i++) {
sum[i] = temp_sum[i];
} | 'INF' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
for (int i = 0; i < 4; i++) {
sum[i] = temp_sum[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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
for (int i = 0; i >= 0; i++) {
sum[i] = temp_sum[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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
for (int i = 0; i >= 0; i++) {
sum[i] = temp_sum[i];
}
The high-level-synthesis bug type of the code is: 'INF'
The right code snippet is:
for (int i = 0; i < 4; i++) {
sum[i] = temp_sum[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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
unsigned int temp_cout;
// Full adder for bit 0
FullAdder... |
The wrong part of the code is:
unsigned int temp_cout;
The right code snippet is:
int temp_cout; | 'USE' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
unsigned int temp_cout;
// Full adder for bit 0
FullAdder(a[0]... |
The right code snippet is:
int temp_cout; | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
unsigned int temp_cout;
// Full adder for bit 0
... |
The wrong part of the code is:
unsigned int temp_cout;
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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
unsigned int temp_... |
The wrong part of the code is:
unsigned int temp_cout;
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
int temp_cout; | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
// Manually unroll the loop for 2 iterations.
sum[0] = temp_sum[0];
sum[1] = temp_sum[1];
for (int i = 2; i < 4; i++) {
sum[i] = temp_sum[i];
}
The right code snippet is:
// No manual loop unrolling in the given code. | 'MLU' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No manual loop unrolling in the given 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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
// Manually unroll the loop for 2 iterations.
sum[0] = temp_sum[0];
sum[1] = temp_sum[1];
for (int i = 2; i < 4; i++) {
sum[i] = temp_sum[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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
// Manually unroll the loop for 2 iterations.
sum[0] = temp_sum[0];
sum[1] = temp_sum[1];
for (int i = 2; i < 4; i++) {
sum[i] = temp_sum[i];
}
The high-level-synthesis bug type of the code is: 'MLU'
The right code snippet is:
// No manual loop unrolling in the gi... | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
int cin = 0;
The right code snippet is:
// No variable initialized to zero instead of nonzero initializer in the given code. | 'ZERO' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No variable initialized to zero instead of nonzero initializer in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
int cin = 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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
int cin = 0;
The high-level-synthesis bug type of the code is: 'ZERO'
The right code snippet is:
// No variable initialized to zero instead of nonzero initializer in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
// Split buffer into two halves.
int temp_sum1[2];
int temp_sum2[2];
for (int i = 0; i < 2; i++) {
temp_sum1[i] = temp_sum[i];
temp_sum2[i] = temp_sum[i+2];
}
The right code snippet is:
// No buffer splitting in the given code. | 'BUF' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No buffer splitting in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
// Split buffer into two halves.
int temp_sum1[2];
int temp_sum2[2];
for (int i = 0; i < 2; i++) {
temp_sum1[i] = temp_sum[i];
temp_sum2[i] = temp_sum[i+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:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
// Split buffer into two halves.
int temp_sum1[2];
int temp_sum2[2];
for (int i = 0; i < 2; i++) {
temp_sum1[i] = temp_sum[i];
temp_sum2[i] = temp_sum[i+2];
}
The high-level-synthesis bug type of the code is: 'BUF'
The right code snippet is:
// No buffer split... | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
// Partition array 'a' into 2 partitions of size 2.
#pragma HLS array_partition variable=a complete dim=1
#pragma HLS array_partition variable=a cyclic factor=2 dim=1
The right code snippet is:
// No array partitioning in the given code. | 'APT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No array partitioning in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
// Partition array 'a' into 2 partitions of size 2.
#pragma HLS array_partition variable=a complete dim=1
#pragma HLS array_partition variable=a cyclic 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:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
// Partition array 'a' into 2 partitions of size 2.
#pragma HLS array_partition variable=a complete dim=1
#pragma HLS array_partition variable=a cyclic factor=2 dim=1
The high-level-synthesis bug type of the code is: 'APT'
The right code snippet is:
// No array partit... | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
// Partition array 'a' into 3 partitions of size 2 with factor 4.
#pragma HLS array_partition variable=a cyclic factor=4 dim=1
The right code snippet is:
// No factor not divisible error in the given code. | 'FND' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No factor not divisible error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
// Partition array 'a' into 3 partitions of size 2 with factor 4.
#pragma HLS array_partition variable=a cyclic factor=4 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:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
// Partition array 'a' into 3 partitions of size 2 with factor 4.
#pragma HLS array_partition variable=a cyclic factor=4 dim=1
The high-level-synthesis bug type of the code is: 'FND'
The right code snippet is:
// No factor not divisible error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
// Partition array 'a' into 2 partitions of size 2 with incorrect dimension.
#pragma HLS array_partition variable=a cyclic factor=2 dim=2
The right code snippet is:
// No dimension incorrect error in the given code. | 'DID' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No dimension incorrect error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
// Partition array 'a' into 2 partitions of size 2 with incorrect dimension.
#pragma HLS array_partition variable=a 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:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
// Partition array 'a' into 2 partitions of size 2 with incorrect dimension.
#pragma HLS array_partition variable=a cyclic factor=2 dim=2
The high-level-synthesis bug type of the code is: 'DID'
The right code snippet is:
// No dimension incorrect error in the given co... | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
// Move the FullAdder function call outside the loop.
for (int i = 0; i < 4; i++) {
FullAdder(a[i], b[i], temp_cout, temp_sum[i], temp_cout);
sum[i] = temp_sum[i];
}
cout = temp_cout;
The right code snippet is:
// No dataflow position error in the given code. | 'DFP' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No dataflow position error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
// Move the FullAdder function call outside the loop.
for (int i = 0; i < 4; i++) {
FullAdder(a[i], b[i], temp_cout, temp_sum[i], temp_cout);
sum[i] = temp_sum[i];
}
cout = temp_cout;
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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
// Move the FullAdder function call outside the loop.
for (int i = 0; i < 4; i++) {
FullAdder(a[i], b[i], temp_cout, temp_sum[i], temp_cout);
sum[i] = temp_sum[i];
}
cout = temp_cout;
The high-level-synthesis bug type of the code is: 'DFP'
The right code snippet i... | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
// Incorrect data access pattern for array 'a'.
#pragma HLS interface ap_memory depth=4 port=a
The right code snippet is:
// No incorrect data access pattern error in the given code. | 'IDAP' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No incorrect data access pattern error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
// Incorrect data access pattern for array 'a'.
#pragma HLS interface ap_memory depth=4 port=a
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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
// Incorrect data access pattern for array 'a'.
#pragma HLS interface ap_memory depth=4 port=a
The high-level-synthesis bug type of the code is: 'IDAP'
The right code snippet is:
// No incorrect data access pattern error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
// Random access of m_axi interface for array 'a'.
#pragma HLS interface m_axi port=a offset=slave
The right code snippet is:
// No m_axi interface access error in the given code. | 'RAMB' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No m_axi interface access error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
// Random access of m_axi interface for array 'a'.
#pragma HLS interface m_axi port=a 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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
// Random access of m_axi interface for array 'a'.
#pragma HLS interface m_axi port=a offset=slave
The high-level-synthesis bug type of the code is: 'RAMB'
The right code snippet is:
// No m_axi interface access error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
// Map scalar value to array interface.
#pragma HLS interface ap_fifo depth=4 port=cin
The right code snippet is:
// No scalar to array interface mapping error in the given code. | 'SMA' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No scalar to array interface mapping error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
// Map scalar value to array interface.
#pragma HLS interface ap_fifo depth=4 port=cin
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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
// Map scalar value to array interface.
#pragma HLS interface ap_fifo depth=4 port=cin
The high-level-synthesis bug type of the code is: 'SMA'
The right code snippet is:
// No scalar to array interface mapping error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
// Map array value to scalar interface.
#pragma HLS interface s_axilite port=sum
The right code snippet is:
// No array to scalar interface mapping error in the given code. | 'AMS' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No array to scalar interface mapping error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
// Map array value to scalar interface.
#pragma HLS interface s_axilite port=sum
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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
// Map array value to scalar interface.
#pragma HLS interface s_axilite port=sum
The high-level-synthesis bug type of the code is: 'AMS'
The right code snippet is:
// No array to scalar interface mapping error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[... |
The wrong part of the code is:
The right code snippet is:
// No multi-level pipelining error in the given code. | 'MLP' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdder(a[0], b[0], c... |
The right code snippet is:
// No multi-level pipelining error in the given code. | '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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
// Full adder for bit 0
FullAdd... |
The wrong part of the code is:
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 Adder4 (
int a[4],
int b[4],
int cin,
int sum[4],
int& cout
) {
int temp_sum[4];
int temp_cout;
... |
The wrong part of the code is:
The high-level-synthesis bug type of the code is: 'MLP'
The right code snippet is:
// No multi-level pipelining error in the given code. | '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_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INTERFACE ap_n... |
The wrong part of the code is:
mux_out = sel_b1 ? b : (sel_b2 ? a : b[10]);
The right code snippet is:
mux_out = sel_b1 ? b : (sel_b2 ? a : 0); | 'OOB' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INTERFACE ap_none p... |
The right code snippet is:
mux_out = sel_b1 ? b : (sel_b2 ? a : 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:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INT... |
The wrong part of the code is:
mux_out = sel_b1 ? b : (sel_b2 ? a : b[10]);
The high-level-synthesis bug type of the code is: 'OOB' | 'OOB' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFAC... |
The wrong part of the code is:
mux_out = sel_b1 ? b : (sel_b2 ? a : b[10]);
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
mux_out = sel_b1 ? b : (sel_b2 ? a : 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:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INTERFACE ap_n... |
The wrong part of the code is:
bool mux_out = 0;
The right code snippet is:
bool mux_out; | 'INIT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INTERFACE ap_none p... |
The right code snippet is:
bool mux_out; | 'INIT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INT... |
The wrong part of the code is:
bool mux_out = 0;
The high-level-synthesis bug type of the code is: 'INIT' | 'INIT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFAC... |
The wrong part of the code is:
bool mux_out = 0;
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
bool mux_out; | 'INIT' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INTERFACE ap_n... |
The wrong part of the code is:
xor_out = a << b;
The right code snippet is:
xor_out = a ^ b; | 'SHFT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INTERFACE ap_none p... |
The right code snippet is:
xor_out = a ^ b; | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INT... |
The wrong part of the code is:
xor_out = a << b;
The high-level-synthesis bug type of the code is: 'SHFT' | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFAC... |
The wrong part of the code is:
xor_out = a << b;
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
xor_out = a ^ b; | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INTERFACE ap_n... |
The wrong part of the code is:
while(1);
The right code snippet is:
#pragma HLS PIPELINE II=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 ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INTERFACE ap_none p... |
The right code snippet is:
#pragma HLS PIPELINE II=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 ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INT... |
The wrong part of the code is:
while(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 ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFAC... |
The wrong part of the code is:
while(1);
The high-level-synthesis bug type of the code is: 'INF'
The right code snippet is:
#pragma HLS PIPELINE II=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 ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INTERFACE ap_n... |
The wrong part of the code is:
out = sel_b1 | sel_b2 ? (int)mux_out : (int)xor_out;
The right code snippet is:
out = sel_b1 | sel_b2 ? mux_out : xor_out; | 'USE' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INTERFACE ap_none p... |
The right code snippet is:
out = sel_b1 | sel_b2 ? mux_out : xor_out; | 'USE' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFACE ap_none port=sel_b2
#pragma HLS INT... |
The wrong part of the code is:
out = sel_b1 | sel_b2 ? (int)mux_out : (int)xor_out;
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 ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=sel_b1
#pragma HLS INTERFAC... |
The wrong part of the code is:
out = sel_b1 | sel_b2 ? (int)mux_out : (int)xor_out;
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
out = sel_b1 | sel_b2 ? mux_out : xor_out; | 'USE' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.