instruction stringlengths 139 357k | response stringlengths 36 4.54k | buggy_type stringclasses 745
values |
|---|---|---|
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include "ap_int.h"
void decoder_2to4_adder (
ap_uint<2> in,
bool ena,
bool cin,
ap_uint<4>& out,
bool& cout
) {
#pragma HLS INTERFACE m_axi port=in
#pragm... |
The wrong part of the code is:
#pragma HLS INTERFACE m_axi port=in
The right code snippet is:
#pragma HLS INTERFACE ap_none port=in | '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 decoder_2to4_adder (
ap_uint<2> in,
bool ena,
bool cin,
ap_uint<4>& out,
bool& cout
) {
#pragma HLS INTERFACE m_axi port=in
#pragma HLS... |
The right code snippet is:
#pragma HLS INTERFACE ap_none port=in | '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 decoder_2to4_adder (
ap_uint<2> in,
bool ena,
bool cin,
ap_uint<4>& out,
bool& cout
) {
#pragma HLS INTERFACE m_axi port=in... |
The wrong part of the code is:
#pragma HLS INTERFACE m_axi port=in
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 decoder_2to4_adder (
ap_uint<2> in,
bool ena,
bool cin,
ap_uint<4>& out,
bool& cout
) {
... |
The wrong part of the code is:
#pragma HLS INTERFACE m_axi port=in
The high-level-synthesis bug type of the code is: 'RAMB'
The right code snippet is:
#pragma HLS INTERFACE ap_none port=in | '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 decoder_2to4_adder (
ap_uint<2> in,
bool ena,
bool cin,
ap_uint<4>& out,
bool& cout
) {
#pragma HLS INTERFACE bram port=in
#pragma... |
The wrong part of the code is:
#pragma HLS INTERFACE bram port=in
The right code snippet is:
#pragma HLS INTERFACE ap_none 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 "ap_int.h"
void decoder_2to4_adder (
ap_uint<2> in,
bool ena,
bool cin,
ap_uint<4>& out,
bool& cout
) {
#pragma HLS INTERFACE bram port=in
#pragma HLS ... |
The right code snippet is:
#pragma HLS INTERFACE ap_none 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 "ap_int.h"
void decoder_2to4_adder (
ap_uint<2> in,
bool ena,
bool cin,
ap_uint<4>& out,
bool& cout
) {
#pragma HLS INTERFACE bram port=in
... |
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 "ap_int.h"
void decoder_2to4_adder (
ap_uint<2> in,
bool ena,
bool cin,
ap_uint<4>& out,
bool& cout
) {
... |
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_none 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 <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
case 0b00010000: analog_voltage = 0b0000100000; break;
The right code snippet is:
case 0b00001111: analog_voltage = 0b0000011110; break; | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
case 0b00001111: analog_voltage = 0b0000011110; break; | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
case 0b00010000: analog_voltage = 0b0000100000; break;
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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
case 0b00010000: analog_voltage = 0b0000100000; break;
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
case 0b00001111: analog_voltage = 0b0000011110; break; | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
ap_uint<v> analog_voltage = 0; // uninitialized variable
The right code snippet is:
ap_uint<v> analog_voltage; // register to store analog voltage | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
ap_uint<v> analog_voltage; // register to store analog voltage | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
ap_uint<v> analog_voltage = 0; // uninitialized variable
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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
ap_uint<v> analog_voltage = 0; // uninitialized variable
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
ap_uint<v> analog_voltage; // register to store analog voltage | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
analog_out = analog_voltage << 20; // shift by an out-of-bounds amount
The right code snippet is:
analog_out = analog_voltage; // assign analog voltage to output | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
analog_out = analog_voltage; // assign analog voltage to output | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
analog_out = analog_voltage << 20; // shift by an out-of-bounds amount
The high-level-synthesis bug type of the code is: 'SHFT' | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
analog_out = analog_voltage << 20; // shift by an out-of-bounds amount
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
analog_out = analog_voltage; // assign analog voltage to output | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
while (1) {} // create an infinite loop
The right code snippet is:
// add more cases for higher resolutions
default: analog_voltage = 0b0000000000; // default to 0V | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
// add more cases for higher resolutions
default: analog_voltage = 0b0000000000; // default to 0V | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
while (1) {} // create an infinite loop
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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
while (1) {} // create an infinite loop
The high-level-synthesis bug type of the code is: 'INF'
The right code snippet is:
// add more cases for higher resolutions
default: analog_voltage = 0b0000000000; // default to 0V | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(int din, // unintended sign extension ... |
The wrong part of the code is:
int din, // unintended sign extension
The right code snippet is:
ap_uint<r> din, | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(int din, // unintended sign extension ap_ui... |
The right code snippet is:
ap_uint<r> din, | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(int din, // unintended sign... |
The wrong part of the code is:
int din, // unintended sign extension
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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
int din, // unintended sign extension
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
ap_uint<r> din, | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
#pragma HLS INTERFACE axis register both port=din_half // copying from the wrong half of a split buffer
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
#pragma HLS INTERFACE axis register both port=din_half // copying from the wrong half of a split buffer
The high-level-synthesis bug type of the code is: 'BUF' | 'BUF' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
#pragma HLS INTERFACE axis register both port=din_half // copying from the wrong half of a split buffer
The high-level-synthesis bug type of the code is: 'BUF'
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=din cyclic factor=3 dim=1 // incorrect partition type
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=din 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:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=din 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:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=din cyclic factor=3 dim=1 // incorrect partition type
The high-level-synthesis bug type of the code is: 'APT' | 'APT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=din cyclic factor=3 dim=1 // incorrect partition type
The high-level-synthesis bug type of the code is: 'APT'
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=din 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:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=din cyclic factor=5 dim=1 // factor not divisible
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=din complete dim=1 | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=din complete 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:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=din cyclic factor=5 dim=1 // factor not divisible
The high-level-synthesis bug type of the code is: 'FND' | 'FND' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=din cyclic factor=5 dim=1 // factor not divisible
The high-level-synthesis bug type of the code is: 'FND'
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=din complete 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:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=din cyclic factor=3 dim=2 // incorrect dimension
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=din complete 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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=din complete 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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=din cyclic factor=3 dim=2 // incorrect dimension
The high-level-synthesis bug type of the code is: 'DID' | 'DID' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=din cyclic factor=3 dim=2 // incorrect dimension
The high-level-synthesis bug type of the code is: 'DID'
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=din complete 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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out, ap_uint<v> &analog_out2) { // incorrect dataflow position
The right code snippet is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out, ap_... |
The right code snippet is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out, ap_uint<v> &analog_out2) { // incorrect dataflow position
The high-level-synthesis bug type of the code is: 'DFP' | 'DFP' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out, ap_uint<v> &analog_out2) { // incorrect dataflow position
The high-level-synthesis bug type of the code is: 'DFP'
The right code snippet is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_out2 // incorrect data access pattern
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_o... | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_out | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_out2 // incorrect data access pattern
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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_out2 // incorrect data access pattern
The high-level-synthesis bug type of the code is: 'IDAP'
The right code snippet is:
#pragma HLS INTERFACE axis register both po... | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
#pragma HLS INTERFACE m_axi port=return // m_axi interface is accessed randomly
The right code snippet is:
#pragma HLS INTERFACE ap_ctrl_none port=return | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
#pragma HLS INTERFACE ap_ctrl_none port=return | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
#pragma HLS INTERFACE m_axi port=return // m_axi interface is accessed randomly
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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
#pragma HLS INTERFACE m_axi port=return // m_axi interface is accessed randomly
The high-level-synthesis bug type of the code is: 'RAMB'
The right code snippet is:
#pragma HLS INTERFACE ap_ctrl_none port=return | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
#pragma HLS INTERFACE bram port=din // scalar values mapped to array interfaces
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_out | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_out | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
#pragma HLS INTERFACE bram port=din // scalar values mapped to array interfaces
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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
#pragma HLS INTERFACE bram port=din // scalar values mapped to array interfaces
The high-level-synthesis bug type of the code is: 'SMA'
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_ou... | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_none port=din // array value mapped to scalar interfaces
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) {
... |
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
void DAC(ap_uint<r> din, ap_uint<v> ... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_none port=din // array value mapped to scalar interfaces
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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_none port=din // array value mapped to scalar interfaces
The high-level-synthesis bug type of the code is: 'AMS'
The right code snippet is:
#pragma HLS INTERFACE axis register both port=din
#pragma HLS INTERFACE axis register both port=analog_... | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
#pragma HLS pipeline II=2
void DAC(ap_uint<r> d... |
The wrong part of the code is:
#pragma HLS pipeline II=2
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { // multi-level pipelining
The right code snippet is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
#pragma HLS pipeline II=2
void DAC(ap_uint<r> din, a... |
The right code snippet is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
#pragma HLS pipeline II=2
void DAC(a... |
The wrong part of the code is:
#pragma HLS pipeline II=2
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { // multi-level pipelining
The high-level-synthesis bug type of the code is: 'MLP' | 'MLP' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
#pragma HLS pipeline II=2
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { // multi-level pipelining
The high-level-synthesis bug type of the code is: 'MLP'
The right code snippet is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
#pragma HLS unroll factor=2
void DAC(ap_uint<r>... |
The wrong part of the code is:
#pragma HLS unroll factor=2
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { // inner loops not fully unrolled
The right code snippet is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
#pragma HLS unroll factor=2
void DAC(ap_uint<r> din,... |
The right code snippet is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { | '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>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
#pragma HLS unroll factor=2
void DAC... |
The wrong part of the code is:
#pragma HLS unroll factor=2
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { // inner loops not fully unrolled
The high-level-synthesis bug type of the code is: 'ILNU' | 'ILNU' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
const int r = 8; // resolution of digital input signal
const int v = 10; // resolution of analog output signal
... |
The wrong part of the code is:
#pragma HLS unroll factor=2
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { // inner loops not fully unrolled
The high-level-synthesis bug type of the code is: 'ILNU'
The right code snippet is:
void DAC(ap_uint<r> din, ap_uint<v> &analog_out) { | '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 xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTE... |
The wrong part of the code is:
out = out_reg + 1;
The right code snippet is:
out = out_reg; | 'OOB' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTERFACE... |
The right code snippet is:
out = out_reg; | 'OOB' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#prag... |
The wrong part of the code is:
out = out_reg + 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:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragm... |
The wrong part of the code is:
out = out_reg + 1;
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
out = out_reg; | 'OOB' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTE... |
The wrong part of the code is:
bool out_reg = 0;
The right code snippet is:
bool out_reg; | 'INIT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTERFACE... |
The right code snippet is:
bool out_reg; | '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 xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#prag... |
The wrong part of the code is:
bool out_reg = 0;
The high-level-synthesis bug type of the code is: 'INIT' | 'INIT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragm... |
The wrong part of the code is:
bool out_reg = 0;
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
bool out_reg; | '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 xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTE... |
The wrong part of the code is:
xor2_out = a << b_reg;
The right code snippet is:
xor2_out = a ^ b_reg; | 'SHFT' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTERFACE... |
The right code snippet is:
xor2_out = a ^ b_reg; | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#prag... |
The wrong part of the code is:
xor2_out = a << b_reg;
The high-level-synthesis bug type of the code is: 'SHFT' | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragm... |
The wrong part of the code is:
xor2_out = a << b_reg;
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
xor2_out = a ^ b_reg; | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTE... |
The wrong part of the code is:
while(1);
The right code snippet is:
// No suitable code snippet to replace | 'INF' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTERFACE... |
The right code snippet is:
// No suitable code snippet to replace | '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 xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#prag... |
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:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragm... |
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:
// No suitable code snippet to replace | '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 xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTE... |
The wrong part of the code is:
int out_reg;
The right code snippet is:
bool out_reg; | 'USE' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTERFACE... |
The right code snippet is:
bool out_reg; | '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 xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#prag... |
The wrong part of the code is:
int out_reg;
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 xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragm... |
The wrong part of the code is:
int out_reg;
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
bool out_reg; | '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 xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTE... |
The wrong part of the code is:
for(int i=0; i<4; i++) {
xor1_out = a_reg ^ b_reg;
xor2_out = a ^ b_reg;
a_reg = a;
b_reg = b;
out = xor2_out;
}
The right code snippet is:
// No suitable code snippet to replace | 'MLU' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTERFACE... |
The right code snippet is:
// No suitable code snippet to replace | 'MLU' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#prag... |
The wrong part of the code is:
for(int i=0; i<4; i++) {
xor1_out = a_reg ^ b_reg;
xor2_out = a ^ b_reg;
a_reg = a;
b_reg = b;
out = xor2_out;
}
The high-level-synthesis bug type of the code is: 'MLU' | 'MLU' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragm... |
The wrong part of the code is:
for(int i=0; i<4; i++) {
xor1_out = a_reg ^ b_reg;
xor2_out = a ^ b_reg;
a_reg = a;
b_reg = b;
out = xor2_out;
}
The high-level-synthesis bug type of the code is: 'MLU'
The right code snippet is:
// No suitable code snippet to replace | 'MLU' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTE... |
The wrong part of the code is:
bool a_reg = 0, b_reg = 0;
bool xor1_out = 0, xor2_out = 0;
The right code snippet is:
bool a_reg, b_reg;
bool xor1_out, xor2_out; | 'ZERO' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#pragma HLS INTERFACE... |
The right code snippet is:
bool a_reg, b_reg;
bool xor1_out, xor2_out; | 'ZERO' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=a
#prag... |
The wrong part of the code is:
bool a_reg = 0, b_reg = 0;
bool xor1_out = 0, xor2_out = 0;
The high-level-synthesis bug type of the code is: 'ZERO' | 'ZERO' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
void xor_gate (
bool a,
bool b,
bool& out,
bool clk
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragm... |
The wrong part of the code is:
bool a_reg = 0, b_reg = 0;
bool xor1_out = 0, xor2_out = 0;
The high-level-synthesis bug type of the code is: 'ZERO'
The right code snippet is:
bool a_reg, b_reg;
bool xor1_out, xor2_out; | 'ZERO' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.