From fdc8c2b11ef3fc70d719a0c620da6d7640afd3ce Mon Sep 17 00:00:00 2001 From: Liphen Date: Sun, 25 Feb 2024 17:09:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor(core):=20=E4=BF=AE=E6=94=B9clear?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=EF=BC=8C=E4=BD=BF=E9=80=BB=E8=BE=91=E6=9B=B4?= =?UTF-8?q?=E6=B8=85=E6=99=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chisel/playground/src/Core.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chisel/playground/src/Core.scala b/chisel/playground/src/Core.scala index d10e612..71b58cb 100644 --- a/chisel/playground/src/Core.scala +++ b/chisel/playground/src/Core.scala @@ -85,9 +85,10 @@ class Core(implicit val cpuConfig: CpuConfig) extends Module { decodeUnit.executeStage <> executeStage.decodeUnit for (i <- 0 until (cpuConfig.commitNum)) { - executeStage.ctrl.clear(i) := ctrl.memoryUnit.flush || - ctrl.executeUnit.do_flush && ctrl.executeUnit.allow_to_go || - !decodeUnit.instFifo.allow_to_go(i) && ctrl.executeUnit.allow_to_go + // 流水线清空或者暂停时,需要清空缓存级的数据,也就是插入气泡 + executeStage.ctrl.clear(i) := + ctrl.memoryUnit.do_flush || ctrl.executeUnit.do_flush || + !decodeUnit.instFifo.allow_to_go(i) && ctrl.executeUnit.allow_to_go executeStage.ctrl.allow_to_go(i) := decodeUnit.instFifo.allow_to_go(i) }