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 counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
The wrong part of the code is:
Q_reg1 = Q_reg2;
Q_reg2 = Q_reg1;
The right code snippet is:
Q_reg1 = Q;
Q_reg2 = Q_reg1; | BUF |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INT... |
The right code snippet is:
Q_reg1 = Q;
Q_reg2 = Q_reg1; | BUF |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
Q_reg1 = Q_reg2;
Q_reg2 = Q_reg1;
The high-level-synthesis bug type of the code is: BUF | BUF |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
The wrong part of the code is:
Q_reg1 = Q_reg2;
Q_reg2 = Q_reg1;
The high-level-synthesis bug type of the code is: BUF
The right code snippet is:
Q_reg1 = Q;
Q_reg2 = Q_reg1; | BUF |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=Q cyclic dim=0
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=Q 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INT... |
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=Q 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=Q 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=Q cyclic dim=0
The high-level-synthesis bug type of the code is: APT
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=Q 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=Q complete factor=3 dim=0
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=Q complete 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INT... |
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=Q complete 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=Q complete 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=Q complete 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=Q complete 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=Q complete dim=1
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=Q complete 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INT... |
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=Q complete 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=Q complete 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
The wrong part of the code is:
#pragma HLS ARRAY_PARTITION variable=Q complete dim=1
The high-level-synthesis bug type of the code is: DID
The right code snippet is:
#pragma HLS ARRAY_PARTITION variable=Q complete 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
The wrong part of the code is:
#pragma HLS INLINE
The right code snippet is:
#pragma HLS DATAFLOW | DFP |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#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:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
#pragma HLS INLINE
The high-level-synthesis bug type of the code is: DFP | DFP |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
The wrong part of the code is:
#pragma HLS INLINE
The high-level-synthesis bug type of the code is: DFP
The right code snippet is:
#pragma HLS DATAFLOW | DFP |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_fifo port=Q
The right code snippet is:
#pragma HLS INTERFACE ap_none port=Q | IDAP |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INT... |
The right code snippet is:
#pragma HLS INTERFACE ap_none port=Q | IDAP |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_fifo port=Q
The high-level-synthesis bug type of the code is: IDAP | IDAP |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_fifo port=Q
The high-level-synthesis bug type of the code is: IDAP
The right code snippet is:
#pragma HLS INTERFACE ap_none port=Q | IDAP |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
The wrong part of the code is:
#pragma HLS INTERFACE m_axi depth=50 port=Q offset=slave
The right code snippet is:
#pragma HLS INTERFACE m_axi depth=50 port=Q | 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 counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INT... |
The right code snippet is:
#pragma HLS INTERFACE m_axi depth=50 port=Q | 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 counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
#pragma HLS INTERFACE m_axi depth=50 port=Q offset=slave
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 counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
The wrong part of the code is:
#pragma HLS INTERFACE m_axi depth=50 port=Q offset=slave
The high-level-synthesis bug type of the code is: RAMB
The right code snippet is:
#pragma HLS INTERFACE m_axi depth=50 port=Q | 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 counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_memory port=Q
The right code snippet is:
#pragma HLS INTERFACE ap_none port=Q | 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 counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INT... |
The right code snippet is:
#pragma HLS INTERFACE ap_none port=Q | 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 counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_memory port=Q
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 counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_memory port=Q
The high-level-synthesis bug type of the code is: SMA
The right code snippet is:
#pragma HLS INTERFACE ap_none port=Q | SMA |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_vld port=Q
The right code snippet is:
#pragma HLS INTERFACE ap_none port=Q | AMS |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INT... |
The right code snippet is:
#pragma HLS INTERFACE ap_none port=Q | AMS |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_vld port=Q
The high-level-synthesis bug type of the code is: AMS | AMS |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
The wrong part of the code is:
#pragma HLS INTERFACE ap_vld port=Q
The high-level-synthesis bug type of the code is: AMS
The right code snippet is:
#pragma HLS INTERFACE ap_none port=Q | AMS |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INT... |
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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
#pragma HLS PIPELINE II=2
The high-level-synthesis bug type of the code is: MLP | MLP |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HL... |
The wrong part of the code is:
#pragma HLS UNROLL factor=2
Q_reg1 = Q;
Q_reg2 = Q_reg1;
The right code snippet is:
Q_reg1 = Q;
Q_reg2 = Q_reg1; | ILNU |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INT... |
The right code snippet is:
Q_reg1 = Q;
Q_reg2 = Q_reg1; | ILNU |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
#pragma HLS UNROLL factor=2
Q_reg1 = Q;
Q_reg2 = Q_reg1;
The high-level-synthesis bug type of the code is: ILNU | ILNU |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> LOAD, ap_uint<1> RESET, ap_uint<2> DATA, ap_uint<2> &Q) {
#pragma HLS I... |
The wrong part of the code is:
#pragma HLS UNROLL factor=2
Q_reg1 = Q;
Q_reg2 = Q_reg1;
The high-level-synthesis bug type of the code is: ILNU
The right code snippet is:
Q_reg1 = Q;
Q_reg2 = Q_reg1; | 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Reading uninitialized variable
ap_uint<4> uninitialized_variable;
out = uninitialized_variable;
The right code snippet is:
out = 0; | INIT |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = 0; | INIT |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Reading uninitialized variable
ap_uint<4> uninitialized_variable;
out = 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>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Reading uninitialized variable
ap_uint<4> uninitialized_variable;
out = uninitialized_variable;
The high-level-synthesis bug type of the code is: INIT
The right code snippet is:
out = 0; | INIT |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Out-of-bounds array access
ap_uint<4> arr[3];
arr[out] = 1;
out = arr[out];
The right code snippet is:
out = out + 1; | OOB |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = out + 1; | OOB |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Out-of-bounds array access
ap_uint<4> arr[3];
arr[out] = 1;
out = arr[out];
The high-level-synthesis bug type of the code is: OOB | OOB |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Out-of-bounds array access
ap_uint<4> arr[3];
arr[out] = 1;
out = arr[out];
The high-level-synthesis bug type of the code is: OOB
The right code snippet is:
out = out + 1; | OOB |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Bit shift by an out-of-bounds amount
out = out << 5;
The right code snippet is:
out = out + 1; | SHFT |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = out + 1; | SHFT |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Bit shift by an out-of-bounds amount
out = out << 5;
The high-level-synthesis bug type of the code is: SHFT | SHFT |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Bit shift by an out-of-bounds amount
out = out << 5;
The high-level-synthesis bug type of the code is: SHFT
The right code snippet is:
out = out + 1; | SHFT |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Infinite loop arising from an incorrect loop termination
while (1) {
out = out + 1;
}
The right code snippet is:
out = out + 1; | INF |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = out + 1; | INF |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Infinite loop arising from an incorrect loop termination
while (1) {
out = out + 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Infinite loop arising from an incorrect loop termination
while (1) {
out = out + 1;
}
The high-level-synthesis bug type of the code is: INF
The right code snippet is:
out = out + 1; | INF |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Unintended sign extension
ap_int<4> signed_out = out;
signed_out = signed_out + 1;
out = signed_out;
The right code snippet is:
out = out + 1; | USE |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = out + 1; | USE |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Unintended sign extension
ap_int<4> signed_out = out;
signed_out = signed_out + 1;
out = signed_out;
The high-level-synthesis bug type of the code is: USE | USE |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Unintended sign extension
ap_int<4> signed_out = out;
signed_out = signed_out + 1;
out = signed_out;
The high-level-synthesis bug type of the code is: USE
The right code snippet is:
out = out + 1; | USE |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Errors in manual loop unrolling
#pragma HLS unroll factor=2
for (int i = 0; i < 2; i++) {
out = out + 1;
}
The right code snippet is:
out = out + 1; | MLU |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = out + 1; | MLU |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Errors in manual loop unrolling
#pragma HLS unroll factor=2
for (int i = 0; i < 2; i++) {
out = out + 1;
}
The high-level-synthesis bug type of the code is: MLU | MLU |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Errors in manual loop unrolling
#pragma HLS unroll factor=2
for (int i = 0; i < 2; i++) {
out = out + 1;
}
The high-level-synthesis bug type of the code is: MLU
The right code snippet is:
out = out + 1; | MLU |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Variable initialized to zero instead of nonzero initializer
out = 1;
The right code snippet is:
out = 0; | ZERO |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = 0; | ZERO |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Variable initialized to zero instead of nonzero initializer
out = 1;
The high-level-synthesis bug type of the code is: ZERO | ZERO |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Variable initialized to zero instead of nonzero initializer
out = 1;
The high-level-synthesis bug type of the code is: ZERO
The right code snippet is:
out = 0; | ZERO |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Copying from the wrong half of a split buffer
ap_uint<8> buffer[2];
buffer[0] = 1;
buffer[1] = 2;
out = buffer[1];
The right code snippet is:
out = out + 1; | BUF |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = out + 1; | BUF |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Copying from the wrong half of a split buffer
ap_uint<8> buffer[2];
buffer[0] = 1;
buffer[1] = 2;
out = 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:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Copying from the wrong half of a split buffer
ap_uint<8> buffer[2];
buffer[0] = 1;
buffer[1] = 2;
out = buffer[1];
The high-level-synthesis bug type of the code is: BUF
The right code snippet is:
out = out + 1; | BUF |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Array partition type error for the pragma '#pragma HLS array_partition'
#pragma HLS array_partition variable=out cyclic
out = out + 1;
The right code snippet is:
#pragma HLS array_partition variable=out complete
out = out + 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>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
#pragma HLS array_partition variable=out complete
out = out + 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>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Array partition type error for the pragma '#pragma HLS array_partition'
#pragma HLS array_partition variable=out cyclic
out = out + 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:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Array partition type error for the pragma '#pragma HLS array_partition'
#pragma HLS array_partition variable=out cyclic
out = out + 1;
The high-level-synthesis bug type of the code is: APT
The right code snippet is:
#pragma HLS array_partition variable=out complete... | APT |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Factor not divisible for the pragma '#pragma HLS array_partition'
#pragma HLS array_partition variable=out factor=3
out = out + 1;
The right code snippet is:
#pragma HLS array_partition variable=out complete
out = out + 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>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
#pragma HLS array_partition variable=out complete
out = out + 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>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Factor not divisible for the pragma '#pragma HLS array_partition'
#pragma HLS array_partition variable=out factor=3
out = out + 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:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Factor not divisible for the pragma '#pragma HLS array_partition'
#pragma HLS array_partition variable=out factor=3
out = out + 1;
The high-level-synthesis bug type of the code is: FND
The right code snippet is:
#pragma HLS array_partition variable=out complete
out... | FND |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Dim incorrect dimension for the pragma '#pragma HLS array_partition'
#pragma HLS array_partition variable=out complete dim=2
out = out + 1;
The right code snippet is:
#pragma HLS array_partition variable=out complete dim=1
out = out + 1; | DID |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
#pragma HLS array_partition variable=out complete dim=1
out = out + 1; | DID |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Dim incorrect dimension for the pragma '#pragma HLS array_partition'
#pragma HLS array_partition variable=out complete dim=2
out = out + 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 <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Dim incorrect dimension for the pragma '#pragma HLS array_partition'
#pragma HLS array_partition variable=out complete dim=2
out = out + 1;
The high-level-synthesis bug type of the code is: DID
The right code snippet is:
#pragma HLS array_partition variable=out com... | DID |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Dataflow position error for the pragma '#pragma HLS dataflow'
#pragma HLS dataflow
out = out + 1;
The right code snippet is:
out = out + 1; | DFP |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = out + 1; | DFP |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Dataflow position error for the pragma '#pragma HLS dataflow'
#pragma HLS dataflow
out = out + 1;
The high-level-synthesis bug type of the code is: DFP | DFP |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Dataflow position error for the pragma '#pragma HLS dataflow'
#pragma HLS dataflow
out = out + 1;
The high-level-synthesis bug type of the code is: DFP
The right code snippet is:
out = out + 1; | DFP |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// Incorrect data access pattern for the pragma '#pragma HLS interface'
#pragma HLS interface ap_fifo port=out
out = out + 1;
The right code snippet is:
out = out + 1; | IDAP |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = out + 1; | IDAP |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// Incorrect data access pattern for the pragma '#pragma HLS interface'
#pragma HLS interface ap_fifo port=out
out = out + 1;
The high-level-synthesis bug type of the code is: IDAP | IDAP |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// Incorrect data access pattern for the pragma '#pragma HLS interface'
#pragma HLS interface ap_fifo port=out
out = out + 1;
The high-level-synthesis bug type of the code is: IDAP
The right code snippet is:
out = out + 1; | IDAP |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS ... |
The wrong part of the code is:
// m_axi interface is accessed randomly in the code, resulting in non-burst AXI read/write for the pragma '#pragma HLS interface'
#pragma HLS interface m_axi port=out
out = out + 1;
The right code snippet is:
out = out + 1; | 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 counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#pragma HLS INTER... |
The right code snippet is:
out = out + 1; | 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 counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=clk
#... |
The wrong part of the code is:
// m_axi interface is accessed randomly in the code, resulting in non-burst AXI read/write for the pragma '#pragma HLS interface'
#pragma HLS interface m_axi port=out
out = out + 1;
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 counter(ap_uint<1> clk, ap_uint<1> rst, ap_uint<4>& out) {
#pragma HLS INTERFACE ap_ctrl_none port=return
... |
The wrong part of the code is:
// m_axi interface is accessed randomly in the code, resulting in non-burst AXI read/write for the pragma '#pragma HLS interface'
#pragma HLS interface m_axi port=out
out = out + 1;
The high-level-synthesis bug type of the code is: RAMB
The right code snippet is:
out ... | RAMB |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.