From 469c0fe962144e59d1b9fadae8ae54788926a76f Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Thu, 7 Mar 2024 17:18:02 -0800 Subject: [PATCH] Parameterize cache size in VortexL1Cache --- src/main/scala/radiance/memory/VortexCache.scala | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/scala/radiance/memory/VortexCache.scala b/src/main/scala/radiance/memory/VortexCache.scala index 480b0d4..75fa9f1 100644 --- a/src/main/scala/radiance/memory/VortexCache.scala +++ b/src/main/scala/radiance/memory/VortexCache.scala @@ -10,6 +10,7 @@ import org.chipsalliance.cde.config.{Parameters, Field} case object VortexL1Key extends Field[Option[VortexL1Config]](None /*default*/ ) case class VortexL1Config( + cacheSize: Int, // total cache size in bytes numBanks: Int, wordSize: Int, // This is the read/write granularity of the L1 cache cacheLineSize: Int, @@ -34,6 +35,7 @@ case class VortexL1Config( object defaultVortexL1Config extends VortexL1Config( + cacheSize = 16384, numBanks = 4, wordSize = 16, cacheLineSize = 16, @@ -203,6 +205,7 @@ class VortexBankImp( val vxCache = Module( new VX_cache_top( WORD_SIZE = config.wordSize, + CACHE_SIZE = config.cacheSize / config.numBanks, CACHE_LINE_SIZE = config.cacheLineSize, CORE_TAG_WIDTH = config.coreTagPlusSizeWidth, MSHR_SIZE = config.mshrSize @@ -389,7 +392,7 @@ class VortexBankImp( class VX_cache_top( // these values should match the default settings in Verilog // TODO: INSTANCE_ID - CACHE_SIZE: Int = 16384 / 4, // 1, "CACHE_SIZE" -> CACHE_SIZE, "LINE_SIZE" -> CACHE_LINE_SIZE,