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 and_gate(bool A1[2], B1[2], C1[2], Y1[2];
#pragma HLS ARRAY_PARTITION variable=A1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=B1 cyclic factor=2 dim=2
#pragma HL... |
The wrong part of the code is:
bool A1[2], B1[2], C1[2], Y1[2];
#pragma HLS ARRAY_PARTITION variable=A1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=B1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=C1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=Y1 cyclic factor=2 dim=2... | 'DID' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void and_gate(bool A1[2], B1[2], C1[2], Y1[2];
#pragma HLS ARRAY_PARTITION variable=A1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=B1 cyclic factor=2 dim=2
#pragma HLS ARR... |
The right code snippet is:
bool A, bool B, bool C, bool &Y | '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 and_gate(bool A1[2], B1[2], C1[2], Y1[2];
#pragma HLS ARRAY_PARTITION variable=A1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=B1 cyclic factor=2 dim=2... |
The wrong part of the code is:
bool A1[2], B1[2], C1[2], Y1[2];
#pragma HLS ARRAY_PARTITION variable=A1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=B1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=C1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=Y1 cyclic factor=2 dim=2... | '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 and_gate(bool A1[2], B1[2], C1[2], Y1[2];
#pragma HLS ARRAY_PARTITION variable=A1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTIT... |
The wrong part of the code is:
bool A1[2], B1[2], C1[2], Y1[2];
#pragma HLS ARRAY_PARTITION variable=A1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=B1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=C1 cyclic factor=2 dim=2
#pragma HLS ARRAY_PARTITION variable=Y1 cyclic factor=2 dim=2... | '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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A;
bool B;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = A;
else
OUT = B;
The right code snippet is:
bool A = false;
bool B;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = A;
else
OUT = B; | INIT |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
The wrong part of the code is:
bool A;
bool B;
bool SEL ... |
The right code snippet is:
bool A = false;
bool B;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = A;
else
OUT = 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:
```
void mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A;
bool B;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = A;
else
OUT = B;
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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A;
bool B;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = A;
else
OUT = B;
The high-level-synthesis bug type of the code is: INIT
The right code snippet is:
bool A = false;
bool B;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = A;
else
OUT = 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:
```
void mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A[2] = {false, true};
bool B = true;
bool SEL = 3;
bool OUT;
if (SEL == 0)
OUT = A[SEL];
else
OUT = B;
The right code snippet is:
bool A[2] = {false, true};
bool B = true;
bool SEL = 2;
bool OUT;
if (SEL == 0)
OUT = A[SEL];
else
OUT = B; | OOB |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
The wrong part of the code is:
bool A[2] = {false, true}... |
The right code snippet is:
bool A[2] = {false, true};
bool B = true;
bool SEL = 2;
bool OUT;
if (SEL == 0)
OUT = A[SEL];
else
OUT = B; | 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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A[2] = {false, true};
bool B = true;
bool SEL = 3;
bool OUT;
if (SEL == 0)
OUT = A[SEL];
else
OUT = B;
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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A[2] = {false, true};
bool B = true;
bool SEL = 3;
bool OUT;
if (SEL == 0)
OUT = A[SEL];
else
OUT = B;
The high-level-synthesis bug type of the code is: OOB
The right code snippet is:
bool A[2] = {false, true};
bool B = true;
bool SEL = 2;
bool OUT;
if ... | 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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A = false;
bool B = true;
bool SEL = 2;
bool OUT;
for (int i = 0; i <= SEL; i++)
{
if (SEL == 0)
OUT = A;
else
OUT = B;
}
The right code snippet is:
bool A = false;
bool B = true;
bool SEL = 2;
bool OUT;
for (int i = 0; i < SEL; i++)
{
i... | INF |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
The wrong part of the code is:
bool A = false;
bool B = ... |
The right code snippet is:
bool A = false;
bool B = true;
bool SEL = 2;
bool OUT;
for (int i = 0; i < SEL; i++)
{
if (SEL == 0)
OUT = A;
else
OUT = B;
} | 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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A = false;
bool B = true;
bool SEL = 2;
bool OUT;
for (int i = 0; i <= SEL; i++)
{
if (SEL == 0)
OUT = A;
else
OUT = B;
}
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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A = false;
bool B = true;
bool SEL = 2;
bool OUT;
for (int i = 0; i <= SEL; i++)
{
if (SEL == 0)
OUT = A;
else
OUT = B;
}
The high-level-synthesis bug type of the code is: INF
The right code snippet is:
bool A = false;
bool B = true;
bool... | 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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
short int A = -1;
unsigned short int B = 1;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = A;
else
OUT = B;
The right code snippet is:
short int A = -1;
unsigned short int B = 1;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = (bool)A;
else
OUT = (bool)B; | USE |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
The wrong part of the code is:
short int A = -1;
unsigne... |
The right code snippet is:
short int A = -1;
unsigned short int B = 1;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = (bool)A;
else
OUT = (bool)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:
```
void mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
short int A = -1;
unsigned short int B = 1;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = A;
else
OUT = 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:
```
void mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
short int A = -1;
unsigned short int B = 1;
bool SEL = true;
bool OUT;
if (SEL == 0)
OUT = A;
else
OUT = B;
The high-level-synthesis bug type of the code is: USE
The right code snippet is:
short int A = -1;
unsigned short int B = 1;
bool SEL = true;
bool OUT;... | 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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A[2] = {false, true};
bool B[2] = {true, false};
bool SEL = true;
bool OUT[2];
#pragma HLS unroll factor=1
for (int i = 0; i < 2; i++)
{
if (SEL == 0)
OUT[i] = A[i];
else
OUT[i] = B[i];
}
The right code snippet is:
bool A[2] = {false, true};
... | ILNU |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
The wrong part of the code is:
bool A[2] = {false, true}... |
The right code snippet is:
bool A[2] = {false, true};
bool B[2] = {true, false};
bool SEL = true;
bool OUT[2];
#pragma HLS unroll factor=2
for (int i = 0; i < 2; i++)
{
if (SEL == 0)
OUT[i] = A[i];
else
OUT[i] = B[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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A[2] = {false, true};
bool B[2] = {true, false};
bool SEL = true;
bool OUT[2];
#pragma HLS unroll factor=1
for (int i = 0; i < 2; i++)
{
if (SEL == 0)
OUT[i] = A[i];
else
OUT[i] = B[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 mux_2to1 (bool A, bool B, bool SEL, bool& OUT) {
if (SEL == 0)
OUT = A;
else
OUT = B;
}
```
|
The wrong part of the code is:
bool A[2] = {false, true};
bool B[2] = {true, false};
bool SEL = true;
bool OUT[2];
#pragma HLS unroll factor=1
for (int i = 0; i < 2; i++)
{
if (SEL == 0)
OUT[i] = A[i];
else
OUT[i] = B[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 right code snippet
The buggy code is:
// HLS code for prcfg_dac module
#include <ap_int.h>
const ap_uint<8> RP_ID = 0xA1;
const ap_uint<4> CHANNEL_ID = 0;
void prcfg_dac(
ap_uint<32> control,
ap_uint<1> src_dac_e... |
The wrong part of the code is:
switch(counter) {
case 0:
sin_tone = 0x0000;
cos_tone = 0x7FFF;
break;
case 1:
sin_tone = 0x5A82;
cos_tone = 0x5A82;
break;
case 2:
sin_tone = 0x7FFF;
cos_tone ... | 'OOB': Out-of-bounds array access |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
// HLS code for prcfg_dac module
#include <ap_int.h>
const ap_uint<8> RP_ID = 0xA1;
const ap_uint<4> CHANNEL_ID = 0;
void prcfg_dac(
ap_uint<32> control,
ap_uint<1> src_dac_enable... |
The right code snippet is:
switch(counter) {
case 0:
sin_tone = 0x0000;
cos_tone = 0x7FFF;
break;
case 1:
sin_tone = 0x5A82;
cos_tone = 0x5A82;
break;
case 2:
sin_tone = 0x7FFF;
cos_tone = 0x... | 'OOB': Out-of-bounds array access |
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:
// HLS code for prcfg_dac module
#include <ap_int.h>
const ap_uint<8> RP_ID = 0xA1;
const ap_uint<4> CHANNEL_ID = 0;
void prcfg_dac(
ap_uint<32> control,
ap_uint<1... |
The wrong part of the code is:
switch(counter) {
case 0:
sin_tone = 0x0000;
cos_tone = 0x7FFF;
break;
case 1:
sin_tone = 0x5A82;
cos_tone = 0x5A82;
break;
case 2:
sin_tone = 0x7FFF;
cos_tone ... | 'OOB': Out-of-bounds array access |
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:
// HLS code for prcfg_dac module
#include <ap_int.h>
const ap_uint<8> RP_ID = 0xA1;
const ap_uint<4> CHANNEL_ID = 0;
void prcfg_dac(
... |
The wrong part of the code is:
switch(counter) {
case 0:
sin_tone = 0x0000;
cos_tone = 0x7FFF;
break;
case 1:
sin_tone = 0x5A82;
cos_tone = 0x5A82;
break;
case 2:
sin_tone = 0x7FFF;
cos_tone ... | 'OOB': Out-of-bounds array access |
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
if (in2) {
out = counter;
state = 0;
} else {
counter--;
}
The right code snippet is:
if (in2) {
out = counter;
state = 0;
} else {
counter++;
} | 'OOB' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
if (in2) {
out = counter;
state = 0;
} else {
counter++;
} | 'OOB' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
if (in2) {
out = counter;
state = 0;
} else {
counter--;
}
The high-level-synthesis bug type of the code is: 'OOB' | 'OOB' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
if (in2) {
out = counter;
state = 0;
} else {
counter--;
}
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
if (in2) {
out = counter;
state = 0;
} else {
counter++;
} | 'OOB' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
static ap_uint<32> counter;
static ap_uint<2> state;
The right code snippet is:
static ap_uint<32> counter = 0;
static ap_uint<2> state = 0; | 'INIT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
static ap_uint<32> counter = 0;
static ap_uint<2> state = 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
static ap_uint<32> counter;
static ap_uint<2> state;
The high-level-synthesis bug type of the code is: 'INIT' | 'INIT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
static ap_uint<32> counter;
static ap_uint<2> state;
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
static ap_uint<32> counter = 0;
static ap_uint<2> state = 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
counter << 33;
The right code snippet is:
counter++; | 'SHFT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
counter++; | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
counter << 33;
The high-level-synthesis bug type of the code is: 'SHFT' | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
counter << 33;
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
counter++; | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
while (1) {
counter++;
}
The right code snippet is:
if (in2) {
out = counter;
state = 0;
} else {
counter++;
} | 'INF' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
if (in2) {
out = counter;
state = 0;
} else {
counter++;
} | 'INF' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
while (1) {
counter++;
}
The high-level-synthesis bug type of the code is: 'INF' | 'INF' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
while (1) {
counter++;
}
The high-level-synthesis bug type of the code is: 'INF'
The right code snippet is:
if (in2) {
out = counter;
state = 0;
} else {
counter++;
} | 'INF' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
ap_int<32> out = 0;
The right code snippet is:
ap_uint<32> out = 0; | 'USE' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
ap_uint<32> out = 0; | 'USE' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
ap_int<32> out = 0;
The high-level-synthesis bug type of the code is: 'USE' | 'USE' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
ap_int<32> out = 0;
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
ap_uint<32> out = 0; | 'USE' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
for (int i = 0; i < 10; i+=2) {
// Loop body
}
The right code snippet is:
for (int i = 0; i < 10; i++) {
// Loop body
} | 'MLU' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
for (int i = 0; i < 10; i++) {
// 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
for (int i = 0; i < 10; i+=2) {
// 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
for (int i = 0; i < 10; i+=2) {
// Loop body
}
The high-level-synthesis bug type of the code is: 'MLU'
The right code snippet is:
for (int i = 0; i < 10; i++) {
// 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
static ap_uint<32> counter = {0};
The right code snippet is:
static ap_uint<32> counter = 0; | 'ZERO' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
static ap_uint<32> counter = 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
static ap_uint<32> counter = {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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
static ap_uint<32> counter = {0};
The high-level-synthesis bug type of the code is: 'ZERO'
The right code snippet is:
static ap_uint<32> counter = 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
memcpy(buffer1, buffer2 + sizeof(buffer1), 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
memcpy(buffer1, buffer2 + sizeof(buffer1), 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
memcpy(buffer1, buffer2 + sizeof(buffer1), 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
#pragma HLS array_partition variable=buffer1 cyclic
The right code snippet is:
#pragma HLS array_partition variable=buffer1 complete | 'APT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
#pragma HLS array_partition variable=buffer1 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
#pragma HLS array_partition variable=buffer1 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
#pragma HLS array_partition variable=buffer1 cyclic
The high-level-synthesis bug type of the code is: 'APT'
The right code snippet is:
#pragma HLS array_partition variable=buffer1 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
#pragma HLS array_partition variable=buffer1 cyclic factor=3
The right code snippet is:
#pragma HLS array_partition variable=buffer1 cyclic factor=4 | 'FND' |
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
#pragma HLS array_partition variable=buffer1 cyclic factor=4 | '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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
#pragma HLS array_partition variable=buffer1 cyclic 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
#pragma HLS array_partition variable=buffer1 cyclic factor=3
The high-level-synthesis bug type of the code is: 'FND'
The right code snippet is:
#pragma HLS array_partition variable=buffer1 cyclic factor=4 | 'FND' |
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
#pragma HLS array_partition variable=buffer1 cyclic factor=4 dim=2
The right code snippet is:
#pragma HLS array_partition variable=buffer1 cyclic factor=4 dim=1 | 'DID' |
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
#pragma HLS array_partition variable=buffer1 cyclic factor=4 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
#pragma HLS array_partition variable=buffer1 cyclic factor=4 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
#pragma HLS array_partition variable=buffer1 cyclic factor=4 dim=2
The high-level-synthesis bug type of the code is: 'DID'
The right code snippet is:
#pragma HLS array_partition variable=buffer1 cyclic factor=4 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
#pragma HLS dataflow wait
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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
#pragma HLS dataflow wait
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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
#pragma HLS dataflow wait
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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
#pragma HLS interface ap_vld port=in1
The right code snippet is:
#pragma HLS interface ap_none port=in1 | 'IDAP' |
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
#pragma HLS interface ap_none port=in1 | '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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
#pragma HLS interface ap_vld port=in1
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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
#pragma HLS interface ap_vld port=in1
The high-level-synthesis bug type of the code is: 'IDAP'
The right code snippet is:
#pragma HLS interface ap_none port=in1 | 'IDAP' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
#pragma HLS interface m_axi port=buffer1 random
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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
#pragma HLS interface m_axi port=buffer1 random
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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
#pragma HLS interface m_axi port=buffer1 random
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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
#pragma HLS interface ap_none port=buffer1
The right code snippet is:
#pragma HLS interface ap_memory port=buffer1 | 'SMA' |
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
#pragma HLS interface ap_memory 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
#pragma HLS interface ap_none 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
#pragma HLS interface ap_none port=buffer1
The high-level-synthesis bug type of the code is: 'SMA'
The right code snippet is:
#pragma HLS interface ap_memory 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:
#include <ap_int.h>
void TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
#pragma HLS interface ap_memory port=out
The right code snippet is:
#pragma HLS interface ap_none port=out | '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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
#pragma HLS interface ap_none port=out | '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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
#pragma HLS interface ap_memory port=out
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
#pragma HLS interface ap_memory port=out
The high-level-synthesis bug type of the code is: 'AMS'
The right code snippet is:
#pragma HLS interface ap_none port=out | '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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=... |
The wrong part of the code is:
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 5; j++) {
// Loop body
}
}
The right code snippet is:
for (int i = 0; i < 10; i++) {
// Loop body
} | '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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=in1
... |
The right code snippet is:
for (int i = 0; i < 10; i++) {
// Loop body
} | '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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap... |
The wrong part of the code is:
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 5; j++) {
// Loop body
}
}
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 TDC(ap_uint<1> in1, ap_uint<1> in2, ap_uint<1> clk, ap_uint<32> &out) {
#pragma HLS INTERFACE ap_ctrl_none p... |
The wrong part of the code is:
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 5; j++) {
// Loop body
}
}
The high-level-synthesis bug type of the code is: 'ILNU'
The right code snippet is:
for (int i = 0; i < 10; i++) {
// Loop body
} | 'ILNU' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.