diff --git a/src/main/scala/backBoard/shin/MasterParser.scala b/src/main/scala/backBoard/shin/MasterParser.scala index 280bd54..4587998 100644 --- a/src/main/scala/backBoard/shin/MasterParser.scala +++ b/src/main/scala/backBoard/shin/MasterParser.scala @@ -210,10 +210,18 @@ with MasterParserStat{ io.deltaTimeStamp := deltaTimeStamp val txStamps = Reg(UInt(32.W)) + val pkgChkCnt = Reg(UInt(4.W)) + + when( io.upIn.fire & io.upIn.bits.tlast ){ + pkgChkCnt := 0.U + } .elsewhen( io.downOut.fire & pkgChkCnt =/= 9.U ){ + pkgChkCnt := pkgChkCnt + 1.U + } + when( io.downOut.fire & io.downOut.bits.tlast ){ txStamps := io.cReg.timeStamp(31,0) - } .elsewhen( io.upIn.fire & io.upIn.bits.tlast & ~io.upIn.bits.tuser ){ + } .elsewhen( io.upIn.fire & io.upIn.bits.tlast & ~io.upIn.bits.tuser & pkgChkCnt === 9.U ){ deltaTimeStamp := io.cReg.timeStamp(31,0) - txStamps } } \ No newline at end of file