Add `INSTID` to all rdma subfunctions (2 nodes works)
This commit is contained in:
parent
26a945eeea
commit
c3eba29fa3
|
@ -428,7 +428,7 @@ void convertStreamWidth(hls::stream<net_axis<W> >& input, hls::stream<net_axis<W
|
|||
}
|
||||
|
||||
// The 2nd template parameter is a hack to use this function multiple times
|
||||
template <typename T, int W, int whatever>
|
||||
template <typename T, int W, int whatever, int INSTID = 0>
|
||||
void rshiftWordByOctet( uint16_t offset,
|
||||
hls::stream<T>& input,
|
||||
hls::stream<T>& output)
|
||||
|
@ -503,7 +503,7 @@ void rshiftWordByOctet( uint16_t offset,
|
|||
}
|
||||
|
||||
// The 2nd template parameter is a hack to use this function multiple times
|
||||
template <int W, int whatever>
|
||||
template <int W, int whatever, int INSTID = 0>
|
||||
void lshiftWordByOctet( uint16_t offset,
|
||||
hls::stream<net_axis<W> >& input,
|
||||
hls::stream<net_axis<W> >& output)
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
/************************************************
|
||||
Copyright (c) 2019, Systems Group, ETH Zurich.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
************************************************/
|
||||
#include "conn_table.hpp"
|
||||
#include <rocev2_config.hpp> //defines MAX_QPS
|
||||
|
||||
void conn_table( hls::stream<ap_uint<16> >& tx_ibhconnTable_req,
|
||||
hls::stream<ifConnReq>& qpi2connTable_req,
|
||||
hls::stream<connTableEntry>& tx_connTable2ibh_rsp)
|
||||
{
|
||||
#pragma HLS PIPELINE II=1
|
||||
#pragma HLS INLINE off
|
||||
|
||||
static connTableEntry conn_table[MAX_QPS];
|
||||
//#pragma HLS RESOURCE variable=conn_table core=RAM_2P_BRAM
|
||||
|
||||
ap_uint<16> txRequest;
|
||||
ifConnReq ifRequest;
|
||||
|
||||
if (!tx_ibhconnTable_req.empty())
|
||||
{
|
||||
tx_ibhconnTable_req.read(txRequest);
|
||||
//std::cout << "Requested conn data for: " << txRequest << std::endl;
|
||||
tx_connTable2ibh_rsp.write(conn_table[txRequest]);
|
||||
}
|
||||
else if (!qpi2connTable_req.empty())
|
||||
{
|
||||
qpi2connTable_req.read(ifRequest);
|
||||
//std::cout << "Storing conn data for: " << ifRequest.qpn << std::endl;
|
||||
conn_table[ifRequest.qpn].remote_qpn = ifRequest.remote_qpn;
|
||||
conn_table[ifRequest.qpn].remote_ip_address = ifRequest.remote_ip_address;
|
||||
conn_table[ifRequest.qpn].remote_udp_port = ifRequest.remote_udp_port;
|
||||
}
|
||||
}
|
|
@ -30,6 +30,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include "../axi_utils.hpp"
|
||||
#include "../ib_transport_protocol/ib_transport_protocol.hpp"
|
||||
#include <rocev2_config.hpp> //defines MAX_QPS
|
||||
|
||||
struct connTableEntry
|
||||
{
|
||||
|
@ -39,6 +40,38 @@ struct connTableEntry
|
|||
ap_uint<16> remote_udp_port; //TODO what is this used for
|
||||
};
|
||||
|
||||
template <int INSTID>
|
||||
void conn_table( hls::stream<ap_uint<16> >& tx_ibhconnTable_req,
|
||||
hls::stream<ifConnReq>& qpi2connTable_req,
|
||||
hls::stream<connTableEntry>& tx_connTable2ibh_rsp);
|
||||
hls::stream<connTableEntry>& tx_connTable2ibh_rsp);
|
||||
|
||||
|
||||
template <int INSTID>
|
||||
void conn_table( hls::stream<ap_uint<16> >& tx_ibhconnTable_req,
|
||||
hls::stream<ifConnReq>& qpi2connTable_req,
|
||||
hls::stream<connTableEntry>& tx_connTable2ibh_rsp)
|
||||
{
|
||||
#pragma HLS PIPELINE II=1
|
||||
#pragma HLS INLINE off
|
||||
|
||||
static connTableEntry conn_table[MAX_QPS];
|
||||
//#pragma HLS RESOURCE variable=conn_table core=RAM_2P_BRAM
|
||||
|
||||
ap_uint<16> txRequest;
|
||||
ifConnReq ifRequest;
|
||||
|
||||
if (!tx_ibhconnTable_req.empty())
|
||||
{
|
||||
tx_ibhconnTable_req.read(txRequest);
|
||||
//std::cout << "Requested conn data for: " << txRequest << std::endl;
|
||||
tx_connTable2ibh_rsp.write(conn_table[txRequest]);
|
||||
}
|
||||
else if (!qpi2connTable_req.empty())
|
||||
{
|
||||
qpi2connTable_req.read(ifRequest);
|
||||
//std::cout << "Storing conn data for: " << ifRequest.qpn << std::endl;
|
||||
conn_table[ifRequest.qpn].remote_qpn = ifRequest.remote_qpn;
|
||||
conn_table[ifRequest.qpn].remote_ip_address = ifRequest.remote_ip_address;
|
||||
conn_table[ifRequest.qpn].remote_udp_port = ifRequest.remote_udp_port;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
/**
|
||||
* RX process IBH
|
||||
*/
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void rx_process_ibh(
|
||||
stream<net_axis<WIDTH> >& input,
|
||||
stream<ibhMeta>& metaOut,
|
||||
|
@ -98,7 +98,7 @@ void rx_process_ibh(
|
|||
/**
|
||||
* RX process EXH
|
||||
*/
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void rx_process_exh(
|
||||
stream<net_axis<WIDTH> >& input,
|
||||
stream<ibOpCode>& metaIn,
|
||||
|
@ -247,6 +247,7 @@ void rx_process_exh(
|
|||
//TODO check if RC_ACK is a NAK
|
||||
//TODO validate response is consistent with request
|
||||
//TODO actually any response in Unack region is valid, not just the next one.
|
||||
template <int INSTID = 0>
|
||||
void rx_ibh_fsm(
|
||||
stream<ibhMeta>& metaIn,
|
||||
stream<exhMeta>& exhMetaFifo,
|
||||
|
@ -439,7 +440,7 @@ void rx_ibh_fsm(
|
|||
* RDMA READ RESPONSE LAST: AETH, PayLd
|
||||
* ACK: AETH
|
||||
*/
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void rx_exh_fsm(
|
||||
stream<ibhMeta>& metaIn,
|
||||
stream<ap_uint<16> >& udpLengthFifo,
|
||||
|
@ -712,7 +713,7 @@ void rx_exh_fsm(
|
|||
* Drop out of order
|
||||
*/
|
||||
//Currently not used!!
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void drop_ooo_ibh(
|
||||
stream<net_axis<WIDTH> >& input,
|
||||
stream<bool>& metaIn,
|
||||
|
@ -770,7 +771,7 @@ void drop_ooo_ibh(
|
|||
/**
|
||||
* RX EXH payload
|
||||
*/
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void rx_exh_payload(
|
||||
stream<pkgSplit>& metaIn,
|
||||
stream<net_axis<WIDTH> >& input,
|
||||
|
@ -838,6 +839,7 @@ void rx_exh_payload(
|
|||
/**
|
||||
* Handling of the read requests
|
||||
*/
|
||||
template <int INSTID = 0>
|
||||
void handle_read_requests(
|
||||
stream<readRequest>& requestIn,
|
||||
stream<memCmdInternal>& memoryReadCmd,
|
||||
|
@ -899,7 +901,7 @@ void handle_read_requests(
|
|||
}
|
||||
}
|
||||
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void merge_rx_pkgs(
|
||||
stream<pkgShift>& rx_pkgShiftTypeFifo,
|
||||
stream<net_axis<WIDTH> >& rx_aethSift2mergerFifo,
|
||||
|
@ -981,6 +983,7 @@ void merge_rx_pkgs(
|
|||
/**
|
||||
* Local request handler
|
||||
*/
|
||||
template <int INSTID = 0>
|
||||
void local_req_handler(
|
||||
stream<txMeta>& s_axis_sq_meta,
|
||||
#if RETRANS_EN
|
||||
|
@ -1146,7 +1149,7 @@ void mem_cmd_merger(
|
|||
/**
|
||||
* TX pkg arbitration
|
||||
*/
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void tx_pkg_arbiter(
|
||||
stream<pkgInfo>& tx_pkgInfoFifo,
|
||||
stream<net_axis<WIDTH> >& s_axis_mem_read_data,
|
||||
|
@ -1339,7 +1342,7 @@ void meta_merger(
|
|||
*
|
||||
* For everything, except READ_RSP, we get PSN from state_table
|
||||
*/
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void generate_ibh(
|
||||
stream<ibhMeta>& metaIn,
|
||||
stream<ap_uint<24> >& dstQpIn,
|
||||
|
@ -1435,7 +1438,7 @@ void generate_ibh(
|
|||
* RDMA READ RESPONSE LAST: AETH, PayLd
|
||||
* ACK: AETH
|
||||
*/
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void generate_exh(
|
||||
stream<event>& metaIn,
|
||||
stream<txMsnRsp>& msnTable2txExh_rsp,
|
||||
|
@ -1701,7 +1704,7 @@ void generate_exh(
|
|||
/**
|
||||
* Append the payload
|
||||
*/
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void append_payload(
|
||||
stream<txPacketInfo>& packetInfoFifo,
|
||||
stream<net_axis<WIDTH> >& tx_headerFifo,
|
||||
|
@ -1849,7 +1852,7 @@ void append_payload(
|
|||
* Prepend the header
|
||||
*/
|
||||
//TODO this introduces 1 cycle for WIDTH > 64
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void prepend_ibh_header(
|
||||
stream<BaseTransportHeader<WIDTH> >& tx_ibhHeaderFifo,
|
||||
stream<net_axis<WIDTH> >& tx_ibhPayloadFifo,
|
||||
|
@ -1942,7 +1945,7 @@ void prepend_ibh_header(
|
|||
*/
|
||||
//TODO maybe all ACKS should be triggered by ibhFSM?? what is the guarantee we should/have to give
|
||||
//TODO this should become a BRAM, storage type of thing
|
||||
template <int WIDTH>
|
||||
template <int WIDTH, int INSTID = 0>
|
||||
void ipUdpMetaHandler(
|
||||
stream<ipUdpMeta>& input,
|
||||
stream<ExHeader<WIDTH> >& exHeaderInput,
|
||||
|
@ -2388,7 +2391,7 @@ void ib_transport_protocol(
|
|||
#pragma HLS STREAM depth=2 variable=tx_dstQpFifo
|
||||
|
||||
// Interface
|
||||
qp_interface(s_axis_qp_interface, stateTable2qpi_rsp, qpi2stateTable_upd_req, if2msnTable_init);
|
||||
qp_interface<INSTID>(s_axis_qp_interface, stateTable2qpi_rsp, qpi2stateTable_upd_req, if2msnTable_init);
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -2415,7 +2418,7 @@ void ib_transport_protocol(
|
|||
#pragma HLS DATA_PACK variable=rx_exhMetaFifo
|
||||
#endif
|
||||
|
||||
rx_process_ibh(
|
||||
rx_process_ibh<WIDTH, INSTID>(
|
||||
s_axis_rx_data,
|
||||
rx_ibh2fsm_MetaFifo,
|
||||
rx_ibh2exh_MetaFifo,
|
||||
|
@ -2426,9 +2429,9 @@ void ib_transport_protocol(
|
|||
regValidIbvCountRx
|
||||
);
|
||||
|
||||
rshiftWordByOctet<net_axis<WIDTH>, WIDTH,11>(((BTH_SIZE%WIDTH)/8), rx_ibh2shiftFifo, rx_shift2exhFifo);
|
||||
rshiftWordByOctet<net_axis<WIDTH>, WIDTH,11, INSTID>(((BTH_SIZE%WIDTH)/8), rx_ibh2shiftFifo, rx_shift2exhFifo);
|
||||
|
||||
rx_process_exh(
|
||||
rx_process_exh<WIDTH, INSTID>(
|
||||
rx_shift2exhFifo,
|
||||
rx_ibh2exh_MetaFifo,
|
||||
rx_exhMetaFifo,
|
||||
|
@ -2436,7 +2439,7 @@ void ib_transport_protocol(
|
|||
rx_exh2dropFifo
|
||||
);
|
||||
|
||||
rx_ibh_fsm(
|
||||
rx_ibh_fsm<INSTID>(
|
||||
rx_ibh2fsm_MetaFifo,
|
||||
rx_exhMetaFifo,
|
||||
stateTable2rxIbh_rsp,
|
||||
|
@ -2452,12 +2455,12 @@ void ib_transport_protocol(
|
|||
regInvalidPsnDropCount
|
||||
);
|
||||
|
||||
drop_ooo_ibh(rx_exh2dropFifo, rx_ibhDropFifo, rx_ibhDrop2exhFifo);
|
||||
drop_ooo_ibh<WIDTH, INSTID>(rx_exh2dropFifo, rx_ibhDropFifo, rx_ibhDrop2exhFifo);
|
||||
|
||||
//some hack TODO, make this nicer.. not sure what this is still for
|
||||
ipUdpMetaHandler(s_axis_rx_meta, rx_exh2drop_MetaFifo, rx_ibhDropMetaFifo, exh_lengthFifo, rx_drop2exhFsm_MetaFifo);
|
||||
ipUdpMetaHandler<WIDTH, INSTID>(s_axis_rx_meta, rx_exh2drop_MetaFifo, rx_ibhDropMetaFifo, exh_lengthFifo, rx_drop2exhFsm_MetaFifo);
|
||||
|
||||
rx_exh_fsm(
|
||||
rx_exh_fsm<WIDTH, INSTID>(
|
||||
rx_fsm2exh_MetaFifo,
|
||||
exh_lengthFifo,
|
||||
msnTable2rxExh_rsp,
|
||||
|
@ -2484,7 +2487,7 @@ void ib_transport_protocol(
|
|||
rx_pkgShiftTypeFifo
|
||||
);
|
||||
|
||||
rx_exh_payload(
|
||||
rx_exh_payload<WIDTH, INSTID>(
|
||||
rx_pkgSplitTypeFifo,
|
||||
rx_ibhDrop2exhFifo,
|
||||
//#if AXI_WIDTH == 64
|
||||
|
@ -2499,7 +2502,7 @@ void ib_transport_protocol(
|
|||
rx_exhNoShiftFifo
|
||||
);
|
||||
|
||||
handle_read_requests(
|
||||
handle_read_requests<INSTID>(
|
||||
rx_readRequestFifo,
|
||||
rx_remoteMemCmd,
|
||||
rx_readEvenFifo
|
||||
|
@ -2511,12 +2514,12 @@ void ib_transport_protocol(
|
|||
// RETH: 16 bytes
|
||||
//TODO not required for AXI_WIDTH == 64, also this seems to have a bug, this goes together with the hack in process_exh where we don't write the first word out
|
||||
//#if AXI_WIDTH != 64
|
||||
rshiftWordByOctet<net_axis<WIDTH>, WIDTH,12>(((RETH_SIZE%WIDTH)/8), rx_exh2rethShiftFifo, rx_rethSift2mergerFifo);
|
||||
rshiftWordByOctet<net_axis<WIDTH>, WIDTH,12, INSTID>(((RETH_SIZE%WIDTH)/8), rx_exh2rethShiftFifo, rx_rethSift2mergerFifo);
|
||||
//#endif
|
||||
// AETH: 4 bytes
|
||||
rshiftWordByOctet<net_axis<WIDTH>, WIDTH,13>(((AETH_SIZE%WIDTH)/8), rx_exh2aethShiftFifo, rx_aethSift2mergerFifo);
|
||||
rshiftWordByOctet<net_axis<WIDTH>, WIDTH,13, INSTID>(((AETH_SIZE%WIDTH)/8), rx_exh2aethShiftFifo, rx_aethSift2mergerFifo);
|
||||
|
||||
merge_rx_pkgs(rx_pkgShiftTypeFifo, rx_aethSift2mergerFifo, rx_rethSift2mergerFifo, rx_exhNoShiftFifo, m_axis_mem_write_data);
|
||||
merge_rx_pkgs<WIDTH, INSTID>(rx_pkgShiftTypeFifo, rx_aethSift2mergerFifo, rx_rethSift2mergerFifo, rx_exhNoShiftFifo, m_axis_mem_write_data);
|
||||
|
||||
|
||||
|
||||
|
@ -2536,7 +2539,7 @@ void ib_transport_protocol(
|
|||
#pragma HLS STREAM depth=4 variable=tx_split2rethMerge
|
||||
#pragma HLS STREAM depth=4 variable=tx_rethMerge2rethShift
|
||||
|
||||
local_req_handler(
|
||||
local_req_handler<INSTID>(
|
||||
s_axis_sq_meta,
|
||||
#if RETRANS_EN
|
||||
retransmitter2exh_eventFifo,
|
||||
|
@ -2554,7 +2557,7 @@ void ib_transport_protocol(
|
|||
);
|
||||
#endif
|
||||
|
||||
tx_pkg_arbiter(
|
||||
tx_pkg_arbiter<WIDTH, INSTID>(
|
||||
tx_pkgInfoFifo,
|
||||
s_axis_mem_read_data,
|
||||
tx_split2aethShift,
|
||||
|
@ -2570,12 +2573,12 @@ void ib_transport_protocol(
|
|||
meta_merger(rx_ackEventFifo, rx_readEvenFifo, tx_appMetaFifo, tx_ibhconnTable_req, tx_ibhMetaFifo, tx_exhMetaFifo);
|
||||
|
||||
//Shift playload by 4 bytes for AETH (data from memory)
|
||||
lshiftWordByOctet<WIDTH,12>(((AETH_SIZE%WIDTH)/8), tx_split2aethShift, tx_aethShift2payFifo);
|
||||
lshiftWordByOctet<WIDTH,12,INSTID>(((AETH_SIZE%WIDTH)/8), tx_split2aethShift, tx_aethShift2payFifo);
|
||||
//Shift payload another 12 bytes for RETH (data from application)
|
||||
lshiftWordByOctet<WIDTH,13>(((RETH_SIZE%WIDTH)/8), tx_rethMerge2rethShift, tx_rethShift2payFifo);
|
||||
lshiftWordByOctet<WIDTH,13,INSTID>(((RETH_SIZE%WIDTH)/8), tx_rethMerge2rethShift, tx_rethShift2payFifo);
|
||||
|
||||
//Generate EXH
|
||||
generate_exh(
|
||||
generate_exh<WIDTH, INSTID>(
|
||||
tx_exhMetaFifo,
|
||||
msnTable2txExh_rsp,
|
||||
txExh2msnTable_req,
|
||||
|
@ -2589,11 +2592,11 @@ void ib_transport_protocol(
|
|||
);
|
||||
|
||||
// Append payload to AETH or RETH
|
||||
append_payload(tx_packetInfoFifo, tx_exh2payFifo, tx_aethShift2payFifo, tx_rethShift2payFifo, tx_rawPayFifo, tx_exh2shiftFifo);
|
||||
append_payload<WIDTH, INSTID>(tx_packetInfoFifo, tx_exh2payFifo, tx_aethShift2payFifo, tx_rethShift2payFifo, tx_rawPayFifo, tx_exh2shiftFifo);
|
||||
|
||||
// BTH: 12 bytes
|
||||
lshiftWordByOctet<WIDTH,11>(((BTH_SIZE%WIDTH)/8), tx_exh2shiftFifo, tx_shift2ibhFifo);
|
||||
generate_ibh(
|
||||
lshiftWordByOctet<WIDTH,11,INSTID>(((BTH_SIZE%WIDTH)/8), tx_exh2shiftFifo, tx_shift2ibhFifo);
|
||||
generate_ibh<WIDTH, INSTID>(
|
||||
tx_ibhMetaFifo,
|
||||
tx_dstQpFifo,
|
||||
stateTable2txIbh_rsp,
|
||||
|
@ -2605,22 +2608,11 @@ void ib_transport_protocol(
|
|||
);
|
||||
|
||||
//prependt ib header
|
||||
prepend_ibh_header(tx_ibhHeaderFifo, tx_shift2ibhFifo, m_axis_tx_data);
|
||||
prepend_ibh_header<WIDTH, INSTID>(tx_ibhHeaderFifo, tx_shift2ibhFifo, m_axis_tx_data);
|
||||
|
||||
//Get Meta data for UDP & IP layer
|
||||
tx_ipUdpMetaMerger(tx_connTable2ibh_rsp, tx_lengthFifo, m_axis_tx_meta, tx_dstQpFifo);
|
||||
|
||||
if (!m_axis_tx_meta.empty()){ \
|
||||
ipUdpMeta udpMeta; \
|
||||
m_axis_tx_meta.read(udpMeta); \
|
||||
std::cout << "[m_axis_tx_meta" << "]:\t" \
|
||||
<< "dstIP:" << std::hex << udpMeta.their_address << std::dec \
|
||||
<< ", dstPort:" << udpMeta.their_port \
|
||||
<< ", srcPort:" << udpMeta.my_port \
|
||||
<< ", Len:" << udpMeta.length << std::endl; \
|
||||
}
|
||||
|
||||
|
||||
//merge read requests
|
||||
mem_cmd_merger<WIDTH>(rx_remoteMemCmd, tx_localMemCmdFifo, m_axis_mem_read_cmd, tx_pkgInfoFifo);
|
||||
|
||||
|
@ -2629,13 +2621,13 @@ void ib_transport_protocol(
|
|||
// Data structures
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
conn_table(
|
||||
conn_table<INSTID>(
|
||||
tx_ibhconnTable_req,
|
||||
s_axis_qp_conn_interface,
|
||||
tx_connTable2ibh_rsp
|
||||
);
|
||||
|
||||
state_table(
|
||||
state_table<INSTID>(
|
||||
rxIbh2stateTable_upd_req,
|
||||
txIbh2stateTable_upd_req,
|
||||
qpi2stateTable_upd_req,
|
||||
|
@ -2644,7 +2636,7 @@ void ib_transport_protocol(
|
|||
stateTable2qpi_rsp
|
||||
);
|
||||
|
||||
msn_table(
|
||||
msn_table<INSTID>(
|
||||
rxExh2msnTable_upd_req,
|
||||
txExh2msnTable_req,
|
||||
if2msnTable_init,
|
||||
|
@ -2652,7 +2644,7 @@ void ib_transport_protocol(
|
|||
msnTable2txExh_rsp
|
||||
);
|
||||
|
||||
read_req_table(
|
||||
read_req_table<INSTID>(
|
||||
tx_readReqTable_upd,
|
||||
#if !RETRANS_EN
|
||||
rx_readReqTable_upd_req
|
||||
|
@ -2663,7 +2655,7 @@ void ib_transport_protocol(
|
|||
);
|
||||
#endif
|
||||
|
||||
multi_queue<ap_uint<64>,MAX_QPS, 2048>(
|
||||
multi_queue<ap_uint<64>,MAX_QPS, 2048, INSTID>(
|
||||
tx_readReqAddr_push,
|
||||
rx_readReqAddr_pop_req,
|
||||
rx_readReqAddr_pop_rsp
|
||||
|
@ -2672,13 +2664,13 @@ void ib_transport_protocol(
|
|||
#if RETRANS_EN
|
||||
merge_retrans_request(tx2retrans_insertMeta, tx2retrans_insertAddrLen, tx2retrans_insertRequest);
|
||||
|
||||
transport_timer(
|
||||
transport_timer<INSTID>(
|
||||
rxClearTimer_req,
|
||||
txSetTimer_req,
|
||||
timer2retrans_req
|
||||
);
|
||||
|
||||
retransmitter(
|
||||
retransmitter<INSTID>(
|
||||
rx2retrans_release_upd,
|
||||
rx2retrans_req,
|
||||
timer2retrans_req,
|
||||
|
@ -2690,7 +2682,6 @@ void ib_transport_protocol(
|
|||
}
|
||||
|
||||
|
||||
|
||||
template void ib_transport_protocol<DATA_WIDTH, 0 >(
|
||||
// RX
|
||||
stream<ipUdpMeta>& s_axis_rx_meta,
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
/************************************************
|
||||
Copyright (c) 2019, Systems Group, ETH Zurich.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
************************************************/
|
||||
#include "msn_table.hpp"
|
||||
#include <rocev2_config.hpp> //defines MAX_QPS
|
||||
|
||||
void msn_table(hls::stream<rxMsnReq>& rxExh2msnTable_upd_req,
|
||||
hls::stream<ap_uint<16> >& txExh2msnTable_req,
|
||||
hls::stream<ifMsnReq>& if2msnTable_init,
|
||||
hls::stream<dmaState>& msnTable2rxExh_rsp,
|
||||
hls::stream<txMsnRsp>& msnTable2txExh_rsp)
|
||||
{
|
||||
#pragma HLS PIPELINE II=1
|
||||
#pragma HLS INLINE off
|
||||
|
||||
static dmaState msn_table[MAX_QPS];
|
||||
#if defined( __VITIS_HLS__)
|
||||
#pragma HLS bind_storage variable=msn_table type=RAM_2P impl=BRAM
|
||||
#else
|
||||
#pragma HLS RESOURCE variable=msn_table core=RAM_2P_BRAM
|
||||
#endif
|
||||
|
||||
rxMsnReq rxRequest;
|
||||
ifMsnReq ifRequest;
|
||||
ap_uint<16> qpn;
|
||||
|
||||
//TODO init channel
|
||||
|
||||
if (!rxExh2msnTable_upd_req.empty())
|
||||
{
|
||||
rxExh2msnTable_upd_req.read(rxRequest);
|
||||
if (rxRequest.write)
|
||||
{
|
||||
msn_table[rxRequest.qpn].msn = rxRequest.msn;
|
||||
msn_table[rxRequest.qpn].vaddr = rxRequest.vaddr;
|
||||
msn_table[rxRequest.qpn].dma_length= rxRequest.dma_length;
|
||||
}
|
||||
else
|
||||
{
|
||||
msnTable2rxExh_rsp.write(dmaState(msn_table[rxRequest.qpn]));
|
||||
}
|
||||
}
|
||||
else if (!txExh2msnTable_req.empty())
|
||||
{
|
||||
txExh2msnTable_req.read(qpn);
|
||||
msnTable2txExh_rsp.write(txMsnRsp(msn_table[qpn].msn, msn_table[qpn].r_key));
|
||||
}
|
||||
else if (!if2msnTable_init.empty()) //move up??
|
||||
{
|
||||
std::cout << "MSN init for QPN: " << qpn << std::endl;
|
||||
if2msnTable_init.read(ifRequest);
|
||||
msn_table[ifRequest.qpn].msn = 0;
|
||||
msn_table[ifRequest.qpn].vaddr = 0; //TODO requried?
|
||||
msn_table[ifRequest.qpn].dma_length = 0; //TODO requried?
|
||||
msn_table[ifRequest.qpn].r_key = ifRequest.r_key;
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#pragma once
|
||||
|
||||
#include "../axi_utils.hpp"
|
||||
#include <rocev2_config.hpp> //defines MAX_QPS
|
||||
|
||||
struct ifMsnReq
|
||||
{
|
||||
|
@ -78,8 +79,76 @@ struct dmaState
|
|||
};
|
||||
|
||||
|
||||
template <int INSTID = 0>
|
||||
void msn_table(hls::stream<rxMsnReq>& rxExh2msnTable_upd_req,
|
||||
hls::stream<ap_uint<16> >& txExh2msnTable_req,
|
||||
hls::stream<ifMsnReq>& if2msnTable_init,
|
||||
hls::stream<dmaState>& msnTable2rxExh_rsp,
|
||||
hls::stream<txMsnRsp>& msnTable2txExh_rsp);
|
||||
hls::stream<txMsnRsp>& msnTable2txExh_rsp);
|
||||
|
||||
template <int INSTID = 0>
|
||||
void msn_table(hls::stream<rxMsnReq>& rxExh2msnTable_upd_req,
|
||||
hls::stream<ap_uint<16> >& txExh2msnTable_req,
|
||||
hls::stream<ifMsnReq>& if2msnTable_init,
|
||||
hls::stream<dmaState>& msnTable2rxExh_rsp,
|
||||
hls::stream<txMsnRsp>& msnTable2txExh_rsp)
|
||||
{
|
||||
#pragma HLS PIPELINE II=1
|
||||
#pragma HLS INLINE off
|
||||
|
||||
static dmaState msn_table[MAX_QPS];
|
||||
#if defined( __VITIS_HLS__)
|
||||
#pragma HLS bind_storage variable=msn_table type=RAM_2P impl=BRAM
|
||||
#else
|
||||
#pragma HLS RESOURCE variable=msn_table core=RAM_2P_BRAM
|
||||
#endif
|
||||
|
||||
rxMsnReq rxRequest;
|
||||
ifMsnReq ifRequest;
|
||||
ap_uint<16> qpn;
|
||||
|
||||
//TODO init channel
|
||||
|
||||
if (!rxExh2msnTable_upd_req.empty())
|
||||
{
|
||||
rxExh2msnTable_upd_req.read(rxRequest);
|
||||
if (rxRequest.write)
|
||||
{
|
||||
msn_table[rxRequest.qpn].msn = rxRequest.msn;
|
||||
msn_table[rxRequest.qpn].vaddr = rxRequest.vaddr;
|
||||
msn_table[rxRequest.qpn].dma_length= rxRequest.dma_length;
|
||||
}
|
||||
else
|
||||
{
|
||||
msnTable2rxExh_rsp.write(dmaState(msn_table[rxRequest.qpn]));
|
||||
}
|
||||
}
|
||||
else if (!txExh2msnTable_req.empty())
|
||||
{
|
||||
txExh2msnTable_req.read(qpn);
|
||||
msnTable2txExh_rsp.write(txMsnRsp(msn_table[qpn].msn, msn_table[qpn].r_key));
|
||||
}
|
||||
else if (!if2msnTable_init.empty()) //move up??
|
||||
{
|
||||
std::cout << "MSN init for QPN: " << qpn << std::endl;
|
||||
if2msnTable_init.read(ifRequest);
|
||||
msn_table[ifRequest.qpn].msn = 0;
|
||||
msn_table[ifRequest.qpn].vaddr = 0; //TODO requried?
|
||||
msn_table[ifRequest.qpn].dma_length = 0; //TODO requried?
|
||||
msn_table[ifRequest.qpn].r_key = ifRequest.r_key;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ struct mqPointerUpdate
|
|||
//Value: T
|
||||
|
||||
|
||||
template <int NUM_QUEUES>
|
||||
template <int NUM_QUEUES, int INSTID = 0>
|
||||
void mq_pointer_table( hls::stream<mqPointerReq>& pointerReqFifo,
|
||||
hls::stream<mqPointerUpdate>& pointerUpdFifo,
|
||||
hls::stream<mqPointerEntry>& pointerRspFifo)
|
||||
|
@ -176,7 +176,7 @@ void mq_pointer_table( hls::stream<mqPointerReq>& pointerReqFifo,
|
|||
}
|
||||
}
|
||||
|
||||
template <int MULTI_QUEUE_SIZE>
|
||||
template <int MULTI_QUEUE_SIZE, int INSTID = 0>
|
||||
void mq_freelist_handler( hls::stream<ap_uint<16> >& rt_releaseFifo,
|
||||
hls::stream<ap_uint<16> >& rt_freeListFifo)
|
||||
{
|
||||
|
@ -197,7 +197,7 @@ void mq_freelist_handler( hls::stream<ap_uint<16> >& rt_releaseFifo,
|
|||
}
|
||||
}
|
||||
|
||||
template <class T, int MULTI_QUEUE_SIZE>
|
||||
template <class T, int MULTI_QUEUE_SIZE, int INSTID = 0>
|
||||
void mq_meta_table( hls::stream<mqMetaReq<T> >& meta_upd_req,
|
||||
hls::stream<mqMetaEntry<T> >& meta_rsp)
|
||||
{
|
||||
|
@ -236,7 +236,7 @@ void mq_meta_table( hls::stream<mqMetaReq<T> >& meta_upd_req,
|
|||
|
||||
}
|
||||
|
||||
template <class T>
|
||||
template <class T, int INSTID = 0>
|
||||
void mq_process_requests( //stream<retransRelease>& rx2retrans_release_upd,
|
||||
//stream<retransmission>& rx2retrans_req,
|
||||
hls::stream<mqPopReq>& multiQueue_pop_req, //stream<retransmission>& timer2retrans_req, //pop
|
||||
|
@ -527,7 +527,7 @@ void mq_process_requests( //stream<retransRelease>& rx2retrans_release_upd,
|
|||
}//switch
|
||||
}
|
||||
|
||||
template <class T, int NUM_QUEUES, int MULTI_QUEUE_SIZE>
|
||||
template <class T, int NUM_QUEUES, int MULTI_QUEUE_SIZE, int INSTID = 0>
|
||||
void multi_queue( hls::stream<mqInsertReq<T> >& multiQueue_push,
|
||||
hls::stream<mqPopReq>& multiQueue_pop_req,
|
||||
hls::stream<T>& multiQueue_pop_rsp)
|
||||
|
@ -555,14 +555,14 @@ void multi_queue( hls::stream<mqInsertReq<T> >& multiQueue_push,
|
|||
#pragma HLS STREAM depth=MULTI_QUEUE_SIZE variable=mq_freeListFifo
|
||||
#pragma HLS STREAM depth=2 variable=mq_releaseFifo
|
||||
|
||||
mq_freelist_handler<MULTI_QUEUE_SIZE>(mq_releaseFifo, mq_freeListFifo);
|
||||
mq_freelist_handler<MULTI_QUEUE_SIZE,INSTID>(mq_releaseFifo, mq_freeListFifo);
|
||||
|
||||
mq_pointer_table<NUM_QUEUES>(mq_pointerReqFifo, mq_pointerUpdFifo, mq_pointerRspFifo);
|
||||
mq_pointer_table<NUM_QUEUES,INSTID>(mq_pointerReqFifo, mq_pointerUpdFifo, mq_pointerRspFifo);
|
||||
|
||||
mq_meta_table<T,MULTI_QUEUE_SIZE>(mq_metaReqFifo,
|
||||
mq_meta_table<T,MULTI_QUEUE_SIZE,INSTID>(mq_metaReqFifo,
|
||||
mq_metaRspFifo);
|
||||
|
||||
mq_process_requests<T>( multiQueue_pop_req,
|
||||
mq_process_requests<T,INSTID>( multiQueue_pop_req,
|
||||
multiQueue_push,
|
||||
mq_pointerReqFifo,
|
||||
mq_pointerUpdFifo,
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
/************************************************
|
||||
Copyright (c) 2019, Systems Group, ETH Zurich.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
************************************************/
|
||||
#include "read_req_table.hpp"
|
||||
#include <rocev2_config.hpp> //defines MAX_QPS
|
||||
|
||||
void read_req_table(stream<txReadReqUpdate>& tx_readReqTable_upd,
|
||||
#if !RETRANS_EN
|
||||
stream<rxReadReqUpdate>& rx_readReqTable_upd_req)
|
||||
#else
|
||||
stream<rxReadReqUpdate>& rx_readReqTable_upd_req,
|
||||
stream<rxReadReqRsp>& rx_readReqTable_upd_rsp)
|
||||
#endif
|
||||
{
|
||||
#pragma HLS PIPELINE II=1
|
||||
#pragma HLS INLINE off
|
||||
|
||||
static readReqTableEntry req_table[MAX_QPS];
|
||||
#if defined( __VITIS_HLS__)
|
||||
#pragma HLS bind_storage variable=req_table type=RAM_2P impl=BRAM
|
||||
#else
|
||||
#pragma HLS RESOURCE variable=req_table core=RAM_2P_BRAM
|
||||
#endif
|
||||
|
||||
txReadReqUpdate update;
|
||||
rxReadReqUpdate request;
|
||||
|
||||
if (!tx_readReqTable_upd.empty())
|
||||
{
|
||||
tx_readReqTable_upd.read(update);
|
||||
req_table[update.qpn].max_fwd_readreq = update.max_fwd_readreq;
|
||||
}
|
||||
else if (!rx_readReqTable_upd_req.empty())
|
||||
{
|
||||
rx_readReqTable_upd_req.read(request);
|
||||
if (request.write)
|
||||
{
|
||||
req_table[request.qpn].oldest_outstanding_readreq = request.oldest_outstanding_readreq;
|
||||
}
|
||||
#if RETRANS_EN
|
||||
else
|
||||
{
|
||||
bool valid = (req_table[request.qpn].oldest_outstanding_readreq < req_table[request.qpn].max_fwd_readreq);
|
||||
rx_readReqTable_upd_rsp.write(rxReadReqRsp(req_table[request.qpn].oldest_outstanding_readreq, valid));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#pragma once
|
||||
|
||||
#include "../axi_utils.hpp"
|
||||
#include <rocev2_config.hpp> //defines MAX_QPS
|
||||
using namespace hls;
|
||||
|
||||
struct txReadReqUpdate
|
||||
|
@ -68,10 +69,58 @@ struct readReqTableEntry
|
|||
ap_uint<24> max_fwd_readreq;
|
||||
};
|
||||
|
||||
template <int INSTID = 0>
|
||||
void read_req_table(stream<txReadReqUpdate>& tx_readReqTable_upd,
|
||||
#if !RETRANS_EN
|
||||
stream<rxReadReqUpdate>& rx_readReqTable_upd_req);
|
||||
#else
|
||||
stream<rxReadReqUpdate>& rx_readReqTable_upd_req,
|
||||
stream<rxReadReqRsp>& rx_readReqTable_upd_rsp);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
template <int INSTID = 0>
|
||||
void read_req_table(stream<txReadReqUpdate>& tx_readReqTable_upd,
|
||||
#if !RETRANS_EN
|
||||
stream<rxReadReqUpdate>& rx_readReqTable_upd_req)
|
||||
#else
|
||||
stream<rxReadReqUpdate>& rx_readReqTable_upd_req,
|
||||
stream<rxReadReqRsp>& rx_readReqTable_upd_rsp)
|
||||
#endif
|
||||
{
|
||||
#pragma HLS PIPELINE II=1
|
||||
#pragma HLS INLINE off
|
||||
|
||||
static readReqTableEntry req_table[MAX_QPS];
|
||||
#if defined( __VITIS_HLS__)
|
||||
#pragma HLS bind_storage variable=req_table type=RAM_2P impl=BRAM
|
||||
#else
|
||||
#pragma HLS RESOURCE variable=req_table core=RAM_2P_BRAM
|
||||
#endif
|
||||
|
||||
txReadReqUpdate update;
|
||||
rxReadReqUpdate request;
|
||||
|
||||
if (!tx_readReqTable_upd.empty())
|
||||
{
|
||||
tx_readReqTable_upd.read(update);
|
||||
req_table[update.qpn].max_fwd_readreq = update.max_fwd_readreq;
|
||||
}
|
||||
else if (!rx_readReqTable_upd_req.empty())
|
||||
{
|
||||
rx_readReqTable_upd_req.read(request);
|
||||
if (request.write)
|
||||
{
|
||||
req_table[request.qpn].oldest_outstanding_readreq = request.oldest_outstanding_readreq;
|
||||
}
|
||||
#if RETRANS_EN
|
||||
else
|
||||
{
|
||||
bool valid = (req_table[request.qpn].oldest_outstanding_readreq < req_table[request.qpn].max_fwd_readreq);
|
||||
rx_readReqTable_upd_rsp.write(rxReadReqRsp(req_table[request.qpn].oldest_outstanding_readreq, valid));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ using namespace hls;
|
|||
|
||||
|
||||
//TODO maybe introduce seperate request streams
|
||||
template <int INSTID = 0>
|
||||
void retrans_pointer_table( stream<pointerReq>& pointerReqFifo,
|
||||
stream<pointerUpdate>& pointerUpdFifo,
|
||||
stream<retransPointerEntry>& pointerRspFifo)
|
||||
|
@ -293,6 +294,7 @@ void retrans_pointer_table( stream<pointerReq>& pointerReqFifo,
|
|||
}//switch state
|
||||
}*/
|
||||
|
||||
template <int INSTID = 0>
|
||||
void retrans_meta_table(stream<retransMetaReq>& meta_upd_req,
|
||||
stream<retransMetaEntry>& meta_rsp)
|
||||
//stream<bool>& stopFifo)
|
||||
|
@ -461,6 +463,7 @@ void retrans_meta_table(stream<retransMetaReq>& meta_upd_req,
|
|||
}
|
||||
|
||||
//TODO HLS is failing so bad with II, such that this module has a ton of states
|
||||
template <int INSTID = 0>
|
||||
void process_retransmissions( stream<retransRelease>& rx2retrans_release_upd,
|
||||
stream<retransmission>& rx2retrans_req,
|
||||
stream<retransmission>& timer2retrans_req,
|
||||
|
@ -761,7 +764,7 @@ void process_retransmissions( stream<retransRelease>& rx2retrans_release_upd,
|
|||
}//switch
|
||||
}
|
||||
|
||||
|
||||
template <int INSTID = 0>
|
||||
void freelist_handler( stream<ap_uint<16> >& rt_releaseFifo,
|
||||
stream<ap_uint<16> >& rt_freeListFifo)
|
||||
{
|
||||
|
@ -782,7 +785,7 @@ void freelist_handler( stream<ap_uint<16> >& rt_releaseFifo,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
template <int INSTID = 0>
|
||||
void retransmitter( stream<retransRelease>& rx2retrans_release_upd,
|
||||
stream<retransmission>& rx2retrans_req,
|
||||
stream<retransmission>& timer2retrans_req,
|
||||
|
@ -813,15 +816,15 @@ void retransmitter( stream<retransRelease>& rx2retrans_release_upd,
|
|||
static stream<ap_uint<16> > rt_releaseFifo("rt_releaseFifo");
|
||||
#pragma HLS STREAM depth=2 variable=rt_releaseFifo
|
||||
|
||||
freelist_handler(rt_releaseFifo, rt_freeListFifo);
|
||||
freelist_handler<INSTID>(rt_releaseFifo, rt_freeListFifo);
|
||||
|
||||
retrans_pointer_table(rt_pointerReqFifo, rt_pointerUpdFifo, rt_pointerRspFifo);
|
||||
retrans_pointer_table<INSTID>(rt_pointerReqFifo, rt_pointerUpdFifo, rt_pointerRspFifo);
|
||||
|
||||
retrans_meta_table( rt_metaReqFifo,
|
||||
retrans_meta_table<INSTID>( rt_metaReqFifo,
|
||||
rt_metaRspFifo);
|
||||
//rt_stopFifo);
|
||||
|
||||
process_retransmissions(rx2retrans_release_upd,
|
||||
process_retransmissions<INSTID>(rx2retrans_release_upd,
|
||||
rx2retrans_req,
|
||||
timer2retrans_req,
|
||||
tx2retrans_insertRequest,
|
||||
|
|
|
@ -1,122 +0,0 @@
|
|||
/************************************************
|
||||
Copyright (c) 2019, Systems Group, ETH Zurich.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
************************************************/
|
||||
#include "state_table.hpp"
|
||||
#include <rocev2_config.hpp> //defines MAX_QPS
|
||||
|
||||
void state_table(
|
||||
hls::stream<rxStateReq>& rxIbh2stateTable_upd_req,
|
||||
hls::stream<txStateReq>& txIbh2stateTable_upd_req,
|
||||
hls::stream<ifStateReq>& qpi2stateTable_upd_req,
|
||||
hls::stream<rxStateRsp>& stateTable2rxIbh_rsp,
|
||||
hls::stream<stateTableEntry>& stateTable2txIbh_rsp,
|
||||
hls::stream<stateTableEntry>& stateTable2qpi_rsp
|
||||
) {
|
||||
#pragma HLS PIPELINE II=1
|
||||
#pragma HLS INLINE off
|
||||
|
||||
static stateTableEntry state_table[MAX_QPS];
|
||||
#if defined( __VITIS_HLS__)
|
||||
#pragma HLS bind_storage variable=state_table type=RAM_2P impl=BRAM
|
||||
#else
|
||||
#pragma HLS RESOURCE variable=state_table core=RAM_2P_BRAM
|
||||
#endif
|
||||
|
||||
rxStateReq rxRequest;
|
||||
txStateReq txRequest;
|
||||
ifStateReq ifRequest;
|
||||
|
||||
if (!rxIbh2stateTable_upd_req.empty())
|
||||
{
|
||||
rxIbh2stateTable_upd_req.read(rxRequest);
|
||||
if (rxRequest.write)
|
||||
{
|
||||
if (rxRequest.isResponse)
|
||||
{
|
||||
state_table[rxRequest.qpn].req_old_unack = rxRequest.epsn;
|
||||
}
|
||||
else
|
||||
{
|
||||
state_table[rxRequest.qpn].resp_epsn = rxRequest.epsn;
|
||||
state_table[rxRequest.qpn].retryCounter = rxRequest.retryCounter;
|
||||
//state_table[rxRequest.qpn].sendNAK = rxRequest.epsn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stateTableEntry entry = state_table[rxRequest.qpn(15,0)];
|
||||
if (rxRequest.isResponse)
|
||||
{
|
||||
stateTable2rxIbh_rsp.write(rxStateRsp(entry.req_old_unack, entry.req_old_valid, entry.req_next_psn-1));
|
||||
}
|
||||
else
|
||||
{
|
||||
stateTable2rxIbh_rsp.write(rxStateRsp(entry.resp_epsn, entry.resp_old_outstanding, entry.resp_epsn, entry.retryCounter));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!txIbh2stateTable_upd_req.empty())
|
||||
{
|
||||
txIbh2stateTable_upd_req.read(txRequest);
|
||||
if (txRequest.write)
|
||||
{
|
||||
state_table[txRequest.qpn].req_next_psn = txRequest.psn;
|
||||
}
|
||||
else
|
||||
{
|
||||
stateTable2txIbh_rsp.write(state_table[txRequest.qpn]);
|
||||
}
|
||||
}
|
||||
else if (!qpi2stateTable_upd_req.empty())
|
||||
{
|
||||
qpi2stateTable_upd_req.read(ifRequest);
|
||||
if (ifRequest.write)
|
||||
{
|
||||
std::cout << "SETUP new connection, PSN: " << ifRequest.remote_psn << std::endl;
|
||||
//state_table[ifRequest.qpn].state = ifRequest.newState;
|
||||
//state_table[ifRequest.qpn].prevOpCode = RC_RDMA_WRITE_LAST;
|
||||
state_table[ifRequest.qpn].resp_epsn = ifRequest.local_psn;
|
||||
state_table[ifRequest.qpn].resp_old_outstanding = ifRequest.local_psn;
|
||||
state_table[ifRequest.qpn].req_next_psn = ifRequest.remote_psn;
|
||||
state_table[ifRequest.qpn].req_old_unack = ifRequest.remote_psn;
|
||||
state_table[ifRequest.qpn].req_old_valid = ifRequest.remote_psn;
|
||||
state_table[ifRequest.qpn].retryCounter = 0xF;
|
||||
//state_table[ifRequest.qpn].sendNAK = false;
|
||||
|
||||
//state_table[ifRequest.qpn].r_key = ifRequest.r_key;
|
||||
//state_table[ifRequest.qpn].virtual_address = ifRequest.virtual_address;
|
||||
}
|
||||
else
|
||||
{
|
||||
stateTable2qpi_rsp.write(state_table[ifRequest.qpn(15,0)]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -30,6 +30,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include "../axi_utils.hpp"
|
||||
#include "../ib_transport_protocol/ib_transport_protocol.hpp"
|
||||
#include <rocev2_config.hpp> //defines MAX_QPS
|
||||
|
||||
//PSN, page 293, 307, 345
|
||||
struct stateTableEntry
|
||||
|
@ -105,9 +106,106 @@ struct txStateReq
|
|||
:qpn(qpn), psn(psn), write(true) {}
|
||||
};
|
||||
|
||||
template <int INSTID = 0>
|
||||
void state_table( hls::stream<rxStateReq>& rxIbh2stateTable_upd_req,
|
||||
hls::stream<txStateReq>& txIbh2stateTable_upd_req,
|
||||
hls::stream<ifStateReq>& qpi2stateTable_upd_req,
|
||||
hls::stream<rxStateRsp>& stateTable2rxIbh_rsp,
|
||||
hls::stream<stateTableEntry>& stateTable2txIbh_rsp,
|
||||
hls::stream<stateTableEntry>& stateTable2qpi_rsp);
|
||||
hls::stream<stateTableEntry>& stateTable2qpi_rsp);
|
||||
|
||||
|
||||
template <int INSTID = 0>
|
||||
void state_table(
|
||||
hls::stream<rxStateReq>& rxIbh2stateTable_upd_req,
|
||||
hls::stream<txStateReq>& txIbh2stateTable_upd_req,
|
||||
hls::stream<ifStateReq>& qpi2stateTable_upd_req,
|
||||
hls::stream<rxStateRsp>& stateTable2rxIbh_rsp,
|
||||
hls::stream<stateTableEntry>& stateTable2txIbh_rsp,
|
||||
hls::stream<stateTableEntry>& stateTable2qpi_rsp
|
||||
) {
|
||||
#pragma HLS PIPELINE II=1
|
||||
#pragma HLS INLINE off
|
||||
|
||||
static stateTableEntry state_table[MAX_QPS];
|
||||
#if defined( __VITIS_HLS__)
|
||||
#pragma HLS bind_storage variable=state_table type=RAM_2P impl=BRAM
|
||||
#else
|
||||
#pragma HLS RESOURCE variable=state_table core=RAM_2P_BRAM
|
||||
#endif
|
||||
|
||||
rxStateReq rxRequest;
|
||||
txStateReq txRequest;
|
||||
ifStateReq ifRequest;
|
||||
|
||||
if (!rxIbh2stateTable_upd_req.empty())
|
||||
{
|
||||
rxIbh2stateTable_upd_req.read(rxRequest);
|
||||
if (rxRequest.write)
|
||||
{
|
||||
if (rxRequest.isResponse)
|
||||
{
|
||||
state_table[rxRequest.qpn].req_old_unack = rxRequest.epsn;
|
||||
}
|
||||
else
|
||||
{
|
||||
state_table[rxRequest.qpn].resp_epsn = rxRequest.epsn;
|
||||
state_table[rxRequest.qpn].retryCounter = rxRequest.retryCounter;
|
||||
//state_table[rxRequest.qpn].sendNAK = rxRequest.epsn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stateTableEntry entry = state_table[rxRequest.qpn(15,0)];
|
||||
if (rxRequest.isResponse)
|
||||
{
|
||||
stateTable2rxIbh_rsp.write(rxStateRsp(entry.req_old_unack, entry.req_old_valid, entry.req_next_psn-1));
|
||||
}
|
||||
else
|
||||
{
|
||||
stateTable2rxIbh_rsp.write(rxStateRsp(entry.resp_epsn, entry.resp_old_outstanding, entry.resp_epsn, entry.retryCounter));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!txIbh2stateTable_upd_req.empty())
|
||||
{
|
||||
txIbh2stateTable_upd_req.read(txRequest);
|
||||
if (txRequest.write)
|
||||
{
|
||||
state_table[txRequest.qpn].req_next_psn = txRequest.psn;
|
||||
}
|
||||
else
|
||||
{
|
||||
stateTable2txIbh_rsp.write(state_table[txRequest.qpn]);
|
||||
}
|
||||
}
|
||||
else if (!qpi2stateTable_upd_req.empty())
|
||||
{
|
||||
qpi2stateTable_upd_req.read(ifRequest);
|
||||
if (ifRequest.write)
|
||||
{
|
||||
std::cout << "SETUP new connection, PSN: " << ifRequest.remote_psn << std::endl;
|
||||
//state_table[ifRequest.qpn].state = ifRequest.newState;
|
||||
//state_table[ifRequest.qpn].prevOpCode = RC_RDMA_WRITE_LAST;
|
||||
state_table[ifRequest.qpn].resp_epsn = ifRequest.local_psn;
|
||||
state_table[ifRequest.qpn].resp_old_outstanding = ifRequest.local_psn;
|
||||
state_table[ifRequest.qpn].req_next_psn = ifRequest.remote_psn;
|
||||
state_table[ifRequest.qpn].req_old_unack = ifRequest.remote_psn;
|
||||
state_table[ifRequest.qpn].req_old_valid = ifRequest.remote_psn;
|
||||
state_table[ifRequest.qpn].retryCounter = 0xF;
|
||||
//state_table[ifRequest.qpn].sendNAK = false;
|
||||
|
||||
//state_table[ifRequest.qpn].r_key = ifRequest.r_key;
|
||||
//state_table[ifRequest.qpn].virtual_address = ifRequest.virtual_address;
|
||||
}
|
||||
else
|
||||
{
|
||||
stateTable2qpi_rsp.write(state_table[ifRequest.qpn(15,0)]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
* Timer is stopped when there are no more outstanding requests
|
||||
* Maintain a 3-bit retry counter, decrement on timeout, clear on new ACK
|
||||
*/
|
||||
template <int INSTID = 0>
|
||||
void transport_timer( stream<rxTimerUpdate>& rxClearTimer_req,
|
||||
stream<ap_uint<24> >& txSetTimer_req,
|
||||
stream<retransmission>& timer2retrans_req)
|
||||
|
|
|
@ -79,6 +79,7 @@ struct rxTimerUpdate
|
|||
/**
|
||||
* page 352
|
||||
*/
|
||||
template <int INSTID = 0>
|
||||
void transport_timer( stream<rxTimerUpdate>& rxClearTimer_req,
|
||||
stream<ap_uint<24> >& txSetTimer_req,
|
||||
stream<retransmission>& timer2retrans_req);
|
|
@ -16,12 +16,12 @@ add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ipv6/ipv6.cpp -cflags "-I${CMAKE_CURREN
|
|||
add_files ${CMAKE_CURRENT_SOURCE_DIR}/../udp/udp.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/ib_utils.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/ib_transport_protocol.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/read_req_table.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
# add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/read_req_table.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/transport_timer.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/retransmitter/retransmitter.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/state_table.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/conn_table.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/msn_table.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
# add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/state_table.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
# add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/conn_table.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
# add_files ${CMAKE_CURRENT_SOURCE_DIR}/../ib_transport_protocol/msn_table.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
add_files ${CMAKE_CURRENT_SOURCE_DIR}/rocev2.cpp -cflags "-I${CMAKE_CURRENT_BINARY_DIR}"
|
||||
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ int main(int argc, char* argv[]){
|
|||
// );
|
||||
|
||||
|
||||
ib_transport_protocol<DATA_WIDTH,0 >(
|
||||
ib_transport_protocol<DATA_WIDTH,0>(
|
||||
s_axis_rx_meta_n0,
|
||||
s_axis_rx_data_n0,
|
||||
m_axis_tx_meta_n0,
|
||||
|
@ -323,7 +323,7 @@ int main(int argc, char* argv[]){
|
|||
// IBTRUN(0);
|
||||
// IBTRUN(1);
|
||||
|
||||
ib_transport_protocol<DATA_WIDTH,0 >(
|
||||
ib_transport_protocol<DATA_WIDTH,0>(
|
||||
s_axis_rx_meta_n0,
|
||||
s_axis_rx_data_n0,
|
||||
m_axis_tx_meta_n0,
|
||||
|
|
Loading…
Reference in New Issue