在32数据通道下传输正确
This commit is contained in:
@@ -53,7 +53,7 @@ class SwitchMux(edgeOut: TLEdgeOut)(implicit p: Parameters) extends SwitchModule
|
|||||||
|
|
||||||
|
|
||||||
def ptr = "h80002000".U
|
def ptr = "h80002000".U
|
||||||
def txLength = 8.U
|
def txLength = 64.U
|
||||||
def PerPacketCrcEn = true.B
|
def PerPacketCrcEn = true.B
|
||||||
def PerPacketPad = true.B
|
def PerPacketPad = true.B
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ class SwitchMux(edgeOut: TLEdgeOut)(implicit p: Parameters) extends SwitchModule
|
|||||||
|
|
||||||
val dmaAddress = Reg( UInt(32.W) )
|
val dmaAddress = Reg( UInt(32.W) )
|
||||||
|
|
||||||
when( stateCur === stateIdle && stateNxt =/= stateIdle ){
|
when( stateCur === stateIdle ){
|
||||||
dmaAddress := ptr
|
dmaAddress := ptr
|
||||||
} .elsewhen( io.dmaMst.A.fire ){
|
} .elsewhen( io.dmaMst.A.fire ){
|
||||||
dmaAddress := dmaAddress + 4.U
|
dmaAddress := dmaAddress + 4.U
|
||||||
|
|||||||
@@ -35,21 +35,57 @@ class TxBuffIO extends Bundle{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class TxBuff extends Module{
|
abstract class TxBuffBase extends Module{
|
||||||
val io: TxBuffIO = IO(new TxBuffIO)
|
val io: TxBuffIO = IO(new TxBuffIO)
|
||||||
|
|
||||||
io.enq.data.ready := true.B
|
|
||||||
io.enq.req.ready := true.B
|
|
||||||
|
|
||||||
io.enq.resp.valid := false.B
|
|
||||||
io.enq.resp.bits := DontCare
|
|
||||||
|
|
||||||
io.deq.data.valid := false.B
|
val buff = Module(new Queue( UInt(32.W), 2048/4 ))
|
||||||
io.deq.data.bits := 0.U
|
val reqInfo = Reg(new Transmit_Req_Bundle)
|
||||||
|
val respInfo = Reg(new Transmit_Resp_Bundle)
|
||||||
|
val enqCnt = Reg(UInt(16.W))
|
||||||
|
val deqReqValid = RegInit(false.B)
|
||||||
|
|
||||||
|
|
||||||
io.deq.req.valid := false.B
|
|
||||||
io.deq.req.bits := DontCare
|
|
||||||
|
|
||||||
io.deq.resp.ready := true.B
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
trait TxBuffEnq{ this: TxBuffBase =>
|
||||||
|
io.enq.data <> buff.io.enq
|
||||||
|
|
||||||
|
|
||||||
|
when( io.enq.req.fire ){
|
||||||
|
enqCnt := 0.U
|
||||||
|
reqInfo := io.enq.req.bits
|
||||||
|
} .elsewhen( io.enq.data.fire ){
|
||||||
|
enqCnt := enqCnt + 4.U
|
||||||
|
// when( enqCnt + 4.U >= reqInfo.txLength ){
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
io.enq.req.ready := ~buff.io.deq.valid
|
||||||
|
|
||||||
|
|
||||||
|
when( io.deq.req.fire ){
|
||||||
|
deqReqValid := false.B
|
||||||
|
} .elsewhen( io.enq.data.fire && enqCnt === 32.U ) {
|
||||||
|
deqReqValid := true.B
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
trait TxBuffDeq{ this: TxBuffBase =>
|
||||||
|
io.deq.resp <> io.enq.resp
|
||||||
|
|
||||||
|
io.deq.req.valid := deqReqValid
|
||||||
|
io.deq.req.bits := reqInfo
|
||||||
|
|
||||||
|
io.deq.data <> buff.io.deq
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class TxBuff extends TxBuffBase with TxBuffEnq with TxBuffDeq
|
||||||
|
|||||||
@@ -112,8 +112,10 @@ class MacTileLinkTx extends Module with RequireAsyncReset{
|
|||||||
TxByteCnt := TxByteCnt + 1.U
|
TxByteCnt := TxByteCnt + 1.U
|
||||||
}
|
}
|
||||||
|
|
||||||
when(io.TxStartFrm_sync & ~TxStartFrm | io.TxUsedData & Flop & TxByteCnt === 3.U &
|
when(
|
||||||
~LastWord | TxStartFrm & io.TxUsedData & Flop & TxByteCnt === 0.U ){
|
io.TxStartFrm_sync & ~TxStartFrm |
|
||||||
|
io.TxUsedData & Flop & TxByteCnt === 3.U & ~LastWord |
|
||||||
|
TxStartFrm & io.TxUsedData & Flop & TxByteCnt === 0.U ){
|
||||||
ReadTxDataFromFifo_tck := true.B
|
ReadTxDataFromFifo_tck := true.B
|
||||||
} .elsewhen(io.ReadTxDataFromFifo_syncb & ~RegNext(io.ReadTxDataFromFifo_syncb, false.B)){
|
} .elsewhen(io.ReadTxDataFromFifo_syncb & ~RegNext(io.ReadTxDataFromFifo_syncb, false.B)){
|
||||||
ReadTxDataFromFifo_tck := false.B
|
ReadTxDataFromFifo_tck := false.B
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ abstract class MacTileLinkBase() extends Module{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
when((TxLength === 0.U) & io.TxUsedData){
|
when(((TxLength - 4.U) === 0.U) & io.TxUsedData){
|
||||||
TxEndFrm_wb := true.B
|
TxEndFrm_wb := true.B
|
||||||
} .elsewhen(txRetryPulse | txDonePulse | txAbortPulse){
|
} .elsewhen(txRetryPulse | txDonePulse | txAbortPulse){
|
||||||
TxEndFrm_wb := false.B
|
TxEndFrm_wb := false.B
|
||||||
|
|||||||
Reference in New Issue
Block a user