1
0

scratchpad: remove dependency on HasCoreParameters

This commit is contained in:
Henry Cook 2017-08-31 19:07:08 -07:00
parent e46aeb7342
commit 3133c321b7

View File

@ -12,8 +12,7 @@ import freechips.rocketchip.tile._
import freechips.rocketchip.tilelink._ import freechips.rocketchip.tilelink._
import freechips.rocketchip.util._ import freechips.rocketchip.util._
class ScratchpadSlavePort(address: AddressSet)(implicit p: Parameters) extends LazyModule class ScratchpadSlavePort(address: AddressSet, coreDataBytes: Int, usingAtomics: Boolean)(implicit p: Parameters) extends LazyModule {
with HasCoreParameters {
val device = new SimpleDevice("dtim", Seq("sifive,dtim0")) val device = new SimpleDevice("dtim", Seq("sifive,dtim0"))
val node = TLManagerNode(Seq(TLManagerPortParameters( val node = TLManagerNode(Seq(TLManagerPortParameters(
Seq(TLManagerParameters( Seq(TLManagerParameters(
@ -110,7 +109,7 @@ trait CanHaveScratchpad extends HasHellaCache with HasICacheFrontend {
val fg = LazyModule(new TLFragmenter(fetchBytes, cacheBlockBytes, earlyAck=true)) val fg = LazyModule(new TLFragmenter(fetchBytes, cacheBlockBytes, earlyAck=true))
val ww = LazyModule(new TLWidthWidget(xLenBytes)) val ww = LazyModule(new TLWidthWidget(xLenBytes))
val scratch = tileParams.dcache.flatMap(d => d.scratch.map(s => val scratch = tileParams.dcache.flatMap(d => d.scratch.map(s =>
LazyModule(new ScratchpadSlavePort(AddressSet(s, d.dataScratchpadBytes-1))))) LazyModule(new ScratchpadSlavePort(AddressSet(s, d.dataScratchpadBytes-1), xLenBytes, tileParams.core.useAtomics))))
DisableMonitors { implicit p => DisableMonitors { implicit p =>
frontend.slaveNode :*= fg.node frontend.slaveNode :*= fg.node