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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
count_reg[5]++; // Accessing an out-of-bounds bit of the ap_uint variable
The right code snippet is:
count_reg++; | 'OOB' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
count_reg++; | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
count_reg[5]++; // Accessing an out-of-bounds bit of the ap_uint variable
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
count_reg[5]++; // Accessing an out-of-bounds bit of the ap_uint variable
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
count_reg++; | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
ap_uint<4> count_reg; // Declaration without initialization
The right code snippet is:
ap_uint<4> count_reg = 0; | 'INIT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
ap_uint<4> count_reg = 0; | 'INIT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
ap_uint<4> count_reg; // Declaration without initialization
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
ap_uint<4> count_reg; // Declaration without initialization
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
ap_uint<4> count_reg = 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:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
count_reg << 5; // Shifting by an out-of-bounds amount
The right code snippet is:
count_reg++; | 'SHFT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
count_reg++; | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
count_reg << 5; // Shifting by an out-of-bounds amount
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
count_reg << 5; // Shifting by an out-of-bounds amount
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
count_reg++; | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
while (count_reg < 16) { // Incorrect loop termination condition
count_reg++;
}
The right code snippet is:
while (true) { | 'INF' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
while (true) { | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
while (count_reg < 16) { // Incorrect loop termination condition
count_reg++;
}
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
while (count_reg < 16) { // Incorrect loop termination condition
count_reg++;
}
The high-level-synthesis bug type of the code is: 'INF'
The right code snippet is:
while (true) { | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
int clk_val;
int reset_val;
// Unintended sign extension of bool to int
The right code snippet is:
bool clk_val;
bool reset_val; | 'USE' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
bool clk_val;
bool reset_val; | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
int clk_val;
int reset_val;
// Unintended sign extension of bool to int
The high-level-synthesis bug type of the code is: 'USE' | 'USE' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
int clk_val;
int reset_val;
// Unintended sign extension of bool to int
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
bool clk_val;
bool reset_val; | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
for (int i = 0; i < 4; i++) {
bool clk_val;
bool reset_val;
if (!clk.empty() && !reset.empty() && !count.full()) {
clk.read(clk_val);
reset.read(reset_val);
if (reset_val) {
count_reg = 0;
} else {
count_reg++;... | 'MLU' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No manual loop unrolling in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
for (int i = 0; i < 4; i++) {
bool clk_val;
bool reset_val;
if (!clk.empty() && !reset.empty() && !count.full()) {
clk.read(clk_val);
reset.read(reset_val);
if (reset_val) {
count_reg = 0;
} else {
count_reg++;... | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
for (int i = 0; i < 4; i++) {
bool clk_val;
bool reset_val;
if (!clk.empty() && !reset.empty() && !count.full()) {
clk.read(clk_val);
reset.read(reset_val);
if (reset_val) {
count_reg = 0;
} else {
count_reg++;... | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
ap_uint<4> count_reg = 1; // Variable initialized to nonzero value
The right code snippet is:
ap_uint<4> count_reg = 0; | 'ZERO' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
ap_uint<4> count_reg = 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:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
ap_uint<4> count_reg = 1; // Variable initialized to nonzero value
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
ap_uint<4> count_reg = 1; // Variable initialized to nonzero value
The high-level-synthesis bug type of the code is: 'ZERO'
The right code snippet is:
ap_uint<4> count_reg = 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:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
memcpy(count_reg, &clk_val, sizeof(clk_val)); // Copying from the wrong half of a split buffer
The right code snippet is:
// No buffer copying in the original code | 'BUF' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No buffer copying in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
memcpy(count_reg, &clk_val, sizeof(clk_val)); // Copying from the wrong half of a split buffer
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
memcpy(count_reg, &clk_val, sizeof(clk_val)); // Copying from the wrong half of a split buffer
The high-level-synthesis bug type of the code is: 'BUF'
The right code snippet is:
// No buffer copying in the original code | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
#pragma HLS array_partition variable=count_reg cyclic factor=2 dim=1 // Incorrect array partition type
The right code snippet is:
// No array partitioning in the original code | 'APT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No array partitioning in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
#pragma HLS array_partition variable=count_reg cyclic factor=2 dim=1 // Incorrect array partition type
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
#pragma HLS array_partition variable=count_reg cyclic factor=2 dim=1 // Incorrect array partition type
The high-level-synthesis bug type of the code is: 'APT'
The right code snippet is:
// No array partitioning in the original code | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
#pragma HLS array_partition variable=count_reg cyclic factor=3 dim=1 // Factor not divisible
The right code snippet is:
// No array partitioning in the original code | 'FND' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No array partitioning in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
#pragma HLS array_partition variable=count_reg cyclic factor=3 dim=1 // Factor not divisible
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
#pragma HLS array_partition variable=count_reg cyclic factor=3 dim=1 // Factor not divisible
The high-level-synthesis bug type of the code is: 'FND'
The right code snippet is:
// No array partitioning in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
#pragma HLS array_partition variable=count_reg cyclic factor=2 dim=2 // Incorrect dimension
The right code snippet is:
// No array partitioning in the original code | 'DID' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No array partitioning in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
#pragma HLS array_partition variable=count_reg cyclic factor=2 dim=2 // Incorrect dimension
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
#pragma HLS array_partition variable=count_reg cyclic factor=2 dim=2 // Incorrect dimension
The high-level-synthesis bug type of the code is: 'DID'
The right code snippet is:
// No array partitioning in the original code | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
#pragma HLS dataflow loop_flatten // Incorrect dataflow position
The right code snippet is:
// No dataflow pragma in the original code | 'DFP' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No dataflow pragma in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
#pragma HLS dataflow loop_flatten // Incorrect dataflow position
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
#pragma HLS dataflow loop_flatten // Incorrect dataflow position
The high-level-synthesis bug type of the code is: 'DFP'
The right code snippet is:
// No dataflow pragma in the original code | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
#pragma HLS interface ap_fifo port=count // Incorrect interface type
The right code snippet is:
// No interface pragma in the original code | 'IDAP' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No interface pragma in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
#pragma HLS interface ap_fifo port=count // Incorrect interface type
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
#pragma HLS interface ap_fifo port=count // Incorrect interface type
The high-level-synthesis bug type of the code is: 'IDAP'
The right code snippet is:
// No interface pragma in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
#pragma HLS interface m_axi port=count offset=off // Random access to m_axi interface
The right code snippet is:
// No m_axi interface in the original code | 'RAMB' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No m_axi interface in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
#pragma HLS interface m_axi port=count offset=off // Random access to m_axi interface
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
#pragma HLS interface m_axi port=count offset=off // Random access to m_axi interface
The high-level-synthesis bug type of the code is: 'RAMB'
The right code snippet is:
// No m_axi interface in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
#pragma HLS interface s_axilite port=count // Array mapped to scalar interface
The right code snippet is:
// No array interface in the original code | 'SMA' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No array interface in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
#pragma HLS interface s_axilite port=count // Array mapped to scalar interface
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
#pragma HLS interface s_axilite port=count // Array mapped to scalar interface
The high-level-synthesis bug type of the code is: 'SMA'
The right code snippet is:
// No array interface in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
#pragma HLS interface bram port=clk bundle=bram // Scalar mapped to array interface
The right code snippet is:
// No scalar interface in the original code | 'AMS' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No scalar interface in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
#pragma HLS interface bram port=clk bundle=bram // Scalar mapped to array interface
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
#pragma HLS interface bram port=clk bundle=bram // Scalar mapped to array interface
The high-level-synthesis bug type of the code is: 'AMS'
The right code snippet is:
// No scalar interface in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
#pragma HLS pipeline II=2 // Multi-level pipelining
The right code snippet is:
// No pipeline pragma in the original code | 'MLP' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No pipeline pragma in the original 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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
#pragma HLS pipeline II=2 // Multi-level pipelining
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
#pragma HLS pipeline II=2 // Multi-level pipelining
The high-level-synthesis bug type of the code is: 'MLP'
The right code snippet is:
// No pipeline pragma in the original 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:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS IN... |
The wrong part of the code is:
#pragma HLS unroll factor=2 // Inner loops not fully unrolled
The right code snippet is:
// No unroll pragma in the original code | 'ILNU' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFA... |
The right code snippet is:
// No unroll pragma in the original code | '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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pr... |
The wrong part of the code is:
#pragma HLS unroll factor=2 // Inner loops not fully unrolled
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 counter(
hls::stream<bool>& clk,
hls::stream<bool>& reset,
hls::stream<ap_uint<4>>& count
) {
#pragma HLS INTER... |
The wrong part of the code is:
#pragma HLS unroll factor=2 // Inner loops not fully unrolled
The high-level-synthesis bug type of the code is: 'ILNU'
The right code snippet is:
// No unroll pragma in the original code | 'ILNU' |
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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none po... |
The wrong part of the code is:
full_adder(a[5], b[0], cin, sum_wire[0], c1);
The right code snippet is:
full_adder(a[0], b[0], cin, sum_wire[0], c1); | '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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none port=co... |
The right code snippet is:
full_adder(a[0], b[0], cin, sum_wire[0], c1); | '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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE... |
The wrong part of the code is:
full_adder(a[5], b[0], cin, sum_wire[0], c1);
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=cin
#pragma HLS INTERFACE a... |
The wrong part of the code is:
full_adder(a[5], b[0], cin, sum_wire[0], c1);
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
full_adder(a[0], b[0], cin, sum_wire[0], c1); | '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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none po... |
The wrong part of the code is:
bool s1, s2, s3=1;
The right code snippet is:
bool s1, s2, s3; | '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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none port=co... |
The right code snippet is:
bool s1, s2, s3; | '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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE... |
The wrong part of the code is:
bool s1, s2, s3=1;
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=cin
#pragma HLS INTERFACE a... |
The wrong part of the code is:
bool s1, s2, s3=1;
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
bool s1, s2, s3; | '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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none po... |
The wrong part of the code is:
and_gate(s2, a, b<<5);
The right code snippet is:
and_gate(s2, 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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none port=co... |
The right code snippet is:
and_gate(s2, 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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE... |
The wrong part of the code is:
and_gate(s2, a, b<<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:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE a... |
The wrong part of the code is:
and_gate(s2, a, b<<5);
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
and_gate(s2, 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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none po... |
The wrong part of the code is:
for (int i = 0; i >= 0; i++) {
The right code snippet is:
for (int i = 0; i < 4; i++) { | '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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none port=co... |
The right code snippet is:
for (int i = 0; i < 4; 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:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE... |
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:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE a... |
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 < 4; 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:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none po... |
The wrong part of the code is:
signed out = in1 | in2;
The right code snippet is:
out = in1 | in2; | '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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none port=co... |
The right code snippet is:
out = in1 | in2; | '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=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE... |
The wrong part of the code is:
signed out = in1 | in2;
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=cin
#pragma HLS INTERFACE a... |
The wrong part of the code is:
signed out = in1 | in2;
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
out = in1 | in2; | '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 ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none po... |
The wrong part of the code is:
for (int i = 0; i < 2; i++) {
The right code snippet is:
for (int i = 0; i < 4; 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 ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none port=co... |
The right code snippet is:
for (int i = 0; i < 4; 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 ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE... |
The wrong part of the code is:
for (int i = 0; i < 2; 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:
#pragma HLS INTERFACE ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE a... |
The wrong part of the code is:
for (int i = 0; i < 2; i++) {
The high-level-synthesis bug type of the code is: 'MLU'
The right code snippet is:
for (int i = 0; i < 4; 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 ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none po... |
The wrong part of the code is:
int sum_wire[4] = {0};
The right code snippet is:
int sum_wire[4]; | '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_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE ap_none port=co... |
The right code snippet is:
int sum_wire[4]; | '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_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE ap_none port=sum
#pragma HLS INTERFACE... |
The wrong part of the code is:
int sum_wire[4] = {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 ap_none port=a
#pragma HLS INTERFACE ap_none port=b
#pragma HLS INTERFACE ap_none port=cin
#pragma HLS INTERFACE a... |
The wrong part of the code is:
int sum_wire[4] = {0};
The high-level-synthesis bug type of the code is: 'ZERO'
The right code snippet is:
int sum_wire[4]; | 'ZERO' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.