提交 3469bd46 编写于 作者: A Allen

L1plusCache: fixed flush state machine.

上级 85017ac9
......@@ -319,7 +319,7 @@ class L1plusCacheImp(outer: L1plusCache) extends LazyModuleImp(outer) with HasL1
switch (state) {
is (s_invalid) {
when (io.flush) {
state := s_invalid
state := s_drain_cache
}
}
is (s_drain_cache) {
......
......@@ -137,6 +137,14 @@ class L1plusCacheTest extends FlatSpec with ChiselScalatestTester with Matchers
c.io.l1plus.flush.poke(false.B)
}
def flush_l1plus() = {
c.io.l1plus.flush.poke(true.B)
while (!c.io.l1plus.empty.peek().litToBoolean) {
c.clock.step()
}
c.io.l1plus.flush.poke(false.B)
}
def evaluate() = {
while (!sq.isFinished() || !lq.isFinished()) {
sq.tick(c.io.dcacheStore)
......@@ -178,7 +186,16 @@ class L1plusCacheTest extends FlatSpec with ChiselScalatestTester with Matchers
scan_test()
// random read/write test
// self_modify_test
def self_modify_test() = {
println(s"self_modify_test")
for (i <- 0 until 10) {
flush_l1plus()
scan_test()
}
}
self_modify_test()
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册