Fix spike-cosim causing problems for firesim
This commit is contained in:
@@ -32,15 +32,19 @@ class CospikeResources(
|
|||||||
addResource("/vsrc/cospike.v")
|
addResource("/vsrc/cospike.v")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case object SpikeCosimKey extends Field[Boolean](false)
|
||||||
|
|
||||||
trait CanHaveSpikeCosim { this: ChipyardSystem =>
|
trait CanHaveSpikeCosim { this: ChipyardSystem =>
|
||||||
InModuleBody {
|
if (p(SpikeCosimKey)) {
|
||||||
val isa = tiles.headOption.map(_.isaDTS).getOrElse("")
|
InModuleBody {
|
||||||
val mem0_base = p(ExtMem).map(_.master.base).getOrElse(BigInt(0))
|
val isa = tiles.headOption.map(_.isaDTS).getOrElse("")
|
||||||
val mem0_size = p(ExtMem).map(_.master.size).getOrElse(BigInt(0))
|
val mem0_base = p(ExtMem).map(_.master.base).getOrElse(BigInt(0))
|
||||||
val pmpregions = tiles.headOption.map(_.tileParams.core.nPMPs).getOrElse(0)
|
val mem0_size = p(ExtMem).map(_.master.size).getOrElse(BigInt(0))
|
||||||
val nharts = tiles.size
|
val pmpregions = tiles.headOption.map(_.tileParams.core.nPMPs).getOrElse(0)
|
||||||
val bootrom = bootROM.map(_.module.contents.toArray.mkString(" ")).getOrElse("")
|
val nharts = tiles.size
|
||||||
val resources = Module(new CospikeResources(isa, pmpregions, mem0_base, mem0_size, nharts, bootrom))
|
val bootrom = bootROM.map(_.module.contents.toArray.mkString(" ")).getOrElse("")
|
||||||
|
val resources = Module(new CospikeResources(isa, pmpregions, mem0_base, mem0_size, nharts, bootrom))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ class DromajoBoomConfig extends Config(
|
|||||||
|
|
||||||
class MediumBoomCosimConfig extends Config(
|
class MediumBoomCosimConfig extends Config(
|
||||||
new chipyard.harness.WithCospikeBridge ++ // attach spike-cosim
|
new chipyard.harness.WithCospikeBridge ++ // attach spike-cosim
|
||||||
|
new chipyard.config.EnableSpikeCosim ++ // enable co-sim
|
||||||
new chipyard.config.WithTraceIO ++ // enable the traceio
|
new chipyard.config.WithTraceIO ++ // enable the traceio
|
||||||
new boom.common.WithNMediumBooms(1) ++
|
new boom.common.WithNMediumBooms(1) ++
|
||||||
new chipyard.config.AbstractConfig)
|
new chipyard.config.AbstractConfig)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import freechips.rocketchip.rocket.{RocketCoreParams, MulDivParams, DCacheParams
|
|||||||
|
|
||||||
import boom.common.{BoomTileAttachParams}
|
import boom.common.{BoomTileAttachParams}
|
||||||
import cva6.{CVA6TileAttachParams}
|
import cva6.{CVA6TileAttachParams}
|
||||||
|
import chipyard.{SpikeCosimKey}
|
||||||
import testchipip._
|
import testchipip._
|
||||||
|
|
||||||
class WithL2TLBs(entries: Int) extends Config((site, here, up) => {
|
class WithL2TLBs(entries: Int) extends Config((site, here, up) => {
|
||||||
@@ -79,3 +79,7 @@ class WithRocketDCacheScratchpad extends Config((site, here, up) => {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
class EnableSpikeCosim extends Config((site, here, up) => {
|
||||||
|
case SpikeCosimKey => true
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user