instruction stringlengths 139 357k | response stringlengths 36 4.54k | buggy_type stringclasses 745
values |
|---|---|---|
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_none port=A,B
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=sum
void adder(int A, int B, int& sum){
sum = A + B;
i... |
The wrong part of the code is:
#pragma HLS unroll factor=2
The right code snippet is:
#pragma HLS unroll | 'ILNU' |
Given the following buggy code, and the wrong part of the code, generate the right code snippet:
The buggy code is:
#pragma HLS INTERFACE ap_none port=A,B
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=sum
void adder(int A, int B, int& sum){
sum = A + B;
if (su... |
The right code snippet is:
#pragma HLS unroll | 'ILNU' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#pragma HLS INTERFACE ap_none port=A,B
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=sum
void adder(int A, int B, int& sum){
sum = A... |
The wrong part of the code is:
#pragma HLS unroll factor=2
The high-level-synthesis bug type of the code is: 'ILNU' | 'ILNU' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#pragma HLS INTERFACE ap_none port=A,B
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE ap_none port=sum
void adder... |
The wrong part of the code is:
#pragma HLS unroll factor=2
The high-level-synthesis bug type of the code is: 'ILNU'
The right code snippet is:
#pragma HLS unroll | 'ILNU' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
q = (data.range(0, 1), data.range(2, 3));
The right code snippet is:
q = (data.range(1, 0), data.range(3, 2)); | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
q = (data.range(1, 0), data.range(3, 2)); | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
q = (data.range(0, 1), data.range(2, 3));
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
q = (data.range(0, 1), data.range(2, 3));
The high-level-synthesis bug type of the code is: 'OOB'
The right code snippet is:
q = (data.range(1, 0), data.range(3, 2)); | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
ap_uint<4> q_barrel = 0;
The right code snippet is:
ap_uint<4> q_barrel; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
ap_uint<4> q_barrel; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
ap_uint<4> q_barrel = 0;
The high-level-synthesis bug type of the code is: 'INIT' | 'INIT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
ap_uint<4> q_barrel = 0;
The high-level-synthesis bug type of the code is: 'INIT'
The right code snippet is:
ap_uint<4> q_barrel; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
q = (data.range(2, 1), data.range(0, 3));
The right code snippet is:
q = (data.range(1, 0), data.range(3, 2)); | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
q = (data.range(1, 0), data.range(3, 2)); | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
```
#include <ap_int.h>
void priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
q = (data.range(2, 1), data.range(0, 3));
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
q = (data.range(2, 1), data.range(0, 3));
The high-level-synthesis bug type of the code is: 'SHFT'
The right code snippet is:
q = (data.range(1, 0), data.range(3, 2)); | 'SHFT' |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x0; break;
case 0... |
The wrong part of the code is:
case 0xE: Y = 0x0; break;
The right code snippet is:
case 0xE: Y = 0x3; break; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x0; break;
case 0xD: Y... |
The right code snippet is:
case 0xE: Y = 0x3; break; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x0; break;
... |
The wrong part of the code is:
case 0xE: Y = 0x0; break;
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
case 0xE: Y = 0x0; break;
The high-level-synthesis bug type of the code is: 'INF'
The right code snippet is:
case 0xE: Y = 0x3; break; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
q = Y & data;
The right code snippet is:
q = Y | data; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
q = Y | data; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
q = Y & data;
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
q = Y & data;
The high-level-synthesis bug type of the code is: 'USE'
The right code snippet is:
q = Y | data; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
for(int i = 0; i < 4; i++){
functional_module(Y, q_barrel, q);
}
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
for(int i = 0; i < 4; i++){
functional_module(Y, q_barrel, q);
}
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
for(int i = 0; i < 4; i++){
functional_module(Y, q_barrel, q);
}
The high-level-synthesis bug type of the code is: 'MLU'
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
ap_uint<4> q_barrel = 0;
The right code snippet is:
ap_uint<4> q_barrel; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
ap_uint<4> q_barrel; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
ap_uint<4> q_barrel = 0;
The high-level-synthesis bug type of the code is: 'ZERO' | 'ZERO' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
ap_uint<4> q_barrel = 0;
The high-level-synthesis bug type of the code is: 'ZERO'
The right code snippet is:
ap_uint<4> q_barrel; | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
memcpy(q_barrel, data, 4);
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
memcpy(q_barrel, data, 4);
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
memcpy(q_barrel, data, 4);
The high-level-synthesis bug type of the code is: 'BUF'
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
#pragma HLS array_partition variable=q_barrel cyclic factor=3
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
#pragma HLS array_partition variable=q_barrel cyclic factor=3
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
#pragma HLS array_partition variable=q_barrel cyclic factor=3
The high-level-synthesis bug type of the code is: 'APT'
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
#pragma HLS array_partition variable=q_barrel cyclic factor=5
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
#pragma HLS array_partition variable=q_barrel cyclic factor=5
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
#pragma HLS array_partition variable=q_barrel cyclic factor=5
The high-level-synthesis bug type of the code is: 'FND'
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
#pragma HLS array_partition variable=q_barrel cyclic dim=2 factor=2
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
#pragma HLS array_partition variable=q_barrel cyclic dim=2 factor=2
The high-level-synthesis bug type of the code is: 'DID' | 'DID' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
#pragma HLS array_partition variable=q_barrel cyclic dim=2 factor=2
The high-level-synthesis bug type of the code is: 'DID'
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
#pragma HLS dataflow
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
#pragma HLS dataflow
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
#pragma HLS dataflow
The high-level-synthesis bug type of the code is: 'DFP'
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
#pragma HLS interface ap_fifo port=data
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
#pragma HLS interface ap_fifo port=data
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
#pragma HLS interface ap_fifo port=data
The high-level-synthesis bug type of the code is: 'IDAP'
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
#pragma HLS interface m_axi port=data random
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
#pragma HLS interface m_axi port=data random
The high-level-synthesis bug type of the code is: 'RAMB' | 'RAMB' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
#pragma HLS interface m_axi port=data random
The high-level-synthesis bug type of the code is: 'RAMB'
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
#pragma HLS interface ap_memory port=data
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
#pragma HLS interface ap_memory port=data
The high-level-synthesis bug type of the code is: 'SMA' | 'SMA' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
#pragma HLS interface ap_memory port=data
The high-level-synthesis bug type of the code is: 'SMA'
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
#pragma HLS interface s_axilite port=data
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
#pragma HLS interface s_axilite port=data
The high-level-synthesis bug type of the code is: 'AMS' | 'AMS' |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
```
#include <ap_int.h>
void priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
#pragma HLS interface s_axilite port=data
The high-level-synthesis bug type of the code is: 'AMS'
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
#pragma HLS pipeline II=2
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
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:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0... |
The wrong part of the code is:
#pragma HLS unroll factor=2 inner_loop_nomerge
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
case 0xD: Y... |
The right code snippet is:
None | '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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
case 0xE: Y = 0x3; break;
... |
The wrong part of the code is:
#pragma HLS unroll factor=2 inner_loop_nomerge
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 priority_encoder(bool A, bool B, bool C, bool D, ap_uint<2> &Y) {
switch (ap_uint<4>({D, C, B, A})) {
... |
The wrong part of the code is:
#pragma HLS unroll factor=2 inner_loop_nomerge
The high-level-synthesis bug type of the code is: 'ILNU'
The right code snippet is:
None | '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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
if (ctrl == 0) {
... |
The wrong part of the code is:
temp_out = in_0 + in_1 + 1;
The right code snippet is:
temp_out = in_0 + in_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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
if (ctrl == 0) {
temp... |
The right code snippet is:
temp_out = in_0 + in_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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
if (ctrl == 0... |
The wrong part of the code is:
temp_out = in_0 + in_1 + 1;
The high-level-synthesis bug type of the code is: OOB | OOB |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;... |
The wrong part of the code is:
temp_out = in_0 + in_1 + 1;
The high-level-synthesis bug type of the code is: OOB
The right code snippet is:
temp_out = in_0 + in_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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out = 0;
bool temp_ov;
if (ctrl == 0) {
... |
The wrong part of the code is:
ap_uint<5> temp_out = 0;
The right code snippet is:
ap_uint<5> temp_out; | 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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out = 0;
bool temp_ov;
if (ctrl == 0) {
... |
The right code snippet is:
ap_uint<5> temp_out; | INIT |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type
The buggy code is:
#include <ap_int.h>
void addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out = 0;
bool temp_ov;
if (ctrl ... |
The wrong part of the code is:
ap_uint<5> temp_out = 0;
The high-level-synthesis bug type of the code is: INIT | INIT |
Given the following buggy code, tell which part of the code is wrong, and tell the high-level-synthesis bug type, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out ... |
The wrong part of the code is:
ap_uint<5> temp_out = 0;
The high-level-synthesis bug type of the code is: INIT
The right code snippet is:
ap_uint<5> temp_out; | INIT |
Given the following buggy code, tell which part of the code is wrong, and tell the right code snippet
The buggy code is:
#include <ap_int.h>
void addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
if (ctrl == 0) {
... |
The wrong part of the code is:
temp_out = in_0 << in_1;
The right code snippet is:
temp_out = in_0 - in_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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
if (ctrl == 0) {
temp... |
The right code snippet is:
temp_out = in_0 - in_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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
if (ctrl == 0... |
The wrong part of the code is:
temp_out = in_0 << in_1;
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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;... |
The wrong part of the code is:
temp_out = in_0 << in_1;
The high-level-synthesis bug type of the code is: SHFT
The right code snippet is:
temp_out = in_0 - in_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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
while (ctrl == 0) {
... |
The wrong part of the code is:
while (ctrl == 0) {
The right code snippet is:
if (ctrl == 0) { | 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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
while (ctrl == 0) {
t... |
The right code snippet is:
if (ctrl == 0) { | 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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
while (ctrl =... |
The wrong part of the code is:
while (ctrl == 0) {
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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;... |
The wrong part of the code is:
while (ctrl == 0) {
The high-level-synthesis bug type of the code is: INF
The right code snippet is:
if (ctrl == 0) { | 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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
int temp_ov;
if (ctrl == 0) {
... |
The wrong part of the code is:
int temp_ov;
The right code snippet is:
bool temp_ov; | 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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
int temp_ov;
if (ctrl == 0) {
temp_... |
The right code snippet is:
bool temp_ov; | 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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
int temp_ov;
if (ctrl == 0)... |
The wrong part of the code is:
int temp_ov;
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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;... |
The wrong part of the code is:
int temp_ov;
The high-level-synthesis bug type of the code is: USE
The right code snippet is:
bool temp_ov; | 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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
if (ctrl == 0) {
... |
The wrong part of the code is:
for (int i = 0; i < 10; i++) {
temp_out = in_0 + in_1;
}
The right code snippet is:
None. | 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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
if (ctrl == 0) {
temp... |
The right code snippet is:
None. | 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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;
bool temp_ov;
if (ctrl == 0... |
The wrong part of the code is:
for (int i = 0; i < 10; i++) {
temp_out = in_0 + in_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 addsub_4bit(ap_uint<4> in_0, ap_uint<4> in_1, bool ctrl, ap_uint<4>& out, bool& ov) {
ap_uint<5> temp_out;... |
The wrong part of the code is:
for (int i = 0; i < 10; i++) {
temp_out = in_0 + in_1;
}
The high-level-synthesis bug type of the code is: MLU
The right code snippet is:
None. | MLU |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.