summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/Tbl.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/chiselTests/Tbl.scala')
-rw-r--r--src/test/scala/chiselTests/Tbl.scala22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/test/scala/chiselTests/Tbl.scala b/src/test/scala/chiselTests/Tbl.scala
index c79eb8a4..66a06435 100644
--- a/src/test/scala/chiselTests/Tbl.scala
+++ b/src/test/scala/chiselTests/Tbl.scala
@@ -2,20 +2,22 @@
package chiselTests
-import Chisel._
import org.scalatest._
import org.scalatest.prop._
-import Chisel.testers.BasicTester
+
+import chisel3._
+import chisel3.testers.BasicTester
+import chisel3.util._
class Tbl(w: Int, n: Int) extends Module {
- val io = new Bundle {
- val wi = UInt(INPUT, log2Up(n))
- val ri = UInt(INPUT, log2Up(n))
- val we = Bool(INPUT)
- val d = UInt(INPUT, w)
- val o = UInt(OUTPUT, w)
- }
- val m = Mem(n, UInt(width = w))
+ val io = IO(new Bundle {
+ val wi = Input(UInt.width(log2Up(n)))
+ val ri = Input(UInt.width(log2Up(n)))
+ val we = Input(Bool())
+ val d = Input(UInt.width(w))
+ val o = Output(UInt.width(w))
+ })
+ val m = Mem(n, UInt.width(w))
io.o := m(io.ri)
when (io.we) {
m(io.wi) := io.d