Skip to content

Commit

Permalink
Merge pull request #2610 from chipsalliance/clockdivider-fix
Browse files Browse the repository at this point in the history
bug fix for ClockDivider
  • Loading branch information
sequencer authored Aug 24, 2020
2 parents 6f0cf54 + d06c9ee commit d6a5dc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/prci/ClockDivider.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import freechips.rocketchip.util.{ClockDivider3, Pow2ClockDivider}
*/
class ClockDivider(div: Int)(implicit p: Parameters) extends LazyModule {
val node = ClockAdapterNode(
sourceFn = { case src => src.copy(give = src.give.map(x => x.copy(freqMHz = x.freqMHz / 2))) },
sinkFn = { case snk => snk.copy(take = snk.take.map(x => x.copy(freqMHz = x.freqMHz * 2))) })
sourceFn = { case src => src.copy(give = src.give.map(x => x.copy(freqMHz = x.freqMHz / div))) },
sinkFn = { case snk => snk.copy(take = snk.take.map(x => x.copy(freqMHz = x.freqMHz * div))) })

lazy val module = new LazyModuleImp(this) {
(node.in zip node.out).foreach { case ((in, _), (out, _)) =>
Expand Down

0 comments on commit d6a5dc3

Please sign in to comment.