cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
simulation_utils.cpp
Go to the documentation of this file.
1 
17 // *
18 // * cloudFPGA
19 // * =============================================
20 // * Created: Aug 2019
21 // * Authors: FAB, WEI, NGL
22 // *
23 // * Description:
24 // * This file contains utiliy functions for HLS simulations.
25 // *
26 // *
27 
28 
29 #include <stdio.h>
30 #include <iostream>
31 #include <fstream>
32 #include <string>
33 #include <math.h>
34 #include <hls_stream.h>
35 #include <stdint.h>
36 #include <vector>
37 
38 #include "ap_int.h"
39 
40 #include "simulation_utils.hpp"
41 
42 using namespace hls;
43 using namespace std;
44 
45 
46 
52 void printAxiWord(const char *callerName, AxisRaw chunk)
53 {
54  printInfo(callerName, "AxiWord = {D=0x%16.16lX, K=0x%2.2X, L=%d} \n",
55  chunk.getTData().to_ulong(), chunk.getTKeep().to_int(), chunk.getTLast().to_int());
56 }
57 
58 void printAxiWord(const char *callerName, NetworkWord chunk)
59 {
60  printInfo(callerName, "AxiWord = {D=0x%16.16lX, K=0x%2.2X, L=%d} \n",
61  chunk.tdata.to_ulong(), chunk.tkeep.to_int(), chunk.tlast.to_int());
62 }
63 
64 
65 
tData getTData(int leHi=64 -1, int leLo=0) const
Definition: AxisRaw.hpp:191
tLast getTLast() const
Definition: AxisRaw.hpp:219
tKeep getTKeep(int leHi=64/8-1, int leLo=0) const
Definition: AxisRaw.hpp:207
#define printInfo(callerName, format,...)
A macro to print an information message.
Definition: nts_utils.hpp:169
void printAxiWord(const char *callerName, AxisRaw chunk)
Prints one chunk of a data stream (used for debugging).
ap_uint< 64 > tdata
Definition: network.hpp:49
ap_uint< 8 > tkeep
Definition: network.hpp:50
ap_uint< 1 > tlast
Definition: network.hpp:51