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

Support for Multiple Reset Schemes (for some parts of the codebase) #2375

Merged
merged 30 commits into from
Apr 3, 2020

Conversation

mwachs5
Copy link
Contributor

@mwachs5 mwachs5 commented Mar 28, 2020

Currently this PR includes parts of #2205, which I would like to be merged first and then I will rebase this on top of that (note, this has been done). This PR will be rebased often before merging if necessary and commit history will be cleaned up. (this has also been done)

This PR includes/replaces #2237 and #2217

Related issue:

Type of change: feature request

Impact: API modification

Development Phase: implementation

Release Notes

Adds support for multiple reset schemes for much of the code base (some parts of the code base would still need to be converted to chisel3 or use the DefaultCompileOptions.NonStrictInferReset capability to infer resets, as previously this code base only allowed Bool resets. Notably, async reset of the Rocket Core/Tile is not supported.

Important changes to note:
Adds parameterization scheme for reset types (SubsystemResetSchemeKey)
Adds LazyModule withClock, withClockAndReset, withReset
Changes significantly the exported I/Os for debug related logic
Removes internal synchronization logic for debug reset-- this must be done externally now

More detailed release notes from #2237:

This PR converts the debug module to the new Configurable Reset Scheme using chisel3 abstract reset.

  • There is now a 1:1 relationship required between resets and clocks (except for rational crossing clock/reset pairs). dmOuter uses dmi_clock and dmi_reset and dmInner uses new inputs debug_clock and debug_reset. A portion of SBA is in the TileLink clock / reset domain.
    debug_clock must be synchronous to clock. The clock gate formerly in dmInnerAsync now resides outside the debug module in customer logic. User logic can call connectDebugClockAndReset to achieve the same functionality as before, in a different level of the hierarchy.
  • A new input dmactiveAck is returned from customer logic and is used to indicate when dmInner is able to accept DMI transactions (i.e. debug_clock is running and debug_reset is negated). When dmactiveAck is negated, a bus blocker returns denied for transactions to dmInner. The current version of OpenOCD is tolerant of this blocker, but other software may need to be updated.
  • dmi_reset must be asynchronous. debug_reset may be either synchronous or asynchronous but its deassertion must always occur either when debug_clock is stopped or synchronously to debug_clock.
  • The APB and JTAG interface conforms to the above and now require reset synchronization.
  • hart-reset and halt-on-reset functions have been changed to simple I/O and require customer logic involvement. The two signals are grouped in a new ResetCtrlIO bundle. hartIsInReset is a logical equivalent of core_reset and is synchronous to core_clock. For debug module halt-on-reset function, this signal must remain asserted for at least 4 debug_clock cycles for the DM to assert debug interrupt plus 3 core_clock cycles for the debug interrupt to reach the core prior to the core_reset signal being deasserted. Halt-on-reset will not work if either clock or core_clock is not running.
  • The clock and reset signals formerly in TracedInstruction have been removed since a trace module attached would not be allowed to use them because of the 1:1 rule.

Copy link
Contributor

@ernie-sifive ernie-sifive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@mwachs5 mwachs5 force-pushed the multiple-reset-schemes-rebased branch from 13a73f7 to fd171ba Compare March 28, 2020 21:45
@mwachs5
Copy link
Contributor Author

mwachs5 commented Mar 29, 2020

This is failing because fesvr writes dmactive =1, then immediately tries to do another operation and gets an error response. This is due to the synchronization on dmActiveAck which adds a delay before the blocker is released. Another rocket-tools bump to fesvr 😭 ? or other ideas @ernie-sifive ?

@mwachs5
Copy link
Contributor Author

mwachs5 commented Mar 29, 2020

@ernie-sifive I filed FESVR issue (riscv-software-src/riscv-isa-sim#435) and added a workaround. But I am confused why the dmactiveAck needs to be synchronized in the testbench anyway. Isn't it already synchronized here:

https://github.com/chipsalliance/rocket-chip/pull/2375/files#diff-579e415dc2dfe635c9d572021aeeccf8R657

@ernie-sifive
Copy link
Contributor

ernie-sifive commented Mar 29, 2020

@mwachs5 dmactive is generated in dmi_clock domain, get synced to clock in the testbench (where dmactiveAck is used to control the clock gate), then dmactiveAck returns to dmOuter where it is synced back to dmi_clock. If you remove the sync to clock then won't the clock gate misbehave? Ah, I see this workaround is only for simulation...

@@ -198,7 +199,7 @@ class LazyRawModuleImp(val wrapper: LazyModule) extends RawModule with LazyModul
// It is recommended to drive these even if you manually shove most of your children
// Otherwise, anonymous children (Monitors for example) will not be clocked
val childClock = Wire(Clock())
val childReset = Wire(Bool())
val childReset = Wire(Reset())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @hcook

@mwachs5
Copy link
Contributor Author

mwachs5 commented Mar 30, 2020

Am going to do a cleanup rebase now

@mwachs5 mwachs5 force-pushed the multiple-reset-schemes-rebased branch 2 times, most recently from c27108b to 773d4fb Compare April 2, 2020 00:23
mwachs5 and others added 21 commits April 2, 2020 11:40
…th no clock edges to avoid violating tile link protocol. Also use chiselName to give predictable naming within withClockAndReset blocks
Arbiter: fix parenthesis

Arbiter more typo fixes

arbiter. srsly don't try  to write actual code throug github  GUI interface
bumping to have proper fesvr handling
@mwachs5 mwachs5 force-pushed the multiple-reset-schemes-rebased branch from 773d4fb to 7f31ae4 Compare April 2, 2020 18:40
@mwachs5
Copy link
Contributor Author

mwachs5 commented Apr 3, 2020

closing to reopen because travis seems borked

@mwachs5 mwachs5 closed this Apr 3, 2020
@mwachs5 mwachs5 reopened this Apr 3, 2020
@mwachs5 mwachs5 merged commit 3933197 into master Apr 3, 2020
@jackkoenig jackkoenig deleted the multiple-reset-schemes-rebased branch May 26, 2020 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants