削减下行部分计数减法器
This commit is contained in:
@@ -97,14 +97,14 @@ trait ShinSlvPhyDownStreamRecv{ this: ShinSlvPhyBase =>
|
|||||||
|
|
||||||
downRecvStateNext := Mux1H(Seq(
|
downRecvStateNext := Mux1H(Seq(
|
||||||
(downRecvStateCurr === DownRecvStateIdle ) -> Mux( downPendBuf.io.deq.valid, DownRecvStateOHead, DownRecvStateIdle ),
|
(downRecvStateCurr === DownRecvStateIdle ) -> Mux( downPendBuf.io.deq.valid, DownRecvStateOHead, DownRecvStateIdle ),
|
||||||
(downRecvStateCurr === DownRecvStateOHead) -> Mux( downPendBuf.io.deq.fire, Mux( ~downPendBuf.io.deq.bits.tlast, Mux(downRecvCnt === ((headByte)-1).U, DownRecvStateSData, DownRecvStateOHead), DownRecvStateIdle ), DownRecvStateOHead),
|
(downRecvStateCurr === DownRecvStateOHead) -> Mux( downPendBuf.io.deq.fire, Mux( ~downPendBuf.io.deq.bits.tlast, Mux(downRecvCnt === ((headByte)).U, DownRecvStateSData, DownRecvStateOHead), DownRecvStateIdle ), DownRecvStateOHead),
|
||||||
(downRecvStateCurr === DownRecvStateSData) -> Mux( downPendBuf.io.deq.fire, Mux( ~downPendBuf.io.deq.bits.tlast, Mux(downRecvCnt === (downLocalDataByte -1.U), Mux( downRecvCnt === (downOldHead.length - 1.U), DownRecvStateCRC, DownRecvStateFData ), DownRecvStateSData), DownRecvStateIdle ), DownRecvStateSData),
|
(downRecvStateCurr === DownRecvStateSData) -> Mux( downPendBuf.io.deq.fire, Mux( ~downPendBuf.io.deq.bits.tlast, Mux(downRecvCnt === (downLocalDataByte ), Mux( downRecvCnt === (downOldHead.length - 1.U), DownRecvStateCRC, DownRecvStateFData ), DownRecvStateSData), DownRecvStateIdle ), DownRecvStateSData),
|
||||||
(downRecvStateCurr === DownRecvStateFData) -> Mux( downPendBuf.io.deq.fire, Mux( ~downPendBuf.io.deq.bits.tlast, Mux(downRecvCnt === (downForwardDataByte -1.U) , DownRecvStateCRC, DownRecvStateFData), DownRecvStateIdle ), DownRecvStateFData),
|
(downRecvStateCurr === DownRecvStateFData) -> Mux( downPendBuf.io.deq.fire, Mux( ~downPendBuf.io.deq.bits.tlast, Mux(downRecvCnt === (downForwardDataByte ) , DownRecvStateCRC, DownRecvStateFData), DownRecvStateIdle ), DownRecvStateFData),
|
||||||
(downRecvStateCurr === DownRecvStateCRC ) -> Mux( downPendBuf.io.deq.fire & downPendBuf.io.deq.bits.tlast, DownRecvStateIdle, DownRecvStateCRC ),
|
(downRecvStateCurr === DownRecvStateCRC ) -> Mux( downPendBuf.io.deq.fire & downPendBuf.io.deq.bits.tlast, DownRecvStateIdle, DownRecvStateCRC ),
|
||||||
))
|
))
|
||||||
|
|
||||||
when( downRecvStateCurr =/= downRecvStateNext ){
|
when( downRecvStateCurr =/= downRecvStateNext ){
|
||||||
downRecvCnt := 0.U
|
downRecvCnt := 1.U
|
||||||
} .elsewhen( downPendBuf.io.deq.fire ){
|
} .elsewhen( downPendBuf.io.deq.fire ){
|
||||||
downRecvCnt := downRecvCnt + 1.U
|
downRecvCnt := downRecvCnt + 1.U
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ trait ShinSlvPhyDownStreamRecv{ this: ShinSlvPhyBase =>
|
|||||||
|
|
||||||
|
|
||||||
when( downRecvStateCurr === DownRecvStateSData & downPendBuf.io.deq.fire ){
|
when( downRecvStateCurr === DownRecvStateSData & downPendBuf.io.deq.fire ){
|
||||||
downRegTemp(downRecvCnt) := downPendBuf.io.deq.bits.tdata
|
downRegTemp(downRecvCnt-1.U) := downPendBuf.io.deq.bits.tdata
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------
|
//---------------
|
||||||
@@ -134,7 +134,7 @@ trait ShinSlvPhyDownStreamRecv{ this: ShinSlvPhyBase =>
|
|||||||
downRecvStateCurr === DownRecvStateFData & downPendBuf.io.deq.fire & ~isLastDevice
|
downRecvStateCurr === DownRecvStateFData & downPendBuf.io.deq.fire & ~isLastDevice
|
||||||
downStreamFifo.io.enq.bits.tdata := downPendBuf.io.deq.bits.tdata
|
downStreamFifo.io.enq.bits.tdata := downPendBuf.io.deq.bits.tdata
|
||||||
downStreamFifo.io.enq.bits.tuser := downPendBuf.io.deq.bits.tuser
|
downStreamFifo.io.enq.bits.tuser := downPendBuf.io.deq.bits.tuser
|
||||||
downStreamFifo.io.enq.bits.tlast := downRecvCnt === (downForwardDataByte -1.U) | downPendBuf.io.deq.bits.tlast
|
downStreamFifo.io.enq.bits.tlast := downRecvCnt === (downForwardDataByte) | downPendBuf.io.deq.bits.tlast
|
||||||
|
|
||||||
downPendBuf.io.deq.ready :=
|
downPendBuf.io.deq.ready :=
|
||||||
(downRecvStateCurr === DownRecvStateOHead) |
|
(downRecvStateCurr === DownRecvStateOHead) |
|
||||||
@@ -156,7 +156,7 @@ trait ShinSlvPhyDownStreamRecv{ this: ShinSlvPhyBase =>
|
|||||||
} .elsewhen( downRecvStateCurr === DownRecvStateFData & downRecvStateNext === DownRecvStateIdle ){
|
} .elsewhen( downRecvStateCurr === DownRecvStateFData & downRecvStateNext === DownRecvStateIdle ){
|
||||||
isDownStreamError := true.B
|
isDownStreamError := true.B
|
||||||
printf("Warning, Wrong Package Received in DownStream, That could not happened!\n")
|
printf("Warning, Wrong Package Received in DownStream, That could not happened!\n")
|
||||||
} .elsewhen( downRecvStateCurr === DownRecvStateCRC & (downRecvCnt > 3.U | (downPendBuf.io.deq.fire & downPendBuf.io.deq.bits.tlast & downRecvCnt < 3.U)) ){
|
} .elsewhen( downRecvStateCurr === DownRecvStateCRC & downPendBuf.io.deq.fire & downPendBuf.io.deq.bits.tlast & downRecvCnt =/= 4.U ){
|
||||||
isDownStreamError := true.B
|
isDownStreamError := true.B
|
||||||
printf("Warning, Wrong Package Received in DownStream, That could not happened!\n")
|
printf("Warning, Wrong Package Received in DownStream, That could not happened!\n")
|
||||||
} .elsewhen( isDownNewHeadCreated & downOldHead.length < downLocalDataByte ){ //本包的负载不能满足本级数据需求,传输错误
|
} .elsewhen( isDownNewHeadCreated & downOldHead.length < downLocalDataByte ){ //本包的负载不能满足本级数据需求,传输错误
|
||||||
|
|||||||
Reference in New Issue
Block a user