From 529e734306754da80c0f673a35377761c066bae4 Mon Sep 17 00:00:00 2001 From: RuigeLee Date: Wed, 27 Mar 2024 14:36:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=B1=BB=E5=9E=8B=E4=BD=BF?= =?UTF-8?q?=E7=94=A81=E5=8F=B7=E5=AF=84=E5=AD=98=E5=99=A8=E6=A0=87?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E7=84=B6=E5=90=8E=E4=BD=BF=E7=94=A8io?= =?UTF-8?q?=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/scala/backBoard/BackBoardMst.scala | 38 ++++++++++----------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/main/scala/backBoard/BackBoardMst.scala b/src/main/scala/backBoard/BackBoardMst.scala index a331cfe..3f070b0 100644 --- a/src/main/scala/backBoard/BackBoardMst.scala +++ b/src/main/scala/backBoard/BackBoardMst.scala @@ -56,6 +56,8 @@ class BackBoardMstBase extends Module{ //10M val ctrlSynch = RegInit( false.B ) val ctrlInit = RegInit( false.B ) + val ctrlFun = RegInit(0.U(8.W)) + val slvNum = RegInit(0.U(6.W)) val slvOffLine = RegInit(0.U(6.W)) val linkNum = RegInit(0.U(7.W)) @@ -139,15 +141,7 @@ trait BackBoardMstFSMC{ this: BackBoardMstBase => statusSynch , statusInit ), - ( activeAddr === 1.U) -> - Cat( - ctrlTransmit, - 0.U(1.W), - 0.U(1.W), - 0.U(1.W), - ctrlSynch, - ctrlInit - ), + ( activeAddr === 1.U) -> ctrlFun, ( activeAddr === 2.U) -> slvNum, ( activeAddr === 3.U) -> slvOffLine, ( activeAddr === 4.U) -> testReg, @@ -173,7 +167,20 @@ trait BackBoardMstFSMC{ this: BackBoardMstBase => //10M when(~RegNext( io.testIO, false.B ) & io.testIO){ - ctrlTransmit := true.B + when( ctrlFun === 0.U ){ + statusInit := false.B + ctrlInit := true.B + } + + when( ctrlFun === 1.U ){ + statusSynch := false.B + ctrlSynch := true.B + } + + when( ctrlFun === 5.U ){ + ctrlTransmit := true.B + } + } @@ -198,16 +205,7 @@ trait BackBoardMstFSMC{ this: BackBoardMstBase => when( wrRegAddr === 1.U ){ - // ctrlTransmit := wrRegData.extract(5) - - ctrlSynch := wrRegData.extract(1) - - when( wrRegData.extract(0) ){ - ctrlInit := true.B - statusSynch := false.B - statusInit := false.B - } - + ctrlFun := wrRegData } when( wrRegAddr === 2.U ){