SpinalHDL 1.1.1

This commit is contained in:
Dolu1990
2017-12-30 03:36:18 +01:00
parent ba46b38c7d
commit 54ce67d40e
2 changed files with 11 additions and 14 deletions

View File

@@ -7,8 +7,8 @@ scalaVersion := "2.11.6"
EclipseKeys.withSource := true
libraryDependencies ++= Seq(
"com.github.spinalhdl" % "spinalhdl-core_2.11" % "1.1.0",
"com.github.spinalhdl" % "spinalhdl-lib_2.11" % "1.1.0"
"com.github.spinalhdl" % "spinalhdl-core_2.11" % "1.1.1",
"com.github.spinalhdl" % "spinalhdl-lib_2.11" % "1.1.1"
)
addCompilerPlugin("org.scala-lang.plugins" % "scala-continuations-plugin_2.11.6" % "1.0.2")

View File

@@ -17,26 +17,23 @@ object MyTopLevelSim {
var modelState = 0
var idx = 0
while(idx < 100){
//Generate random values to drive the reference model and the dut
val cond0, cond1 = Random.nextBoolean()
//Drive the dut inputs
dut.io.cond0 #= cond0
dut.io.cond1 #= cond1
//Drive the dut inputs with random values
dut.io.cond0 #= Random.nextBoolean()
dut.io.cond1 #= Random.nextBoolean()
//Wait a rising edge on the clock
dut.clockDomain.waitRisingEdge()
//Update the reference model values
if(cond0) {
modelState = (modelState + 1) & 0xFF
}
val modelFlag = modelState == 0 || cond1
//Check that the dut values match with the reference model ones
val modelFlag = modelState == 0 || dut.io.cond1.toBoolean
assert(dut.io.state.toInt == modelState)
assert(dut.io.flag.toBoolean == modelFlag)
//Update the reference model value
if(dut.io.cond0.toBoolean) {
modelState = (modelState + 1) & 0xFF
}
idx += 1
}
}