summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/BundleWire.scala
diff options
context:
space:
mode:
authorducky2016-11-17 13:01:03 -0800
committerducky2016-11-21 13:31:12 -0800
commit54d3f8dc054e55dfbd01d1aa034169a3dabe89f2 (patch)
tree7f6f9de04de6eb08878ac46be339fefc2a71395f /src/test/scala/chiselTests/BundleWire.scala
parentcd904da0aa0e96ba679906a3ee5dbdc068eace48 (diff)
Restyle a lot of test code, mainly with regex
Diffstat (limited to 'src/test/scala/chiselTests/BundleWire.scala')
-rw-r--r--src/test/scala/chiselTests/BundleWire.scala20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/scala/chiselTests/BundleWire.scala b/src/test/scala/chiselTests/BundleWire.scala
index 5b38ff6e..0faab9d0 100644
--- a/src/test/scala/chiselTests/BundleWire.scala
+++ b/src/test/scala/chiselTests/BundleWire.scala
@@ -8,8 +8,8 @@ import chisel3.testers.BasicTester
//import chisel3.core.ExplicitCompileOptions.Strict
class Coord extends Bundle {
- val x = UInt.width( 32)
- val y = UInt.width( 32)
+ val x = UInt(32.W)
+ val y = UInt(32.W)
}
class BundleWire(n: Int) extends Module {
@@ -26,12 +26,12 @@ class BundleWire(n: Int) extends Module {
class BundleToUnitTester extends BasicTester {
val bundle1 = Wire(new Bundle {
- val a = UInt(width = 4)
- val b = UInt(width = 4)
+ val a = UInt(4.W)
+ val b = UInt(4.W)
})
val bundle2 = Wire(new Bundle {
- val a = UInt(width = 2)
- val b = UInt(width = 6)
+ val a = UInt(2.W)
+ val b = UInt(6.W)
})
// 0b00011011 split as 0001 1011 and as 00 011011
@@ -47,11 +47,11 @@ class BundleToUnitTester extends BasicTester {
class BundleWireTester(n: Int, x: Int, y: Int) extends BasicTester {
val dut = Module(new BundleWire(n))
- dut.io.in.x := UInt(x)
- dut.io.in.y := UInt(y)
+ dut.io.in.x := x.asUInt
+ dut.io.in.y := y.asUInt
for (elt <- dut.io.outs) {
- assert(elt.x === UInt(x))
- assert(elt.y === UInt(y))
+ assert(elt.x === x.asUInt)
+ assert(elt.y === y.asUInt)
}
stop()
}