From 49e8e922e7b0438d0d74b705ba68f40f85d4cf08 Mon Sep 17 00:00:00 2001 From: Jiuyang Liu Date: Fri, 18 Aug 2023 15:17:25 +0800 Subject: [PATCH] add WithScratchpadsBaseAddress to alter rocket core dtim address --- src/main/scala/subsystem/Configs.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/scala/subsystem/Configs.scala b/src/main/scala/subsystem/Configs.scala index 2f8a2abab29..7b4a8368ac1 100644 --- a/src/main/scala/subsystem/Configs.scala +++ b/src/main/scala/subsystem/Configs.scala @@ -580,6 +580,17 @@ class WithNoSlavePort extends Config((site, here, up) => { case ExtIn => None }) +class WithScratchpadsBaseAddress(address: BigInt) extends Config((site, here, up) => { + case TilesLocated(InSubsystem) => up(TilesLocated(InSubsystem), site) map { + case tp: RocketTileAttachParams => tp.copy(tileParams = tp.tileParams.copy( + dcache = tp.tileParams.dcache.map( + _.copy(scratch = Some(address)) + ) + )) + case t => t + } +}) + class WithScratchpadsOnly extends Config((site, here, up) => { case TilesLocated(InSubsystem) => up(TilesLocated(InSubsystem), site) map { case tp: RocketTileAttachParams => tp.copy(tileParams = tp.tileParams.copy(