From 6a26a350eee9d67032e6710d20ad59822bd51390 Mon Sep 17 00:00:00 2001 From: David Biancolin Date: Thu, 17 Sep 2020 11:33:26 -0700 Subject: [PATCH] [clocks] Update dealiaser based on feedback --- .../src/main/scala/clocking/ClockGroupDealiaser.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/generators/chipyard/src/main/scala/clocking/ClockGroupDealiaser.scala b/generators/chipyard/src/main/scala/clocking/ClockGroupDealiaser.scala index 3ffea3c0..54b384e9 100644 --- a/generators/chipyard/src/main/scala/clocking/ClockGroupDealiaser.scala +++ b/generators/chipyard/src/main/scala/clocking/ClockGroupDealiaser.scala @@ -9,7 +9,7 @@ import freechips.rocketchip.prci._ /** * Somewhat hacky. Since not all clocks in a clock group specify a taken frequency * current, this LazyModule attempts to dealias them, by finding a specified - * clock whose name has the longest matching prefix. + * clock with a matching name. * * Perhaps another, simpler solution would be to pass a default. * @@ -30,17 +30,16 @@ class ClockGroupDealiaser(name: String)(implicit p: Parameters) extends LazyModu val node = ClockGroupDealiaserNode() lazy val module = new LazyRawModuleImp(this) { - require(node.out.size == 1, "Must use a ClockGroupAggregator") + require(node.out.size == 1 && node.in.size == 1, + "ClockGroupDealiaser requires a single ClockGroup, please use a ClockGroupAggregator") val (outClocks, e @ ClockGroupEdgeParameters(_, outSinkParams, _, _)) = node.out.head val (inClocks, ClockGroupEdgeParameters(_, inSinkParams, _, _)) = node.in.head val inMap = inClocks.member.data.zip(inSinkParams.members).map({ case (b, p) => p.name -> b}).toMap for (((outBName, outB), outName) <- outClocks.member.elements.zip(outSinkParams.members.map(_.name))) { val inClock = inMap.getOrElse(outName, throw new Exception(""" - | No clock in input group with name: Option matching ${outName}. At least one clock + | No clock in input group with name option matching ${outName}. At least one clock | with the same must specify a frequency in its take parameter.""".stripMargin)) - // This will be removed. - dontTouch(outB) outB := inClock } }