diff --git a/backend/Makefile b/backend/Makefile index 2819249..ff8ae98 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -8,10 +8,12 @@ OUTPUTDIR ?= output LOGFILE ?= run.log RUNTOPHASE ?= place # synth place route all PARTNAME = xcvu13p-fhgb2104-2-i +TARGETFILE ?= ../src/SendQ.bsv +TOPMODULE ?= mkSQ # TARGETFILE ?= ../src/QueuePair.bsv # TOPMODULE ?= mkQP -TARGETFILE ?= ../src/TransportLayer.bsv -TOPMODULE ?= mkTransportLayer +# TARGETFILE ?= ../src/TransportLayer.bsv +# TOPMODULE ?= mkTransportLayer export TOP = $(TOPMODULE) export RTL = $(VLOGDIR) diff --git a/src/ExtractAndPrependPipeOut.bsv b/src/ExtractAndPrependPipeOut.bsv index 01983d9..b45ccfb 100644 --- a/src/ExtractAndPrependPipeOut.bsv +++ b/src/ExtractAndPrependPipeOut.bsv @@ -184,7 +184,15 @@ module mkDataStream2Header#( let headerLastFragByteEn = genByteEn(rdmaHeader.headerMetaData.lastFragValidByteNum); headerOutQ.enq(rdmaHeader); busyReg <= False; - // $display("time=%0t: rdmaHeader=", $time, fshow(rdmaHeader)); + + // let { transType, rdmaOpCode } = + // extractTranTypeAndRdmaOpCode(rdmaHeader.headerData); + // $display( + // "time=%0t: mkDataStream2Header", $time, + // ", rdmaOpCode=", fshow(rdmaOpCode), + // ", transType=", fshow(transType), + // ", rdmaHeader=", fshow(rdmaHeader) + // ); immAssert( headerLastFragByteEn == curDataStreamFrag.byteEn, diff --git a/src/Headers.bsv b/src/Headers.bsv index 93946c1..b765796 100644 --- a/src/Headers.bsv +++ b/src/Headers.bsv @@ -343,7 +343,7 @@ function Integer calcHeaderLenByTransTypeAndRdmaOpCode( endcase; endfunction /* -// TODO: enable this after refactor +// TODO: enable this after refactor RQ function Integer calcHeaderLenByTransTypeAndRdmaOpCode( TransType transType, RdmaOpCode rdmaOpCode ); diff --git a/src/InputPktHandle.bsv b/src/InputPktHandle.bsv index 64423a5..44c0fa7 100644 --- a/src/InputPktHandle.bsv +++ b/src/InputPktHandle.bsv @@ -151,8 +151,9 @@ module mkExtractHeaderFromRdmaPktPipeOut#( headerMetaDataInQ.enq(headerMetaData); // $display( // "time=%0t: extractHeader", $time, - // ", headerLen=%0d, transType=", headerLen, fshow(transType), + // ", headerLen=%0d", headerLen, // ", rdmaOpCode=", fshow(rdmaOpCode), + // ", transType=", fshow(transType), // ", rdmaPktDataStream=", fshow(rdmaPktDataStream), // ", headerHasPayload=", fshow(headerHasPayload), // ", headerMetaData=", fshow(headerMetaData) diff --git a/src/SendQ.bsv b/src/SendQ.bsv index 8b3e09b..2c4c584 100644 --- a/src/SendQ.bsv +++ b/src/SendQ.bsv @@ -363,7 +363,7 @@ function Maybe#(PktHeaderInfo) genFirstOrOnlyPktHeader( IBV_QPT_RC , IBV_QPT_XRC_SEND, IBV_QPT_XRC_RECV: tagged Valid genPktHeaderInfo( - zeroExtendLSB({ pack(bth), pack(reth) }), + zeroExtendLSB({ pack(bth), pack(unwrapMaybe(reth)) }), fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(RETH_BYTE_WIDTH)), hasPayload ); @@ -416,14 +416,15 @@ function Maybe#(PktHeaderInfo) genMiddleOrLastPktHeader( case (wqe.opcode) IBV_WR_RDMA_WRITE:begin return case (wqe.qpType) - IBV_QPT_RC: tagged Valid genPktHeaderInfo( - zeroExtendLSB(pack(bth)), - fromInteger(valueOf(BTH_BYTE_WIDTH)), + IBV_QPT_RC, + IBV_QPT_UC: tagged Valid genPktHeaderInfo( + zeroExtendLSB({ pack(bth), pack(unwrapMaybe(reth)) }), + fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(RETH_BYTE_WIDTH)), hasPayload ); IBV_QPT_XRC_SEND: tagged Valid genPktHeaderInfo( - zeroExtendLSB({ pack(bth), pack(unwrapMaybe(xrceth)) }), - fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(XRCETH_BYTE_WIDTH)), + zeroExtendLSB({ pack(bth), pack(unwrapMaybe(xrceth)), pack(unwrapMaybe(reth)) }), + fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(XRCETH_BYTE_WIDTH) + valueOf(RETH_BYTE_WIDTH)), hasPayload ); default: tagged Invalid; @@ -431,22 +432,23 @@ function Maybe#(PktHeaderInfo) genMiddleOrLastPktHeader( end IBV_WR_RDMA_WRITE_WITH_IMM: begin return case (wqe.qpType) - IBV_QPT_RC: tagged Valid genPktHeaderInfo( + IBV_QPT_RC, + IBV_QPT_UC: tagged Valid genPktHeaderInfo( isLastReqPkt ? - zeroExtendLSB({ pack(bth), pack(unwrapMaybe(immDt))}) : - zeroExtendLSB(pack(bth)), + zeroExtendLSB({ pack(bth), pack(unwrapMaybe(reth)), pack(unwrapMaybe(immDt))}) : + zeroExtendLSB({ pack(bth), pack(unwrapMaybe(reth)) }), isLastReqPkt ? - fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(IMM_DT_BYTE_WIDTH)) : - fromInteger(valueOf(BTH_BYTE_WIDTH)), + fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(RETH_BYTE_WIDTH) + valueOf(IMM_DT_BYTE_WIDTH)) : + fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(RETH_BYTE_WIDTH)), hasPayload ); IBV_QPT_XRC_SEND: tagged Valid genPktHeaderInfo( isLastReqPkt ? - zeroExtendLSB({ pack(bth), pack(unwrapMaybe(xrceth)), pack(unwrapMaybe(immDt)) }) : - zeroExtendLSB({ pack(bth), pack(unwrapMaybe(xrceth)) }), + zeroExtendLSB({ pack(bth), pack(unwrapMaybe(xrceth)), pack(unwrapMaybe(reth)), pack(unwrapMaybe(immDt)) }) : + zeroExtendLSB({ pack(bth), pack(unwrapMaybe(xrceth)), pack(unwrapMaybe(reth)) }), isLastReqPkt ? - fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(XRCETH_BYTE_WIDTH) + valueOf(IMM_DT_BYTE_WIDTH)) : - fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(XRCETH_BYTE_WIDTH)), + fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(XRCETH_BYTE_WIDTH) + valueOf(RETH_BYTE_WIDTH) + valueOf(IMM_DT_BYTE_WIDTH)) : + fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(XRCETH_BYTE_WIDTH) + valueOf(RETH_BYTE_WIDTH)), hasPayload ); default: tagged Invalid; @@ -454,7 +456,8 @@ function Maybe#(PktHeaderInfo) genMiddleOrLastPktHeader( end IBV_WR_SEND: begin return case (wqe.qpType) - IBV_QPT_RC: tagged Valid genPktHeaderInfo( + IBV_QPT_RC, + IBV_QPT_UC: tagged Valid genPktHeaderInfo( zeroExtendLSB(pack(bth)), fromInteger(valueOf(BTH_BYTE_WIDTH)), hasPayload @@ -469,7 +472,8 @@ function Maybe#(PktHeaderInfo) genMiddleOrLastPktHeader( end IBV_WR_SEND_WITH_IMM: begin return case (wqe.qpType) - IBV_QPT_RC: tagged Valid genPktHeaderInfo( + IBV_QPT_RC, + IBV_QPT_UC: tagged Valid genPktHeaderInfo( isLastReqPkt ? zeroExtendLSB({ pack(bth), pack(unwrapMaybe(immDt)) }) : zeroExtendLSB(pack(bth)), @@ -518,7 +522,7 @@ function Maybe#(PktHeaderInfo) genMiddleOrLastPktHeader( IBV_QPT_RC , IBV_QPT_XRC_SEND, IBV_QPT_XRC_RECV: tagged Valid genPktHeaderInfo( - zeroExtendLSB({ pack(bth), pack(reth) }), + zeroExtendLSB({ pack(bth), pack(unwrapMaybe(reth)) }), fromInteger(valueOf(BTH_BYTE_WIDTH) + valueOf(RETH_BYTE_WIDTH)), hasPayload ); @@ -1049,3 +1053,26 @@ module mkSendQ#( pktHeaderQ.notEmpty ); endmodule + +interface SQ; + interface DmaReadClt dmaReadClt; + interface SendQ sendQ; +endinterface + +(* synthesize *) +module mkSQ#(Bool clearAll)(SQ); + FIFOF#(DmaReadReq) dmaReadReqQ <- mkFIFOF; + FIFOF#(DmaReadResp) dmaReadRespQ <- mkFIFOF; + + let dmaReadSrv = toGPServer(dmaReadReqQ, dmaReadRespQ); + let dmaReadCntrl <- mkDmaReadCntrl(clearAll, dmaReadSrv); + + // TODO: add shouldAddPadding to PayloadGenReqSG + let shouldAddPadding = True; + let payloadGenerator <- mkPayloadGenerator(clearAll, shouldAddPadding, dmaReadCntrl); + + let sq <- mkSendQ(clearAll, payloadGenerator); + + interface dmaReadClt = toGPClient(dmaReadReqQ, dmaReadRespQ); + interface sendQ = sq; +endmodule