cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
iprx.hpp
Go to the documentation of this file.
1 
17 
43 
56 #ifndef _IPRX_H_
57 #define _IPRX_H_
58 
59 #include <ap_shift_reg.h>
60 
61 #include "../../../NTS/nts.hpp"
62 #include "../../../NTS/nts_utils.hpp"
63 #include "../../../NTS/SimNtsUtils.hpp"
64 #include "../../../NTS/AxisArp.hpp"
65 #include "../../../NTS/AxisEth.hpp"
66 #include "../../../NTS/AxisIp4.hpp"
67 
68 const UdpLen MaxDatagramSize = 32768; // Maximum size of an IP datagram in bytes [FIXME - Why not 65535?]
69 
70 
73 class SubSums {
74  public:
75  ap_uint<17> sum0;
76  ap_uint<17> sum1;
77  ap_uint<17> sum2;
78  ap_uint<17> sum3;
79  bool ipMatch;
80  SubSums() {}
81  SubSums(ap_uint<17> sums[4], bool match) :
82  sum0(sums[0]), sum1(sums[1]), sum2(sums[2]), sum3(sums[3]), ipMatch(match) {}
83  SubSums(ap_uint<17> s0, ap_uint<17> s1, ap_uint<17> s2, ap_uint<17> s3, bool match) :
84  sum0(s0), sum1(s1), sum2(s2), sum3(s3), ipMatch(match) {}
85 };
86 
87 
92 #if HLS_VERSION == 2017
93 
94  void iprx_top(
95  //------------------------------------------------------
96  //-- MMIO Interfaces
97  //------------------------------------------------------
98  EthAddr piMMIO_MacAddress,
99  Ip4Addr piMMIO_Ip4Address,
100 
101  //------------------------------------------------------
102  //-- ETHernet MAC Layer Interface
103  //------------------------------------------------------
104  stream<AxisEth> &siETH_Data,
105 
106  //------------------------------------------------------
107  //-- ARP Interface
108  //------------------------------------------------------
109  stream<AxisArp> &soARP_Data,
110 
111  //------------------------------------------------------
112  //-- ICMP Interfaces
113  //------------------------------------------------------
114  stream<AxisIp4> &soICMP_Data,
115  stream<AxisIp4> &soICMP_Derr,
116 
117  //------------------------------------------------------
118  //-- UDP Interface
119  //------------------------------------------------------
120  stream<AxisIp4> &soUOE_Data,
121 
122  //------------------------------------------------------
123  //-- TOE Interface
124  //------------------------------------------------------
125  stream<AxisIp4> &soTOE_Data
126  );
127 
128 #else
129 
130  void iprx_top(
131  //------------------------------------------------------
132  //-- MMIO Interfaces
133  //------------------------------------------------------
134  EthAddr piMMIO_MacAddress,
135  Ip4Addr piMMIO_Ip4Address,
136 
137  //------------------------------------------------------
138  //-- ETHernet MAC Layer Interface
139  //------------------------------------------------------
140  stream<AxisRaw> &siETH_Data,
141 
142  //------------------------------------------------------
143  //-- ARP Interface
144  //------------------------------------------------------
145  stream<AxisRaw> &soARP_Data,
146 
147  //------------------------------------------------------
148  //-- ICMP Interfaces
149  //------------------------------------------------------
150  stream<AxisRaw> &soICMP_Data,
151  stream<AxisRaw> &soICMP_Derr,
152 
153  //------------------------------------------------------
154  //-- UDP Interface
155  //------------------------------------------------------
156  stream<AxisRaw> &soUOE_Data,
157 
158  //------------------------------------------------------
159  //-- TOE Interface
160  //------------------------------------------------------
161  stream<AxisRaw> &soTOE_Data
162  );
163 
164 #endif // HLS_VERSION
165 
166 #endif
167 
Definition: iprx.hpp:73
ap_uint< 17 > sum1
Definition: iprx.hpp:76
SubSums(ap_uint< 17 > sums[4], bool match)
Definition: iprx.hpp:81
SubSums(ap_uint< 17 > s0, ap_uint< 17 > s1, ap_uint< 17 > s2, ap_uint< 17 > s3, bool match)
Definition: iprx.hpp:83
ap_uint< 17 > sum0
Definition: iprx.hpp:75
bool ipMatch
Definition: iprx.hpp:79
SubSums()
Definition: iprx.hpp:80
ap_uint< 17 > sum2
Definition: iprx.hpp:77
ap_uint< 17 > sum3
Definition: iprx.hpp:78
ap_uint< 16 > UdpLen
Definition: nal.hpp:250
const UdpLen MaxDatagramSize
Definition: iprx.hpp:68
void iprx_top(EthAddr piMMIO_MacAddress, Ip4Addr piMMIO_Ip4Address, stream< AxisRaw > &siETH_Data, stream< AxisRaw > &soARP_Data, stream< AxisRaw > &soICMP_Data, stream< AxisRaw > &soICMP_Derr, stream< AxisRaw > &soUOE_Data, stream< AxisRaw > &soTOE_Data)
Top of IP Receive handler (IPRX)
Definition: iprx.cpp:1032
ap_uint< 48 > EthAddr
Definition: AxisEth.hpp:120
ap_uint< 32 > Ip4Addr
Definition: AxisIp4.hpp:169