diff options
Diffstat (limited to 'src/test/scala/cookbook')
| -rw-r--r-- | src/test/scala/cookbook/FSM.scala | 4 | ||||
| -rw-r--r-- | src/test/scala/cookbook/RegOfVec.scala | 2 | ||||
| -rw-r--r-- | src/test/scala/cookbook/UInt2VecOfBool.scala | 2 | ||||
| -rw-r--r-- | src/test/scala/cookbook/VecOfBool2UInt.scala | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/test/scala/cookbook/FSM.scala b/src/test/scala/cookbook/FSM.scala index 9cc0ef2a..22cf8059 100644 --- a/src/test/scala/cookbook/FSM.scala +++ b/src/test/scala/cookbook/FSM.scala @@ -47,8 +47,8 @@ class DetectTwoOnesTester extends CookbookTester(10) { val dut = Module(new DetectTwoOnes) // Inputs and expected results - val inputs: Vec[Bool] = Vec(false.B, true.B, false.B, true.B, true.B, true.B, false.B, true.B, true.B, false.B) - val expected: Vec[Bool] = Vec(false.B, false.B, false.B, false.B, false.B, true.B, true.B, false.B, false.B, true.B) + val inputs: Vec[Bool] = VecInit(false.B, true.B, false.B, true.B, true.B, true.B, false.B, true.B, true.B, false.B) + val expected: Vec[Bool] = VecInit(false.B, false.B, false.B, false.B, false.B, true.B, true.B, false.B, false.B, true.B) dut.io.in := inputs(cycle) assert(dut.io.out === expected(cycle)) diff --git a/src/test/scala/cookbook/RegOfVec.scala b/src/test/scala/cookbook/RegOfVec.scala index ba784871..fee7f2e1 100644 --- a/src/test/scala/cookbook/RegOfVec.scala +++ b/src/test/scala/cookbook/RegOfVec.scala @@ -19,7 +19,7 @@ class RegOfVec extends CookbookTester(2) { // Note that Seq.fill constructs 4 32-bit UInt literals with the value 0 // Vec(...) then constructs a Wire of these literals // The Reg is then initialized to the value of the Wire (which gives it the same type) - val initRegOfVec = RegInit(Vec(Seq.fill(4)(0.U(32.W)))) + val initRegOfVec = RegInit(VecInit(Seq.fill(4)(0.U(32.W)))) // Simple test (cycle comes from superclass) when (cycle === 2.U) { assert(regOfVec(2) === 123.U) } diff --git a/src/test/scala/cookbook/UInt2VecOfBool.scala b/src/test/scala/cookbook/UInt2VecOfBool.scala index 96b2da5a..f69c483a 100644 --- a/src/test/scala/cookbook/UInt2VecOfBool.scala +++ b/src/test/scala/cookbook/UInt2VecOfBool.scala @@ -12,7 +12,7 @@ import chisel3._ class UInt2VecOfBool extends CookbookTester(1) { // Example val uint = 0xc.U - val vec = Vec(uint.toBools) + val vec = VecInit(uint.toBools) printf(p"$vec") // Vec(0, 0, 1, 1) // Test diff --git a/src/test/scala/cookbook/VecOfBool2UInt.scala b/src/test/scala/cookbook/VecOfBool2UInt.scala index 40faca30..5780154e 100644 --- a/src/test/scala/cookbook/VecOfBool2UInt.scala +++ b/src/test/scala/cookbook/VecOfBool2UInt.scala @@ -10,10 +10,10 @@ import chisel3._ */ class VecOfBool2UInt extends CookbookTester(1) { // Example - val vec = Vec(true.B, false.B, true.B, true.B) + val vec = VecInit(true.B, false.B, true.B, true.B) val uint = vec.asUInt printf(p"$uint") // 13 - + /* Test * * (remember leftmost Bool in Vec is low order bit) |
