Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that HarnessClockInstantiator doesn't receive requests for similarly-named-clocks with different frequencies #1460

Merged
merged 1 commit into from
May 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions generators/chipyard/src/main/scala/HarnessClocks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ trait HarnessClockInstantiator {

// request a clock bundle at a particular frequency
def requestClockBundle(name: String, freqRequested: Double): ClockBundle = {
val clockBundle = Wire(new ClockBundle(ClockBundleParameters()))
_clockMap(name) = (freqRequested, clockBundle)
clockBundle
if (_clockMap.contains(name)) {
require(freqRequested == _clockMap(name)._1,
s"Request clock freq = $freqRequested != previously requested ${_clockMap(name)._2} for requested clock $name")
_clockMap(name)._2
} else {
val clockBundle = Wire(new ClockBundle(ClockBundleParameters()))
_clockMap(name) = (freqRequested, clockBundle)
clockBundle
}
}

// refClock is the clock generated by TestDriver that is
Expand Down
Loading