Skip to content

feat: move cache block size initialization to constructor #1993

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

Merged
merged 1 commit into from
May 16, 2025

Conversation

arrv-sc
Copy link
Contributor

@arrv-sc arrv-sc commented May 15, 2025

Previously cache block size had to be initialized via special set_chache_blocksz setter function and was uninitialized if you didn't call it. This caused us some issues when we forgot to call a setter function and everything worked fine until first Zicbom instruction where spike went into an infinite loop (on uninitialized value). This commit was made as a measure to prevent similar issues in the future. In this commit I move initialization of the block size to the mmu_t's constructor. The value of this member goes through cfg_t struct. This way the value will always be initialized without loosing ability to be reset via mentioned setter function if one needs to do so.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

Shouldn't we get rid of the set_cache_blocksz method?

Previously cache block size had to be initialized via special
set_chache_blocksz setter function and was uninitialized if you didn't
call it. In this commit I move initialization of the block size to the
mmu_t's constructor. The configuration of this member goes through cfg_t
struct.
@arrv-sc arrv-sc force-pushed the arrv-sc/init-blocksz branch from 1b0b498 to b346571 Compare May 16, 2025 06:29
@arrv-sc
Copy link
Contributor Author

arrv-sc commented May 16, 2025

I agree. Removed set_cache_blocksz method

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

@aswaterman aswaterman merged commit 14cad99 into riscv-software-src:master May 16, 2025
3 checks passed
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.

2 participants