cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
arp.hpp
Go to the documentation of this file.
1 
17 
43 
56 #ifndef _ARP_H_
57 #define _ARP_H_
58 
59 #include "../../../NTS/nts.hpp"
60 #include "../../../NTS/nts_utils.hpp"
61 #include "../../../NTS/SimNtsUtils.hpp"
62 #include "../../AxisEth.hpp"
63 
64 
69 class ArpMeta // ARP Metadata
70 {
71  public:
80  ArpMeta() {}
81 };
82 
83 
86 typedef ap_uint<1> ArpLkpOp;
88 
89 
93  public:
94  EthAddr value; // 48-bits
95  Ip4Addr key; // 32-bits
96  ArpLkpOp opcode; // 1-bit : '0' is INSERT, '1' is DELETE
97 
100  key(key), value(value), opcode(opcode) {}
101 };
102 
103 
107  public:
108  EthAddr value; // 48-bits
109  ArpLkpOp opcode; // 1-bit : '0' is INSERT, '1' is DELETE
110 
113  opcode(opcode) {}
115  value(value), opcode(opcode) {}
116 };
117 
118 
122  public:
126  key(searchKey) {}
127 };
128 
129 
133  public:
134  EthAddr value; // 48 bits
135  HitBool hit; // 8 bits
138  hit(hit), value(value) {}
139 };
140 
141 
146 #if HLS_VERSION == 2017
147 
148  void arp_top(
149  //------------------------------------------------------
150  //-- MMIO Interfaces
151  //------------------------------------------------------
152  EthAddr piMMIO_MacAddress,
153  Ip4Addr piMMIO_Ip4Address,
154  //------------------------------------------------------
155  //-- IPRX Interface
156  //------------------------------------------------------
157  stream<AxisEth> &siIPRX_Data,
158  //------------------------------------------------------
159  //-- ETH Interface
160  //------------------------------------------------------
161  stream<AxisEth> &soETH_Data,
162  //------------------------------------------------------
163  //-- IPTX Interfaces
164  //------------------------------------------------------
165  stream<Ip4Addr> &siIPTX_MacLkpReq,
166  stream<ArpLkpReply> &soIPTX_MacLkpRep,
167  //------------------------------------------------------
168  //-- CAM Interfaces
169  //------------------------------------------------------
170  stream<RtlMacLookupRequest> &soCAM_MacLkpReq,
171  stream<RtlMacLookupReply> &siCAM_MacLkpRep,
172  stream<RtlMacUpdateRequest> &soCAM_MacUpdReq,
173  stream<RtlMacUpdateReply> &siCAM_MacUpdRep
174  );
175 
176 #else
177  void arp_top(
178  //------------------------------------------------------
179  //-- MMIO Interfaces
180  //------------------------------------------------------
181  EthAddr piMMIO_MacAddress,
182  Ip4Addr piMMIO_Ip4Address,
183  //------------------------------------------------------
184  //-- IPRX Interface
185  //------------------------------------------------------
186  stream<AxisRaw> &siIPRX_Data,
187  //------------------------------------------------------
188  //-- ETH Interface
189  //------------------------------------------------------
190  stream<AxisRaw> &soETH_Data,
191  //------------------------------------------------------
192  //-- IPTX Interfaces
193  //------------------------------------------------------
194  stream<Ip4Addr> &siIPTX_MacLkpReq,
195  stream<ArpLkpReply> &soIPTX_MacLkpRep,
196  //------------------------------------------------------
197  //-- CAM Interfaces
198  //------------------------------------------------------
199  stream<RtlMacLookupRequest> &soCAM_MacLkpReq,
200  stream<RtlMacLookupReply> &siCAM_MacLkpRep,
201  stream<RtlMacUpdateRequest> &soCAM_MacUpdReq,
202  stream<RtlMacUpdateReply> &siCAM_MacUpdRep
203  );
204 #endif // HLS_VERSION
205 
206 #endif
207 
Definition: arp.hpp:70
EtherType etherType
Definition: arp.hpp:73
ArpProtLen arpProtLen
Definition: arp.hpp:77
ArpSendHwAddr arpSendHwAddr
Definition: arp.hpp:78
ArpHwLen arpHwLen
Definition: arp.hpp:76
EthAddr remoteMacAddr
Definition: arp.hpp:72
ArpHwType arpHwType
Definition: arp.hpp:74
ArpProtType arpProtType
Definition: arp.hpp:75
ArpSendProtAddr arpSendProtAddr
Definition: arp.hpp:79
ArpMeta()
Definition: arp.hpp:80
RtlMacLookupReply(HitBool hit, EthAddr value)
Definition: arp.hpp:137
HitBool hit
Definition: arp.hpp:135
EthAddr value
Definition: arp.hpp:134
RtlMacLookupRequest(Ip4Addr searchKey)
Definition: arp.hpp:125
RtlMacUpdateReply(ArpLkpOp opcode)
Definition: arp.hpp:112
ArpLkpOp opcode
Definition: arp.hpp:109
RtlMacUpdateReply(EthAddr value, ArpLkpOp opcode)
Definition: arp.hpp:114
EthAddr value
Definition: arp.hpp:108
ArpLkpOp opcode
Definition: arp.hpp:96
EthAddr value
Definition: arp.hpp:94
Ip4Addr key
Definition: arp.hpp:95
RtlMacUpdateRequest(Ip4Addr key, EthAddr value, ArpLkpOp opcode)
Definition: arp.hpp:99
void arp_top(EthAddr piMMIO_MacAddress, Ip4Addr piMMIO_Ip4Address, stream< AxisRaw > &siIPRX_Data, stream< AxisRaw > &soETH_Data, stream< Ip4Addr > &siIPTX_MacLkpReq, stream< ArpLkpReply > &soIPTX_MacLkpRep, stream< RtlMacLookupRequest > &soCAM_MacLkpReq, stream< RtlMacLookupReply > &siCAM_MacLkpRep, stream< RtlMacUpdateRequest > &soCAM_MacUpdReq, stream< RtlMacUpdateReply > &siCAM_MacUpdRep)
Top of Address Resolution Protocol (ARP) Server.
Definition: arp.cpp:664
ap_uint< 1 > ArpLkpOp
Definition: arp.hpp:86
ArpLkpOpCodes
Definition: arp.hpp:87
@ ARP_INSERT
Definition: arp.hpp:87
@ ARP_DELETE
Definition: arp.hpp:87
ap_uint< 16 > ArpProtType
Definition: AxisArp.hpp:96
ap_uint< 48 > EthAddr
Definition: AxisEth.hpp:120
ap_uint< 48 > ArpSendHwAddr
Definition: AxisArp.hpp:100
ap_uint< 8 > ArpProtLen
Definition: AxisArp.hpp:98
ap_uint< 32 > ArpSendProtAddr
Definition: AxisArp.hpp:101
ap_uint< 8 > ArpHwLen
Definition: AxisArp.hpp:97
ap_uint< 32 > Ip4Addr
Definition: AxisIp4.hpp:169
bool HitBool
Definition: nts_types.hpp:125
ap_uint< 16 > ArpHwType
Definition: AxisArp.hpp:95
ap_uint< 16 > EtherType
Definition: AxisEth.hpp:122