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

Refactor instruction retire and stepper #755

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pmundkur
Copy link
Collaborator

This is a slightly cleaner implementation of the draft proposed in #746.
The change now affects 33 files instead of 47 files, hopefully making it easier to review.

I added @Timmmm, @jrtc27 and @Alasdair as co-authors to the main commit as it's based on their discussions and suggestions in #398, #412 and #746.

If merged, I plan to port #398 to this design.

The eventual goal here is to surface wait-states of the hart
(e.g. as caused by WFI and WRS.{NTO,STO}) into the stepper,
and handle debug triggers from execution for extensions such as
Sdtrig.

The refactor makes interrupt and exception handling more
symmetrical: both are now handled in the stepper.

This also removes the model-internal global instbits register
into a stepper-local variable, which fixes riscv#412.

This refactor is based on ideas discussed in riscv#398 and riscv#412.

Co-authored-by: Tim Hutt <timothy.hutt@codasip.com>
Co-authored-by: Jessica Clarke <jrtc27@jrtc27.com>
Co-authored-by: Alasdair Armstrong <alasdair.armstrong@cl.cam.ac.uk>
Copy link

github-actions bot commented Feb 25, 2025

Test Results

392 tests  ±0   392 ✅ ±0   1m 21s ⏱️ +2s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit a0d2393. ± Comparison against base commit 32587ca.

♻️ This comment has been updated with latest results.

@pmundkur pmundkur force-pushed the refactor_step_take2 branch from 5cc2c22 to 8508843 Compare February 27, 2025 12:03
The Wait state is exited on interrupts or if requested by the C
emulator.  The current implementation requests an immediate exit.
This adds an option to configure the maximum steps to remain in
the Wait state.

This is currently only used for WFI, but the basic mechanism can
be re-used for adding WRS.{STO, NTO} in the future.
@pmundkur pmundkur force-pushed the refactor_step_take2 branch from 8508843 to a0d2393 Compare February 27, 2025 12:10
@Timmmm Timmmm self-requested a review February 28, 2025 11:39
@pmundkur pmundkur requested a review from jrtc27 March 1, 2025 12:52
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.

1 participant