diff --git a/build.sbt b/build.sbt index 038d4ca..2786cc0 100644 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ scalaVersion := "2.11.8" EclipseKeys.withSource := true libraryDependencies ++= Seq( - "com.github.spinalhdl" % "spinalhdl-core_2.11" % "0.10.15", - "com.github.spinalhdl" % "spinalhdl-lib_2.11" % "0.10.15", + "com.github.spinalhdl" % "spinalhdl-core_2.11" % "0.11.0", + "com.github.spinalhdl" % "spinalhdl-lib_2.11" % "0.11.0", "org.yaml" % "snakeyaml" % "1.8" -) \ No newline at end of file +) diff --git a/src/main/scala/vexriscv/Stage.scala b/src/main/scala/vexriscv/Stage.scala index eb121e2..57d2a8d 100644 --- a/src/main/scala/vexriscv/Stage.scala +++ b/src/main/scala/vexriscv/Stage.scala @@ -12,13 +12,12 @@ class Stageable[T <: Data](val dataType : T) extends HardType[T](dataType) with class Stage() extends Area{ def outsideCondScope[T](that : => T) : T = { - val condStack = GlobalData.get.conditionalAssignStack.stack.toList - val switchStack = GlobalData.get.switchStack.stack.toList - GlobalData.get.conditionalAssignStack.stack.clear() - GlobalData.get.switchStack.stack.clear() + val body = Component.current.dslBody + body.push() + val swapContext = body.swap() val ret = that - GlobalData.get.conditionalAssignStack.stack.pushAll(condStack.reverseIterator) - GlobalData.get.switchStack.stack.pushAll(switchStack.reverseIterator) + body.pop() + swapContext.appendBack() ret } diff --git a/src/main/scala/vexriscv/TestsWorkspace.scala b/src/main/scala/vexriscv/TestsWorkspace.scala index 44a5150..95d1314 100644 --- a/src/main/scala/vexriscv/TestsWorkspace.scala +++ b/src/main/scala/vexriscv/TestsWorkspace.scala @@ -28,7 +28,7 @@ import spinal.lib.eda.altera.{InterruptReceiverTag, ResetEmitterTag} object TestsWorkspace { def main(args: Array[String]) { - SpinalVerilog { + SpinalConfig(mergeAsyncProcess = false).generateVerilog { val configFull = VexRiscvConfig( plugins = List( new PcManagerSimplePlugin( diff --git a/src/main/scala/vexriscv/demo/GenSmallestNoCsr.scala b/src/main/scala/vexriscv/demo/GenSmallestNoCsr.scala index bbc8d27..096394a 100644 --- a/src/main/scala/vexriscv/demo/GenSmallestNoCsr.scala +++ b/src/main/scala/vexriscv/demo/GenSmallestNoCsr.scala @@ -54,5 +54,5 @@ object GenSmallestNoCsr extends App{ ) ) ) - SpinalVerilog(cpu()) + SpinalConfig(mergeAsyncProcess = false).generateVerilog(cpu()) } diff --git a/src/main/scala/vexriscv/plugin/DecoderSimplePlugin.scala b/src/main/scala/vexriscv/plugin/DecoderSimplePlugin.scala index cbcb5d5..299d084 100644 --- a/src/main/scala/vexriscv/plugin/DecoderSimplePlugin.scala +++ b/src/main/scala/vexriscv/plugin/DecoderSimplePlugin.scala @@ -83,11 +83,11 @@ class DecoderSimplePlugin(catchIllegalInstruction : Boolean) extends Plugin[VexR stageables.foreach(e => { defaults.get(e) match { case Some(value) => { - value.input match { + value.head.source match { case literal: EnumLiteral[_] => literal.fixEncoding(e.dataType.asInstanceOf[SpinalEnumCraft[_]].getEncoding) case _ => } - defaultValue += value.input.asInstanceOf[Literal].getValue << offset + defaultValue += value.head.source .asInstanceOf[Literal].getValue << offset defaultCare += ((BigInt(1) << e.dataType.getBitsWidth) - 1) << offset } @@ -102,12 +102,12 @@ class DecoderSimplePlugin(catchIllegalInstruction : Boolean) extends Plugin[VexR var decodedValue = defaultValue var decodedCare = defaultCare for((e, literal) <- values){ - literal.input match{ + literal.head.source match{ case literal : EnumLiteral[_] => literal.fixEncoding(e.dataType.asInstanceOf[SpinalEnumCraft[_]].getEncoding) case _ => } val offset = offsetOf(e) - decodedValue |= literal.input.asInstanceOf[Literal].getValue << offset + decodedValue |= literal.head.source.asInstanceOf[Literal].getValue << offset decodedCare |= ((BigInt(1) << e.dataType.getBitsWidth)-1) << offset } (Masked(key.value,key.careAbout),Masked(decodedValue,decodedCare)) @@ -145,7 +145,7 @@ class DecoderSimplePlugin(catchIllegalInstruction : Boolean) extends Plugin[VexR val stageables = encodings.flatMap(_._2.map(_._1)).toSet stageables.foreach(e => out(RegNext(RegNext(toplevel.decode.insert(e)).setName(e.getName())))) if(catchIllegalInstruction) out(RegNext(RegNext(toplevel.decode.insert(LEGAL_INSTRUCTION)).setName(LEGAL_INSTRUCTION.getName()))) - toplevel.getAdditionalNodesRoot.clear() + // toplevel.getAdditionalNodesRoot.clear() } } }