From 38a464a8296c3cb2b2b5fca84163c76790d13a72 Mon Sep 17 00:00:00 2001 From: Charles Papon Date: Sat, 25 May 2019 00:28:30 +0200 Subject: [PATCH] DataCache now allocate ways randomly --- src/main/scala/vexriscv/ip/DataCache.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/scala/vexriscv/ip/DataCache.scala b/src/main/scala/vexriscv/ip/DataCache.scala index 9239cf5..f692680 100644 --- a/src/main/scala/vexriscv/ip/DataCache.scala +++ b/src/main/scala/vexriscv/ip/DataCache.scala @@ -678,11 +678,13 @@ class DataCache(p : DataCacheConfig) extends Component{ tagsWriteCmd.data.error := error || io.mem.rsp.error tagsWriteCmd.way := waysAllocator - waysAllocator := (waysAllocator ## waysAllocator.msb).resized - error := False } + when(!valid){ + waysAllocator := (waysAllocator ## waysAllocator.msb).resized + } + io.cpu.redo setWhen(valid) stageB.mmuRspFreeze setWhen(stageB.loaderValid || valid) }