summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/MemorySearch.scala
diff options
context:
space:
mode:
authorJack2022-01-12 04:27:19 +0000
committerJack2022-01-12 04:27:19 +0000
commit29df513e348cc809876893f650af8180f0190496 (patch)
tree06daaea954b4e5af7113f06e4bdbb78b33515cb3 /src/test/scala/chiselTests/MemorySearch.scala
parent5242ce90659decb9058ee75db56e5c188029fbf9 (diff)
parent747d16311bdf185d2e98e452b14cb5d8ccca004c (diff)
Merge branch 'master' into 3.5-release
Diffstat (limited to 'src/test/scala/chiselTests/MemorySearch.scala')
-rw-r--r--src/test/scala/chiselTests/MemorySearch.scala24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/test/scala/chiselTests/MemorySearch.scala b/src/test/scala/chiselTests/MemorySearch.scala
index ebfdace1..df1c6b32 100644
--- a/src/test/scala/chiselTests/MemorySearch.scala
+++ b/src/test/scala/chiselTests/MemorySearch.scala
@@ -7,23 +7,23 @@ import chisel3.stage.ChiselStage
class MemorySearch extends Module {
val io = IO(new Bundle {
- val target = Input(UInt(4.W))
- val en = Input(Bool())
- val done = Output(Bool())
+ val target = Input(UInt(4.W))
+ val en = Input(Bool())
+ val done = Output(Bool())
val address = Output(UInt(3.W))
})
- val vals = Array(0, 4, 15, 14, 2, 5, 13)
+ val vals = Array(0, 4, 15, 14, 2, 5, 13)
val index = RegInit(0.U(3.W))
- val elts = VecInit(vals.map(_.asUInt(4.W)))
+ val elts = VecInit(vals.map(_.asUInt(4.W)))
// val elts = Mem(UInt(32.W), 8) TODO ????
- val elt = elts(index)
- val end = !io.en && ((elt === io.target) || (index === 7.U))
- when (io.en) {
+ val elt = elts(index)
+ val end = !io.en && ((elt === io.target) || (index === 7.U))
+ when(io.en) {
index := 0.U
- } .elsewhen (!end) {
+ }.elsewhen(!end) {
index := index +% 1.U
}
- io.done := end
+ io.done := end
io.address := index
}
@@ -46,7 +46,7 @@ class MemorySearchTester(c: MemorySearch) extends Tester(c) {
"LOOKING FOR " + target + " FOUND " + addr)
}
}
-*/
+ */
class MemorySearchSpec extends ChiselPropSpec {
@@ -54,5 +54,5 @@ class MemorySearchSpec extends ChiselPropSpec {
ChiselStage.elaborate { new EnableShiftRegister }
}
- ignore("MemorySearch should return the correct result") { }
+ ignore("MemorySearch should return the correct result") {}
}