diff --git a/generators/chipyard/src/main/scala/config/AbstractConfig.scala b/generators/chipyard/src/main/scala/config/AbstractConfig.scala index 016d884377..77a998e699 100644 --- a/generators/chipyard/src/main/scala/config/AbstractConfig.scala +++ b/generators/chipyard/src/main/scala/config/AbstractConfig.scala @@ -120,6 +120,7 @@ class AbstractConfig extends Config( // Bus/interconnect settings new freechips.rocketchip.subsystem.WithCoherentBusTopology ++ /** hierarchical buses including sbus/mbus/pbus/fbus/cbus/l2 */ + new chipyard.config.WithSV48IfPossible ++ /** use sv48 if possible */ // ================================================ @@ -134,7 +135,7 @@ class AbstractConfig extends Config( new freechips.rocketchip.subsystem.WithDontDriveBusClocksFromSBus ++ /** leave the bus clocks undriven by sbus */ new freechips.rocketchip.subsystem.WithClockGateModel ++ /** add default EICG_wrapper clock gate model */ new chipyard.clocking.WithClockGroupsCombinedByName(("uncore", /** create a "uncore" clock group tieing all the bus clocks together */ - Seq("sbus", "mbus", "pbus", "fbus", "cbus", "obus", "implicit", "clock_tap"), + Seq("sbus", "mbus", "pbus", "fbus", "cbus", "obus", "implicit", "clock_tap"), Seq("tile"))) ++ new chipyard.config.WithPeripheryBusFrequency(500.0) ++ /** Default 500 MHz pbus */ diff --git a/generators/chipyard/src/main/scala/config/fragments/TileFragments.scala b/generators/chipyard/src/main/scala/config/fragments/TileFragments.scala index 97b87a5bbb..c9493e785f 100644 --- a/generators/chipyard/src/main/scala/config/fragments/TileFragments.scala +++ b/generators/chipyard/src/main/scala/config/fragments/TileFragments.scala @@ -5,7 +5,7 @@ import chisel3._ import org.chipsalliance.cde.config.{Field, Parameters, Config} import freechips.rocketchip.tile._ import freechips.rocketchip.subsystem._ -import freechips.rocketchip.rocket.{RocketCoreParams, MulDivParams, DCacheParams, ICacheParams} +import freechips.rocketchip.rocket.{RocketCoreParams, MulDivParams, DCacheParams, ICacheParams, PgLevels} import cva6.{CVA6TileAttachParams} import sodor.common.{SodorTileAttachParams} @@ -126,3 +126,8 @@ class WithRocketBoundaryBuffers(buffers: Option[RocketTileBoundaryBufferParams] )) } }) + +// Uses SV48 if possible, otherwise default to the Rocket Chip core default +class WithSV48IfPossible extends Config((site, here, up) => { + case PgLevels => if (site(XLen) == 64) 4 /* Sv48 */ else up(PgLevels) +})