From 88cc91db75daeb79f727b6f07f9af5ae0fc681b9 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Tue, 24 May 2016 15:46:51 -0700 Subject: [PATCH] Ignore way_en in MetadataArray for direct-mapped caches --- uncore/src/main/scala/cache.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uncore/src/main/scala/cache.scala b/uncore/src/main/scala/cache.scala index e30cf486..27d96ab8 100644 --- a/uncore/src/main/scala/cache.scala +++ b/uncore/src/main/scala/cache.scala @@ -149,8 +149,8 @@ class MetadataArray[T <: Metadata](onReset: () => T)(implicit p: Parameters) ext val rst = rst_cnt < UInt(nSets) val waddr = Mux(rst, rst_cnt, io.write.bits.idx) val wdata = Mux(rst, rstVal, io.write.bits.data).toBits - val wmask = Mux(rst, SInt(-1), io.write.bits.way_en.toSInt).toBools - val rmask = Mux(rst, SInt(-1), io.read.bits.way_en.toSInt).toBools + val wmask = Mux(rst || Bool(nWays == 1), SInt(-1), io.write.bits.way_en.toSInt).toBools + val rmask = Mux(rst || Bool(nWays == 1), SInt(-1), io.read.bits.way_en.toSInt).toBools when (rst) { rst_cnt := rst_cnt+UInt(1) } val metabits = rstVal.getWidth