Fix firesim clockgen to auto-generated the reference pll clock if not requested
This commit is contained in:
@@ -38,16 +38,22 @@ class FireSimClockBridgeInstantiator extends HarnessClockInstantiator {
|
|||||||
|
|
||||||
var instantiatedClocks = LinkedHashMap[Int, (Clock, Seq[String])]()
|
var instantiatedClocks = LinkedHashMap[Int, (Clock, Seq[String])]()
|
||||||
// connect wires to clock source
|
// connect wires to clock source
|
||||||
for ((name, (freq, clock)) <- clockMap) {
|
def findOrInstantiate(freqMHz: Int, name: String): Clock = {
|
||||||
val freqMHz = (freq / (1000 * 1000)).toInt
|
|
||||||
if (!instantiatedClocks.contains(freqMHz)) {
|
if (!instantiatedClocks.contains(freqMHz)) {
|
||||||
val clock = Wire(Clock())
|
val clock = Wire(Clock())
|
||||||
instantiatedClocks(freqMHz) = (clock, Seq(name))
|
instantiatedClocks(freqMHz) = (clock, Seq(name))
|
||||||
} else {
|
} else {
|
||||||
instantiatedClocks(freqMHz) = (instantiatedClocks(freqMHz)._1, instantiatedClocks(freqMHz)._2 :+ name)
|
instantiatedClocks(freqMHz) = (instantiatedClocks(freqMHz)._1, instantiatedClocks(freqMHz)._2 :+ name)
|
||||||
}
|
}
|
||||||
clock := instantiatedClocks(freqMHz)._1
|
instantiatedClocks(freqMHz)._1
|
||||||
}
|
}
|
||||||
|
for ((name, (freq, clock)) <- clockMap) {
|
||||||
|
val freqMHz = (freq / (1000 * 1000)).toInt
|
||||||
|
clock := findOrInstantiate(freqMHz, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The undivided reference clock as calculated by pllConfig must be instantiated
|
||||||
|
findOrInstantiate(pllConfig.referenceFreqMHz.toInt, "reference")
|
||||||
|
|
||||||
val ratClocks = instantiatedClocks.map { case (freqMHz, (clock, names)) =>
|
val ratClocks = instantiatedClocks.map { case (freqMHz, (clock, names)) =>
|
||||||
(RationalClock(names.mkString(","), 1, pllConfig.referenceFreqMHz.toInt / freqMHz), clock)
|
(RationalClock(names.mkString(","), 1, pllConfig.referenceFreqMHz.toInt / freqMHz), clock)
|
||||||
|
|||||||
@@ -103,11 +103,15 @@ class WithFireSimDesignTweaks extends Config(
|
|||||||
|
|
||||||
// Tweaks to modify target clock frequencies / crossings to legacy firesim defaults
|
// Tweaks to modify target clock frequencies / crossings to legacy firesim defaults
|
||||||
class WithFireSimHighPerfClocking extends Config(
|
class WithFireSimHighPerfClocking extends Config(
|
||||||
|
// Create clock group for uncore that does not include mbus
|
||||||
|
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore", Seq("sbus", "pbus", "fbus", "cbus", "implicit"), Nil)) ++
|
||||||
// Optional: This sets the default frequency for all buses in the system to 3.2 GHz
|
// Optional: This sets the default frequency for all buses in the system to 3.2 GHz
|
||||||
// (since unspecified bus frequencies will use the pbus frequency)
|
// (since unspecified bus frequencies will use the pbus frequency)
|
||||||
// This frequency selection matches FireSim's legacy selection and is required
|
// This frequency selection matches FireSim's legacy selection and is required
|
||||||
// to support 200Gb NIC performance. You may select a smaller value.
|
// to support 200Gb NIC performance. You may select a smaller value.
|
||||||
new chipyard.config.WithPeripheryBusFrequency(3200.0) ++
|
new chipyard.config.WithPeripheryBusFrequency(3200.0) ++
|
||||||
|
new chipyard.config.WithSystemBusFrequency(3200.0) ++
|
||||||
|
new chipyard.config.WithFrontBusFrequency(3200.0) ++
|
||||||
// Optional: These three configs put the DRAM memory system in it's own clock domain.
|
// Optional: These three configs put the DRAM memory system in it's own clock domain.
|
||||||
// Removing the first config will result in the FASED timing model running
|
// Removing the first config will result in the FASED timing model running
|
||||||
// at the pbus freq (above, 3.2 GHz), which is outside the range of valid DDR3 speedgrades.
|
// at the pbus freq (above, 3.2 GHz), which is outside the range of valid DDR3 speedgrades.
|
||||||
|
|||||||
Reference in New Issue
Block a user