diff --git a/src/main/scala/vexriscv/Stage.scala b/src/main/scala/vexriscv/Stage.scala index d4099d6..fe20d19 100644 --- a/src/main/scala/vexriscv/Stage.scala +++ b/src/main/scala/vexriscv/Stage.scala @@ -15,10 +15,10 @@ class Stageable[T <: Data](_dataType : => T) extends HardType[T](_dataType) with class Stage() extends Area{ def outsideCondScope[T](that : => T) : T = { val body = Component.current.dslBody // Get the head of the current component symboles tree (AST in other words) - body.push() // Now all access to the SpinalHDL API will be append to it (instead of the current context) + val ctx = body.push() // Now all access to the SpinalHDL API will be append to it (instead of the current context) val swapContext = body.swap() // Empty the symbole tree (but keep a reference to the old content) val ret = that // Execute the block of code (will be added to the recently empty body) - body.pop() // Restore the original context in which this function was called + ctx.restore() // Restore the original context in which this function was called swapContext.appendBack() // append the original symboles tree to the modified body ret // return the value returned by that } diff --git a/src/main/scala/vexriscv/demo/Briey.scala b/src/main/scala/vexriscv/demo/Briey.scala index 76c688d..40da56a 100644 --- a/src/main/scala/vexriscv/demo/Briey.scala +++ b/src/main/scala/vexriscv/demo/Briey.scala @@ -51,52 +51,56 @@ object BrieyConfig{ ), cpuPlugins = ArrayBuffer( new PcManagerSimplePlugin(0x80000000l, false), - // new IBusSimplePlugin( - // interfaceKeepData = false, - // catchAccessFault = true - // ), - new IBusCachedPlugin( + new IBusSimplePlugin( resetVector = 0x80000000l, - prediction = STATIC, - config = InstructionCacheConfig( - cacheSize = 4096, - bytePerLine =32, - wayCount = 1, - addressWidth = 32, - cpuDataWidth = 32, - memDataWidth = 32, - catchIllegalAccess = true, - catchAccessFault = true, - asyncTagMemory = false, - twoCycleRam = true, - twoCycleCache = true - ) + cmdForkOnSecondStage = false, + cmdForkPersistence = true, + catchAccessFault = true, + compressedGen = true + ), +// new IBusCachedPlugin( +// resetVector = 0x80000000l, +// prediction = STATIC, +// compressedGen = true, +// config = InstructionCacheConfig( +// cacheSize = 4096, +// bytePerLine =32, +// wayCount = 1, +// addressWidth = 32, +// cpuDataWidth = 32, +// memDataWidth = 32, +// catchIllegalAccess = true, +// catchAccessFault = true, +// asyncTagMemory = false, +// twoCycleRam = true, +// twoCycleCache = true +// ) // askMemoryTranslation = true, // memoryTranslatorPortConfig = MemoryTranslatorPortConfig( // portTlbSize = 4 // ) - ), - // new DBusSimplePlugin( - // catchAddressMisaligned = true, - // catchAccessFault = true - // ), - new DBusCachedPlugin( - config = new DataCacheConfig( - cacheSize = 4096, - bytePerLine = 32, - wayCount = 1, - addressWidth = 32, - cpuDataWidth = 32, - memDataWidth = 32, - catchAccessError = true, - catchIllegal = true, - catchUnaligned = true - ), - memoryTranslatorPortConfig = null - // memoryTranslatorPortConfig = MemoryTranslatorPortConfig( - // portTlbSize = 6 - // ) - ), +// ), + new DBusSimplePlugin( + catchAddressMisaligned = true, + catchAccessFault = true + ), +// new DBusCachedPlugin( +// config = new DataCacheConfig( +// cacheSize = 4096, +// bytePerLine = 32, +// wayCount = 1, +// addressWidth = 32, +// cpuDataWidth = 32, +// memDataWidth = 32, +// catchAccessError = true, +// catchIllegal = true, +// catchUnaligned = true +// ), +// memoryTranslatorPortConfig = null +// // memoryTranslatorPortConfig = MemoryTranslatorPortConfig( +// // portTlbSize = 6 +// // ) +// ), new StaticMemoryTranslatorPlugin( ioRange = _(31 downto 28) === 0xF ), @@ -104,7 +108,7 @@ object BrieyConfig{ catchIllegalInstruction = true ), new RegFilePlugin( - regFileReadyKind = plugin.SYNC, + regFileReadyKind = plugin.ASYNC, zeroBoot = false ), new IntAluPlugin, diff --git a/src/main/scala/vexriscv/demo/smp/VexRiscvSmpCluster.scala b/src/main/scala/vexriscv/demo/smp/VexRiscvSmpCluster.scala index 0623c77..cb0d94b 100644 --- a/src/main/scala/vexriscv/demo/smp/VexRiscvSmpCluster.scala +++ b/src/main/scala/vexriscv/demo/smp/VexRiscvSmpCluster.scala @@ -43,9 +43,9 @@ class VexRiscvSmpClusterBase(p : VexRiscvSmpClusterParameter) extends Area with systemCd.setInput(debugCd) - systemCd.outputClockDomain.push() + val ctx = systemCd.outputClockDomain.push() override def postInitCallback(): VexRiscvSmpClusterBase.this.type = { - systemCd.outputClockDomain.pop() + ctx.restore() this }