instruction stringlengths 139 357k | response stringlengths 36 4.54k | buggy_type stringclasses 745
values |
|---|---|---|
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
bool temp;
X = temp | B | C;
}
|
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
bool temp;
X = temp | B | C;
}
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | 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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
bool temp;
X = temp | B | C;
}
The wrong part of t... |
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | 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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
bool temp;
X = temp | B | C;
}
|
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
bool temp;
X = temp | B | C;
}
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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
bool ... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
bool temp;
X = temp | B | C;
}
The high-level-synthesis bug type of the code is: INIT
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | 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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
while(true){
X = A | B | C;
}
}
|
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
while(true){
X = A | B | C;
}
}
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | 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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
while(true){
X = A | B | C;
}
}
The wrong ... |
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | 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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
while(true){
X = A | B | C;
}
... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
while(true){
X = A | B | C;
}
}
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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
while... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
while(true){
X = A | B | C;
}
}
The high-level-synthesis bug type of the code is: INF
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | 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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
unsigned char temp = 0xFF;
X = temp | B | C;
}
... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
unsigned char temp = 0xFF;
X = temp | B | C;
}
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | 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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
unsigned char temp = 0xFF;
X = temp | B | C;
}
The... |
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | 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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
unsigned char temp = 0xFF;
X = temp | ... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
unsigned char temp = 0xFF;
X = temp | B | C;
}
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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
unsig... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
unsigned char temp = 0xFF;
X = temp | B | C;
}
The high-level-synthesis bug type of the code is: USE
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | 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 port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
bool buffer[2];
buffer[0] = A | B;
buffer[1] ... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
bool buffer[2];
buffer[0] = A | B;
buffer[1] = C;
X = buffer[1];
}
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | BUF |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
bool buffer[2];
buffer[0] = A | B;
buffer[1] = C;
... |
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | BUF |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
bool buffer[2];
buffer[0] = A | B;
... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
bool buffer[2];
buffer[0] = A | B;
buffer[1] = C;
X = buffer[1];
}
The high-level-synthesis bug type of the code is: BUF | BUF |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
bool ... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
bool buffer[2];
buffer[0] = A | B;
buffer[1] = C;
X = buffer[1];
}
The high-level-synthesis bug type of the code is: BUF
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A ... | BUF |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
#pragma HLS unroll
for(int i=0;i<3;i++){
... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
#pragma HLS unroll
for(int i=0;i<3;i++){
X = A | B | C;
}
}
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | ILNU |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
#pragma HLS unroll
for(int i=0;i<3;i++){
X = A... |
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | B | C;
} | 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:
#pragma HLS INTERFACE port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
#pragma HLS unroll
for(int i=0;i<3;i++... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
#pragma HLS unroll
for(int i=0;i<3;i++){
X = A | B | C;
}
}
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:
#pragma HLS INTERFACE port=X mode=out
#pragma HLS INTERFACE port=A,B,C mode=in
void my_or3(bool A, bool B, bool C, bool& X) {
#prag... |
The wrong part of the code is:
void my_or3(bool A, bool B, bool C, bool& X) {
#pragma HLS unroll
for(int i=0;i<3;i++){
X = A | B | C;
}
}
The high-level-synthesis bug type of the code is: ILNU
The right code snippet is:
void my_or3(bool A, bool B, bool C, bool& X) {
X = A | ... | 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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
if (counter > 10) {
counter = 0;
}
The right code snippet is:
if (counter >= 10) {
counter = 0;
} | 'OOB' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
if (counter >= 10) {
counter = 0;
} | 'OOB' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
if (counter > 10) {
counter = 0;
}
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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
if (counter > 10) {
counter = 0;
}
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
if (counter >= 10) {
counter = 0;
} | 'OOB' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
state_type state;
state = IDLE;
The right code snippet is:
static state_type state = IDLE; | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
static state_type state = IDLE; | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
state_type state;
state = IDLE;
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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
state_type state;
state = IDLE;
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
static state_type state = IDLE; | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
adc_value = adc_value << 10;
The right code snippet is:
adc_value = adc_value << 2; | 'SHFT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
adc_value = adc_value << 2; | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
adc_value = adc_value << 10;
The high-level-synthesis bug type of the code is: 'SHFT' | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
adc_value = adc_value << 10;
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
adc_value = adc_value << 2; | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
while (1) {
// some code
}
The right code snippet is:
while (true) {
// some code
} | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
while (true) {
// some code
} | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
while (1) {
// some code
}
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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
while (1) {
// some code
}
The high-level-synthesis bug type of the code is: 'INF'
The right code snippet is:
while (true) {
// some code
} | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
signed char var = 0xFF;
unsigned int var2 = var;
The right code snippet is:
unsigned char var = 0xFF;
unsigned int var2 = var; | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
unsigned char var = 0xFF;
unsigned int var2 = var; | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
signed char var = 0xFF;
unsigned int var2 = var;
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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
signed char var = 0xFF;
unsigned int var2 = var;
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
unsigned char var = 0xFF;
unsigned int var2 = var; | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
for (int i = 0; i <= 10; i++) {
// some code
}
The right code snippet is:
for (int i = 0; i < 10; i++) {
// some code
} | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
for (int i = 0; i < 10; i++) {
// some 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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
for (int i = 0; i <= 10; i++) {
// some code
}
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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
for (int i = 0; i <= 10; i++) {
// some code
}
The high-level-synthesis bug type of the code is: 'MLU'
The right code snippet is:
for (int i = 0; i < 10; i++) {
// some code
} | '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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
int var = 0;
The right code snippet is:
int var = 5; | 'ZERO' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
int var = 5; | 'ZERO' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
int var = 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_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
int var = 0;
The high-level-synthesis bug type of the code is: 'ZERO'
The right code snippet is:
int var = 5; | 'ZERO' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
memcpy(dest+size/2, src, size);
The right code snippet is:
memcpy(dest, src, size); | 'BUF' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
memcpy(dest, src, size); | 'BUF' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
memcpy(dest+size/2, src, size);
The high-level-synthesis bug type of the code is: 'BUF' | 'BUF' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
memcpy(dest+size/2, src, size);
The high-level-synthesis bug type of the code is: 'BUF'
The right code snippet is:
memcpy(dest, src, size); | 'BUF' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=1
The right code snippet is:
#pragma HLS array_partition variable=data complete dim=1 | 'APT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
#pragma HLS array_partition variable=data complete dim=1 | 'APT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=1
The high-level-synthesis bug type of the code is: 'APT' | 'APT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=1
The high-level-synthesis bug type of the code is: 'APT'
The right code snippet is:
#pragma HLS array_partition variable=data complete dim=1 | 'APT' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
#pragma HLS array_partition variable=data cyclic factor=3 dim=1
The right code snippet is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=1 | 'FND' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=1 | 'FND' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
#pragma HLS array_partition variable=data cyclic factor=3 dim=1
The high-level-synthesis bug type of the code is: 'FND' | 'FND' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
#pragma HLS array_partition variable=data cyclic factor=3 dim=1
The high-level-synthesis bug type of the code is: 'FND'
The right code snippet is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=1 | 'FND' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=2
The right code snippet is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=1 | 'DID' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=1 | 'DID' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=2
The high-level-synthesis bug type of the code is: 'DID' | 'DID' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=2
The high-level-synthesis bug type of the code is: 'DID'
The right code snippet is:
#pragma HLS array_partition variable=data cyclic factor=2 dim=1 | 'DID' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
#pragma HLS dataflow pipeline II=2
The right code snippet is:
#pragma HLS dataflow | 'DFP' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
#pragma HLS dataflow | 'DFP' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
#pragma HLS dataflow pipeline II=2
The high-level-synthesis bug type of the code is: 'DFP' | 'DFP' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
#pragma HLS dataflow pipeline II=2
The high-level-synthesis bug type of the code is: 'DFP'
The right code snippet is:
#pragma HLS dataflow | 'DFP' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
#pragma HLS interface ap_none port=data depth=10
The right code snippet is:
#pragma HLS interface ap_none port=data | 'IDAP' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
#pragma HLS interface ap_none port=data | 'IDAP' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
#pragma HLS interface ap_none port=data depth=10
The high-level-synthesis bug type of the code is: 'IDAP' | 'IDAP' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
#pragma HLS interface ap_none port=data depth=10
The high-level-synthesis bug type of the code is: 'IDAP'
The right code snippet is:
#pragma HLS interface ap_none port=data | 'IDAP' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
#pragma HLS interface m_axi port=mem offset=off random
The right code snippet is:
#pragma HLS interface m_axi port=mem offset=off | 'RAMB' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
#pragma HLS interface m_axi port=mem offset=off | '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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
#pragma HLS interface m_axi port=mem offset=off 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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
#pragma HLS interface m_axi port=mem offset=off random
The high-level-synthesis bug type of the code is: 'RAMB'
The right code snippet is:
#pragma HLS interface m_axi port=mem offset=off | 'RAMB' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
#pragma HLS interface bram port=data
The right code snippet is:
#pragma HLS interface ap_fifo port=data | 'SMA' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
#pragma HLS interface ap_fifo port=data | '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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
#pragma HLS interface bram port=data
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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
#pragma HLS interface bram port=data
The high-level-synthesis bug type of the code is: 'SMA'
The right code snippet is:
#pragma HLS interface ap_fifo port=data | 'SMA' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
#pragma HLS interface ap_none port=data
The right code snippet is:
#pragma HLS interface bram port=data | 'AMS' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
#pragma HLS interface bram port=data | '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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
#pragma HLS interface ap_none port=data
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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
#pragma HLS interface ap_none port=data
The high-level-synthesis bug type of the code is: 'AMS'
The right code snippet is:
#pragma HLS interface bram port=data | 'AMS' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
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:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HL... |
The wrong part of the code is:
#pragma HLS unroll factor=2
The right code snippet is:
#pragma HLS unroll | 'ILNU' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i
#pragma HLS INT... |
The right code snippet is:
#pragma HLS unroll | 'ILNU' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pragma HLS INTERFACE ap_none port=In0_i... |
The wrong part of the code is:
#pragma HLS unroll factor=2
The high-level-synthesis bug type of the code is: 'ILNU' | 'ILNU' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=Reset_n_i
#pragma HLS INTERFACE ap_none port=Clk_i
#pr... |
The wrong part of the code is:
#pragma HLS unroll factor=2
The high-level-synthesis bug type of the code is: 'ILNU'
The right code snippet is:
#pragma HLS unroll | 'ILNU' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_clk port=clk
#pragma HLS INTERFACE ap_rst port=reset
void uart_tx(
ap_uint<8> data_in,
bool start,
ap_uint<16> baud_rate,
bool &tx
) {
#pragma HLS I... |
The wrong part of the code is:
if (count == 8) {
if (baud_count == baud_rate) {
stop_bit = 0;
count = count + 1;
baud_count = 0;
} else {
baud_count = baud_count - 1;
The right code snippet is:
if (count == 8) {
if (baud_count == baud_rate) {
stop_bit = 0;
count = count + ... | 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_clk port=clk
#pragma HLS INTERFACE ap_rst port=reset
void uart_tx(
ap_uint<8> data_in,
bool start,
ap_uint<16> baud_rate,
bool &tx
) {
#pragma HLS INTERF... |
The right code snippet is:
if (count == 8) {
if (baud_count == baud_rate) {
stop_bit = 0;
count = count + 1;
baud_count = 0;
} else {
baud_count = baud_count + 1;
}
} else if (count == 9) {
if (baud_count == baud_rate) {
tx = 1;
count = 0;
baud_count = 0;
} else {
baud... | 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_clk port=clk
#pragma HLS INTERFACE ap_rst port=reset
void uart_tx(
ap_uint<8> data_in,
bool start,
ap_uint<16> baud_rate,
bool &tx
) {
#p... |
The wrong part of the code is:
if (count == 8) {
if (baud_count == baud_rate) {
stop_bit = 0;
count = count + 1;
baud_count = 0;
} else {
baud_count = baud_count - 1;
The high-level-synthesis bug type of the code is: OOB | OOB |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_clk port=clk
#pragma HLS INTERFACE ap_rst port=reset
void uart_tx(
ap_uint<8> data_in,
bool start,
ap_ui... |
The wrong part of the code is:
if (count == 8) {
if (baud_count == baud_rate) {
stop_bit = 0;
count = count + 1;
baud_count = 0;
} else {
baud_count = baud_count - 1;
The high-level-synthesis bug type of the code is: OOB
The right code snippet is:
if (count == 8) {
if (baud_co... | 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_clk port=clk
#pragma HLS INTERFACE ap_rst port=reset
void uart_tx(
ap_uint<8> data_in,
bool start,
ap_uint<16> baud_rate,
bool &tx
) {
#pragma HLS I... |
The wrong part of the code is:
static bool start_bit;
static bool stop_bit;
static ap_uint<16> baud_count;
if (reset) {
count = 0;
data = 0;
start_bit = 0;
The right code snippet is:
static bool start_bit;
static bool stop_bit;
static ap_uint<16> baud_count;
if (reset) {
count = 0;
data = 0... | }
} else if (count == 9) {
if (baud_count == baud_rate) {
tx = 1;
count = 0;
baud_count = 0;
} else {
baud_count = baud_count + 1;
}
}
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_clk port=clk
#pragma HLS INTERFACE ap_rst port=reset
void uart_tx(
ap_uint<8> data_in,
bool start,
ap_uint<16> baud_rate,
bool &tx
) {
#pragma HLS INTERF... |
The right code snippet is:
static bool start_bit;
static bool stop_bit;
static ap_uint<16> baud_count;
if (reset) {
count = 0;
data = 0;
start_bit = 1;
stop_bit = 1;
baud_count = 0;
tx = 1;
} | }
} else if (count == 9) {
if (baud_count == baud_rate) {
tx = 1;
count = 0;
baud_count = 0;
} else {
baud_count = baud_count + 1;
}
}
INIT |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_clk port=clk
#pragma HLS INTERFACE ap_rst port=reset
void uart_tx(
ap_uint<8> data_in,
bool start,
ap_uint<16> baud_rate,
bool &tx
) {
#p... |
The wrong part of the code is:
static bool start_bit;
static bool stop_bit;
static ap_uint<16> baud_count;
if (reset) {
count = 0;
data = 0;
start_bit = 0;
The high-level-synthesis bug type of the code is: }
} else if (count == 9) {
if (baud_count == baud_rate) {
tx = 1;
count = 0;
bau... | }
} else if (count == 9) {
if (baud_count == baud_rate) {
tx = 1;
count = 0;
baud_count = 0;
} else {
baud_count = baud_count + 1;
}
}
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_clk port=clk
#pragma HLS INTERFACE ap_rst port=reset
void uart_tx(
ap_uint<8> data_in,
bool start,
ap_ui... |
The wrong part of the code is:
static bool start_bit;
static bool stop_bit;
static ap_uint<16> baud_count;
if (reset) {
count = 0;
data = 0;
start_bit = 0;
The high-level-synthesis bug type of the code is: }
} else if (count == 9) {
if (baud_count == baud_rate) {
tx = 1;
count = 0;
bau... | }
} else if (count == 9) {
if (baud_count == baud_rate) {
tx = 1;
count = 0;
baud_count = 0;
} else {
baud_count = baud_count + 1;
}
}
INIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.