Repository navigation
Pitfall: clearing the 68080 data-cache enable bit does not turn the cache off - #58
Merged
Merged
Conversation
…ache off Measured on V4 UniCorn, Core 12856, with a pointer-chase hardware test (tools/v4/tests/dcache-enable-bit): CACR bit 31 reads back as written, but cached load latency stays at 3 cycles with it clear or set. Co-Authored-By: Claude Opus 5.5 <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.
What
A new pitfall,
core/pitfalls/cacr-data-cache-bit-ignored.md, and the hardware test behind it,tools/v4/tests/dcache-enable-bit.On Core 12856 (V4 UniCorn), CACR bit 31 (DE /
CACRF_EnableD) can be written and reads back ($00008000↔$80008000). Data-load latency doesn't change with it:CacheControl(0, CACRF_EnableD)CacheControl(CACRF_EnableD, CACRF_EnableD)That is 3 cycles per load for 64 KB against ~28.6 for 4 MB, so the test does see a miss. The data cache stays on whatever the bit says.
The file also records a trap in measuring this: a sequential sum gives the same time for 64 KB and 4 MB (prefetch), so it says nothing about the cache.
Found during
The ApolloOS R10 port: rxnet reports "DCache off" on R10 (no SetPatch on the test card), and we needed to know whether that mattered.
Knowledge base files relied on
core/cpu-68080/caches-and-memory.mdcore/pitfalls/self-modifying-code-and-caches.mdtools/v4/v4test.pyandtools/v4/tests/akbtest.hLocal checks:
check_frontmatter,check_linksandcheck_saga_addressespass, andv4test.py buildbuilds the test. It ran 5 times on the V4 with identical results.🤖 Generated with Claude Code