Skip to content

Commit 4e6d5fd

Browse files
Virat Agarwalheeran-xilinx
authored andcommitted
Converting kernel data width to 512 from 32 (#406)
1 parent b279c76 commit 4e6d5fd

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

host/streaming_free_running_h2k/qor.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
"check_timing": "true",
1010
"PipelineType": "none",
1111
"check_latency": "false",
12-
"check_warning": "true"
12+
"check_warning": "true",
13+
"loops": [
14+
{
15+
"name": "increment1",
16+
"PipelineII": "1"
17+
}
18+
]
1319
}
1420
]
1521
}

host/streaming_free_running_h2k/src/increment.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3636
#include <ap_int.h>
3737
#include <hls_stream.h>
3838

39-
#define DWIDTH 32
39+
#define DWIDTH 512
4040
typedef qdma_axis<DWIDTH, 0, 0, 0> pkt;
4141
extern "C" {
4242
void increment(hls::stream<pkt> &input, hls::stream<pkt> &output) {
@@ -48,20 +48,21 @@ void increment(hls::stream<pkt> &input, hls::stream<pkt> &output) {
4848
// in running states.
4949
#pragma HLS interface ap_ctrl_none port = return
5050

51-
union {
52-
int ival;
53-
float fval;
54-
} tmp;
55-
51+
increment1:
5652
while (true) {
5753
// Read the input data from the qdma
5854
pkt t = input.read();
5955
pkt t_out;
6056
ap_uint<DWIDTH> tmp_out;
6157

6258
// Setup the output data
63-
tmp.ival = t.data;
64-
t_out.set_data(tmp.ival + 1);
59+
ap_uint<DWIDTH> tmp = t.data;
60+
for (int i = 0; i < 16; i++) {
61+
#pragma HLS UNROLL
62+
tmp_out.range((i + 1) * 32 - 1, i * 32) =
63+
tmp.range((i + 1) * 32 - 1, i * 32) + 1;
64+
}
65+
t_out.data = tmp_out;
6566
t_out.set_keep(-1);
6667
t_out.set_last(0);
6768

0 commit comments

Comments
 (0)