From 570720fdd875bf49f5b6b7f1b0883608096b7095 Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Wed, 22 Mar 2023 17:13:47 +0100 Subject: [PATCH] Cfu add enableInit option --- src/main/scala/vexriscv/plugin/CfuPlugin.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/scala/vexriscv/plugin/CfuPlugin.scala b/src/main/scala/vexriscv/plugin/CfuPlugin.scala index 2a18b2d..2e878ea 100644 --- a/src/main/scala/vexriscv/plugin/CfuPlugin.scala +++ b/src/main/scala/vexriscv/plugin/CfuPlugin.scala @@ -104,7 +104,8 @@ class CfuPlugin(val stageCount : Int, val encodings : List[CfuPluginEncoding] = null, val stateAndIndexCsrOffset : Int = 0xBC0, val statusCsrOffset : Int = 0x801, - val withEnable : Boolean = true) extends Plugin[VexRiscv]{ + val withEnable : Boolean = true, + val enableInit : Boolean = false) extends Plugin[VexRiscv]{ def p = busParameter assert(p.CFU_INPUTS <= 2) @@ -176,7 +177,7 @@ class CfuPlugin(val stageCount : Int, val csr = pipeline plug new Area{ val factory = pipeline.service(classOf[CsrInterface]) - val en = withEnable generate (Reg(Bool()) init(False)) + val en = withEnable generate (Reg(Bool()) init(enableInit)) if(withEnable) factory.rw(stateAndIndexCsrOffset, 31, en) val stateId = Reg(UInt(log2Up(p.CFU_STATE_INDEX_NUM) bits)) init(0)