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

Improvements to chipyard clocking #1489

Merged
merged 4 commits into from
Jun 1, 2023
Merged

Improvements to chipyard clocking #1489

merged 4 commits into from
Jun 1, 2023

Conversation

jerryz123
Copy link
Contributor

@jerryz123 jerryz123 commented May 29, 2023

Localizes all the clock devices to prci_ctrl_domain, and adds a xbar for all the clock control devices.
This should improve physical design of clock/reset devices, since it all is under a single module hierarchically with fewer IO

Fixes TLClockDivider behavior.
Previously, if the divisor register somehow misses the reset pulse, it would set the DividerOrPass to a bad state that could initialize the system to a very slow clock. This would never happen in a physical implementation.

However, in RTL simulations where the power-reset sequence is not totally simulated, only a negedge reset might be evaluated with no posedge reset. Since the AsyncResetRegs are sensitive to posedge reset or posedge clock, and the asyncReset may deassert before a clock arrives at the TLBus, that register might never be reset in simulation.

This fix overall makes the system more robust, it forces the DivideOrPass to output the undivided clock until the TL bus clock is alive, and the TL bus reset is deasserted, regardless of the value of the divisor register. The divisor register is now reset by the TL bus reset as well, which guarantees that it would be reset properly under any RTL simulation, as the TL bus reset should be deasserted after the TL bus clock is alive.

Fixes divisor synchronization
The divisor register is clocked to the TL bus clock, but it needs to be synchronized to the clock it is dividing (which may not be the same). The testchipip bump fixes this.

Explicitly use RawModules
Blocks which produce clocks/reset/sync-issues should not use implicit clock/reset, it is too confusing. The ClockDivideOrPass is now a RawModule.

Related PRs / Issues:

Type of change:

  • Bug fix
  • New feature
  • Other enhancement

Impact:

  • RTL change
  • Software change (RISC-V software)
  • Build system change
  • Other

Contributor Checklist:

  • Did you set main as the base branch?
  • Is this PR's title suitable for inclusion in the changelog and have you added a changelog:<topic> label?
  • Did you state the type-of-change/impact?
  • Did you delete any extraneous prints/debugging code?
  • Did you mark the PR with a changelog: label?
  • (If applicable) Did you update the conda .conda-lock.yml file if you updated the conda requirements file?
  • (If applicable) Did you add documentation for the feature?
  • (If applicable) Did you add a test demonstrating the PR?
  • (If applicable) Did you mark the PR as Please Backport?

Makes physical design simpler if clock/reset devices are all localized to one block
@jerryz123 jerryz123 merged commit 2aca0e2 into main Jun 1, 2023
@jerryz123 jerryz123 deleted the clkfixes branch June 1, 2023 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants