test(renode): FMC model — AHB3 bus-clock gate + fix a #55 test regression - #64
Merged
Conversation
…gression Extends the FMC SDRAM model's precondition checks and repairs a latent test breakage from the FMCEN work in #55. Model (STM32H7_FMC_SDRAM.cs): - Add the RCC_AHB3ENR.FMCEN (bit 12) *bus-clock* gate check — separate from the BCR1.FMCEN *controller* enable already modelled. If the FMC's AHB3 clock is gated, the SDCMR init commands make no progress and the window stays unusable. Opt-in via a settable `RccAhb3enrAddress` (default 0 = off), mirroring the QuadSPI model's NcsGpioModerAddress, so register-poke tests that don't model RCC are unaffected. The model now takes an injected IMachine to read RCC over the sysbus (QuadSPI pattern; registration unchanged). Tests (sdram_fmc.robot): - FIX a regression from #55: `Run FMC Init Sequence` never set BCR1.FMCEN, so once #55 added the controller-enable gate, every "…After Init" round-trip test was gated off and FAILING (masked because the Renode suite isn't in blocking CI). Enable the controller as part of the init sequence. - Give the ordering ("Skipping X Leaves SDRAM Gated") tests the controller too, so they're gated by the missing JEDEC step — what they claim to test — rather than trivially by a missing FMCEN. - Add a dedicated BCR1.FMCEN-gate test (#55's gate previously had none) and the AHB3 bus-clock gate pair (off → gated; on → usable). Whole suite green: 21/21. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the FMC SDRAM model's precondition checks and repairs a latent test breakage that #55's FMCEN work introduced.
Model (
STM32H7_FMC_SDRAM.cs)RCC_AHB3ENR.FMCEN(bit 12) bus-clock gate check — a separate enable from theBCR1.FMCENcontroller enable already modelled. If the FMC's AHB3 clock is gated, the SDCMR init commands make no progress and the window stays unusable. Opt-in via a settableRccAhb3enrAddress(default 0 = off), mirroring the QuadSPI model'sNcsGpioModerAddress, so register-poke tests that don't model RCC are unaffected. The model takes an injectedIMachineto read RCC over the sysbus (the QuadSPI pattern; registration unchanged).Tests (
sdram_fmc.robot)Run FMC Init Sequencenever setBCR1.FMCEN, so once fix(sdram): cold-init bring-up — FMC controller enable + PH5/SDNWE pin #55 added the controller-enable gate, every "…After Init" round-trip test was gated off and failing — masked because the Renode suite isn't in blocking CI. Now the init sequence enables the controller.Test
renode/sdram_fmc.robot— 21/21 pass (was failing 5 "After Init" tests on main before this).Note
sdram_init.robot(real firmware, stock RCC) is left as-is — the AHB3 check is validated here with the stub RCC (sticky RW) where the gate bit is fully controlled. Wiring it into the real-firmware path is a possible follow-up.🤖 Generated with Claude Code