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 ap_none port=Reset_n_i #pragma HLS INTERFACE ap_none port=Clk_i #pragma HLS INTERFACE ap_none port=SPI_FSM_Start #pragma HLS INTERFACE ap_none port=SPI_Transmissi...
The wrong part of the code is: switch (SPI_FSM_State) { case stIdleSPI: if (SPI_FSM_Start) { SPI_FSM_NextState = stWrite1; SPI_Write_o = true; } break; case stWrite1: SPI_FSM_NextState = stWrite2; SPI_Write_o = true; break; case stWrite2: SP...
'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_none port=Reset_n_i #pragma HLS INTERFACE ap_none port=Clk_i #pragma HLS INTERFACE ap_none port=SPI_FSM_Start #pragma HLS INTERFACE ap_none port=SPI_Transmission_i ...
The right code snippet is: switch (SPI_FSM_State) { case stIdleSPI: if (SPI_FSM_Start) { SPI_FSM_NextState = stWrite1; SPI_Write_o = true; } break; case stWrite1: SPI_FSM_NextState = stWrite2; SPI_Write_o = true; break; case stWrite2: SPI_FS...
'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_none port=Reset_n_i #pragma HLS INTERFACE ap_none port=Clk_i #pragma HLS INTERFACE ap_none port=SPI_FSM_Start #pragma HLS INTERFACE ap_none port=SPI...
The wrong part of the code is: switch (SPI_FSM_State) { case stIdleSPI: if (SPI_FSM_Start) { SPI_FSM_NextState = stWrite1; SPI_Write_o = true; } break; case stWrite1: SPI_FSM_NextState = stWrite2; SPI_Write_o = true; break; case stWrite2: SP...
'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_none port=Reset_n_i #pragma HLS INTERFACE ap_none port=Clk_i #pragma HLS INTERFACE ap_none port=SPI_FSM_Start #...
The wrong part of the code is: switch (SPI_FSM_State) { case stIdleSPI: if (SPI_FSM_Start) { SPI_FSM_NextState = stWrite1; SPI_Write_o = true; } break; case stWrite1: SPI_FSM_NextState = stWrite2; SPI_Write_o = true; break; case stWrite2: SP...
'ILNU'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in+1); o...
The wrong part of the code is: ln_out = std::log(in+1); The right code snippet is: ln_out = std::log(in);
'OOB'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in+1); out = ...
The right code snippet is: ln_out = std::log(in);
'OOB'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: ln_out = std::log(in+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: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: ln_out = std::log(in+1); The high-level-synthesis bug type of the code is: 'OOB' The right code snippet is: ln_out = std::log(in);
'OOB'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out = 0; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); ...
The wrong part of the code is: int ln_out = 0; The right code snippet is: int ln_out;
'INIT'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out = 0; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out ...
The right code snippet is: int ln_out;
'INIT'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out = 0; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::l...
The wrong part of the code is: int ln_out = 0; The high-level-synthesis bug type of the code is: 'INIT'
'INIT'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out = 0; int exp_out; if (ctrl == 0) { // Compute ...
The wrong part of the code is: int ln_out = 0; The high-level-synthesis bug type of the code is: 'INIT' The right code snippet is: int ln_out;
'INIT'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: out = ln_out << 50; The right code snippet is: out = ln_out << 32;
'SHFT'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: out = ln_out << 32;
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: out = ln_out << 50; 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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: out = ln_out << 50; The high-level-synthesis bug type of the code is: 'SHFT' The right code snippet is: out = ln_out << 32;
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: while (1) {} The right code snippet is: while (true) {}
'INF'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: while (true) {}
'INF'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: while (1) {} The high-level-synthesis bug type of the code is: 'INF'
'INF'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: while (1) {} The high-level-synthesis bug type of the code is: 'INF' The right code snippet is: while (true) {}
'INF'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: unsigned int in; The right code snippet is: int in;
'USE'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: int in;
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: unsigned int in; 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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: unsigned int in; The high-level-synthesis bug type of the code is: 'USE' The right code snippet is: int in;
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: for (int i=0; i<9; i++) {} The right code snippet is: for (int i=0; i<10; i++) {}
'MLU'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: for (int i=0; i<10; i++) {}
'MLU'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: for (int i=0; i<9; i++) {} The high-level-synthesis bug type of the code is: 'MLU'
'MLU'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: for (int i=0; i<9; i++) {} The high-level-synthesis bug type of the code is: 'MLU' The right code snippet is: for (int i=0; i<10; i++) {}
'MLU'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: int in = 0; The right code snippet is: int in;
'ZERO'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: int in;
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: int in = 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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: int in = 0; The high-level-synthesis bug type of the code is: 'ZERO' The right code snippet is: int in;
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: memcpy(buffer1, buffer2+size, size); The right code snippet is: memcpy(buffer1, buffer2, size);
'BUF'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: memcpy(buffer1, buffer2, 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: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: memcpy(buffer1, buffer2+size, 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: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: memcpy(buffer1, buffer2+size, size); The high-level-synthesis bug type of the code is: 'BUF' The right code snippet is: memcpy(buffer1, buffer2, 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: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: #pragma HLS array_partition variable=in cyclic dim=0 The right code snippet is: #pragma HLS array_partition variable=in complete dim=0
'APT'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: #pragma HLS array_partition variable=in complete dim=0
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: #pragma HLS array_partition variable=in cyclic dim=0 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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: #pragma HLS array_partition variable=in cyclic dim=0 The high-level-synthesis bug type of the code is: 'APT' The right code snippet is: #pragma HLS array_partition variable=in complete dim=0
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: #pragma HLS array_partition variable=in cyclic factor=3 dim=0 The right code snippet is: #pragma HLS array_partition variable=in cyclic dim=0
'FND'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: #pragma HLS array_partition variable=in cyclic dim=0
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: #pragma HLS array_partition variable=in cyclic factor=3 dim=0 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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: #pragma HLS array_partition variable=in cyclic factor=3 dim=0 The high-level-synthesis bug type of the code is: 'FND' The right code snippet is: #pragma HLS array_partition variable=in cyclic dim=0
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: #pragma HLS array_partition variable=in cyclic factor=3 dim=1 The right code snippet is: #pragma HLS array_partition variable=in cyclic factor=3 dim=0
'DID'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: #pragma HLS array_partition variable=in cyclic factor=3 dim=0
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: #pragma HLS array_partition variable=in cyclic factor=3 dim=1 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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: #pragma HLS array_partition variable=in cyclic factor=3 dim=1 The high-level-synthesis bug type of the code is: 'DID' The right code snippet is: #pragma HLS array_partition variable=in cyclic factor=3 dim=0
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: #pragma HLS dataflow region The right code snippet is: #pragma HLS dataflow
'DFP'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: #pragma HLS dataflow region The high-level-synthesis bug type of the code is: 'DFP'
'DFP'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: #pragma HLS dataflow region The high-level-synthesis bug type of the code is: 'DFP' The right code snippet is: #pragma HLS dataflow
'DFP'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: #pragma HLS interface ap_none port=in The right code snippet is: #pragma HLS interface ap_ctrl_none port=in
'IDAP'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: #pragma HLS interface ap_ctrl_none port=in
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: #pragma HLS interface ap_none port=in 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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: #pragma HLS interface ap_none port=in The high-level-synthesis bug type of the code is: 'IDAP' The right code snippet is: #pragma HLS interface ap_ctrl_none port=in
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: #pragma HLS interface m_axi port=in offset=slave bundle=gmem1 The right code snippet is: #pragma HLS interface m_axi port=in offset=slave bundle=gmem
'RAMB'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: #pragma HLS interface m_axi port=in offset=slave bundle=gmem
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: #pragma HLS interface m_axi port=in offset=slave bundle=gmem1 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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: #pragma HLS interface m_axi port=in offset=slave bundle=gmem1 The high-level-synthesis bug type of the code is: 'RAMB' The right code snippet is: #pragma HLS interface m_axi port=in offset=slave bundle=gmem
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: #pragma HLS interface bram port=in The right code snippet is: #pragma HLS interface ap_fifo port=in
'SMA'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: #pragma HLS interface ap_fifo port=in
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: #pragma HLS interface bram port=in 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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: #pragma HLS interface bram port=in The high-level-synthesis bug type of the code is: 'SMA' The right code snippet is: #pragma HLS interface ap_fifo port=in
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: #pragma HLS interface ap_none port=in The right code snippet is: #pragma HLS interface bram port=in
'AMS'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: #pragma HLS interface bram port=in
'AMS'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(i...
The wrong part of the code is: #pragma HLS interface ap_none port=in The high-level-synthesis bug type of the code is: 'AMS'
'AMS'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: #pragma HLS interface ap_none port=in The high-level-synthesis bug type of the code is: 'AMS' The right code snippet is: #pragma HLS interface bram port=in
'AMS'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: #pragma HLS pipeline II=2 The right code snippet is: #pragma HLS pipeline II=1
'MLP'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: #pragma HLS pipeline II=1
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(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: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
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 II=1
'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 <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out...
The wrong part of the code is: #pragma HLS unroll factor=2 The right code snippet is: #pragma HLS unroll
'ILNU'
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(in); out = ln...
The right code snippet is: #pragma HLS unroll
'ILNU'
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type The buggy code is: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natural logarithm ln_out = std::log(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: ``` #include <cmath> void LogExp (int in, bool ctrl, int& out) { int ln_out; int exp_out; if (ctrl == 0) { // Compute natu...
The wrong part of the code is: #pragma HLS unroll factor=2 The high-level-synthesis bug type of the code is: 'ILNU' The right code snippet is: #pragma HLS unroll
'ILNU'
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result; if (A > B) { result = 0b010; }...
The wrong part of the code is: if (A[5] > B) { result = 0b010; } else { result = (A == B) ? 0b100 : 0b001; } The right code snippet is: if (A > B) { result = 0b010; } else { result = (A == B) ? 0b100 : 0b001; }
'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: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result; if (A > B) { result = 0b010; } else...
The right code snippet is: if (A > B) { result = 0b010; } else { result = (A == B) ? 0b100 : 0b001; }
'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: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result; if (A > B) { result = 0...
The wrong part of the code is: if (A[5] > B) { result = 0b010; } else { result = (A == B) ? 0b100 : 0b001; } The high-level-synthesis bug type of the code is: 'OOB': Out-of-bounds array access
'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: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result;...
The wrong part of the code is: if (A[5] > B) { result = 0b010; } else { result = (A == B) ? 0b100 : 0b001; } The high-level-synthesis bug type of the code is: 'OOB': Out-of-bounds array access The right code snippet is: if (A > B) { result = 0b010; } else { result = (A == B) ? 0b100...
'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: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result = 0; if (A > B) { result = 0b010; ...
The wrong part of the code is: ap_uint<3> result = 0; The right code snippet is: ap_uint<3> result;
'INIT': Read of uninitialized variable
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result = 0; if (A > B) { result = 0b010; } ...
The right code snippet is: ap_uint<3> result;
'INIT': Read of uninitialized variable
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 magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result = 0; if (A > B) { result...
The wrong part of the code is: ap_uint<3> result = 0; The high-level-synthesis bug type of the code is: 'INIT': Read of uninitialized variable
'INIT': Read of uninitialized variable
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 magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result ...
The wrong part of the code is: ap_uint<3> result = 0; The high-level-synthesis bug type of the code is: 'INIT': Read of uninitialized variable The right code snippet is: ap_uint<3> result;
'INIT': Read of uninitialized variable
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result; if (A > B) { result = 0b010; }...
The wrong part of the code is: result = (A >> 4 == B) ? 0b100 : 0b001; The right code snippet is: result = (A == B) ? 0b100 : 0b001;
'SHFT': Bit shift by an out-of-bounds amount
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result; if (A > B) { result = 0b010; } else...
The right code snippet is: result = (A == B) ? 0b100 : 0b001;
'SHFT': Bit shift by an out-of-bounds amount
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 magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result; if (A > B) { result = 0...
The wrong part of the code is: result = (A >> 4 == B) ? 0b100 : 0b001; The high-level-synthesis bug type of the code is: 'SHFT': Bit shift by an out-of-bounds amount
'SHFT': Bit shift by an out-of-bounds amount
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 magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result;...
The wrong part of the code is: result = (A >> 4 == B) ? 0b100 : 0b001; The high-level-synthesis bug type of the code is: 'SHFT': Bit shift by an out-of-bounds amount The right code snippet is: result = (A == B) ? 0b100 : 0b001;
'SHFT': Bit shift by an out-of-bounds amount
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result; if (A > B) { result = 0b010; }...
The wrong part of the code is: int &EQ, int &GT, int &LT The right code snippet is: bool &EQ, bool &GT, bool &LT
'USE': Unintended sign extension
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result; if (A > B) { result = 0b010; } else...
The right code snippet is: bool &EQ, bool &GT, bool &LT
'USE': Unintended sign extension
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 magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result; if (A > B) { result = 0...
The wrong part of the code is: int &EQ, int &GT, int &LT The high-level-synthesis bug type of the code is: 'USE': Unintended sign extension
'USE': Unintended sign extension
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 magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result;...
The wrong part of the code is: int &EQ, int &GT, int &LT The high-level-synthesis bug type of the code is: 'USE': Unintended sign extension The right code snippet is: bool &EQ, bool &GT, bool &LT
'USE': Unintended sign extension
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet The buggy code is: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result = 0; if (A > B) { result = 0b010; ...
The wrong part of the code is: ap_uint<3> result = 0; The right code snippet is: ap_uint<3> result;
'ZERO': Variable initialized to zero instead of nonzero initializer
Given the following buggy code, and the wrong part of the code, generate the right code snippet: The buggy code is: void magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result = 0; if (A > B) { result = 0b010; } ...
The right code snippet is: ap_uint<3> result;
'ZERO': Variable initialized to zero instead of nonzero initializer
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 magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result = 0; if (A > B) { result...
The wrong part of the code is: ap_uint<3> result = 0; The high-level-synthesis bug type of the code is: 'ZERO': Variable initialized to zero instead of nonzero initializer
'ZERO': Variable initialized to zero instead of nonzero initializer
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 magnitude_comparator_4bit ( ap_uint<4> A, ap_uint<4> B, bool &EQ, bool &GT, bool &LT ) { ap_uint<3> result ...
The wrong part of the code is: ap_uint<3> result = 0; The high-level-synthesis bug type of the code is: 'ZERO': Variable initialized to zero instead of nonzero initializer The right code snippet is: ap_uint<3> result;
'ZERO': Variable initialized to zero instead of nonzero initializer
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 #pragma HLS INTERFACE ap_none port=SER #pragma HLS INTERFACE ap_none port=A #pragma HLS INTERFACE ap_none ...
The wrong part of the code is: shift_register(shifted_Q, Q+1, reset, SER); The right code snippet is: shift_register(shifted_Q, Q, reset, SER);
'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 #pragma HLS INTERFACE ap_none port=SER #pragma HLS INTERFACE ap_none port=A #pragma HLS INTERFACE ap_none port=...
The right code snippet is: shift_register(shifted_Q, Q, reset, SER);
'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 #pragma HLS INTERFACE ap_none port=SER #pragma HLS INTERFACE ap_none port=A #pragma HLS INTERFA...
The wrong part of the code is: shift_register(shifted_Q, Q+1, reset, SER); 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 #pragma HLS INTERFACE ap_none port=SER #pragma HLS INTERFA...
The wrong part of the code is: shift_register(shifted_Q, Q+1, reset, SER); The high-level-synthesis bug type of the code is: 'OOB' The right code snippet is: shift_register(shifted_Q, Q, reset, SER);
'OOB'