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

Enabling using Spike as a library #1953

Merged

Conversation

mslijepc
Copy link
Collaborator

@mslijepc mslijepc commented Apr 10, 2025

This PR should introduce API to enable some external simulator connect to Spike.

Steps:

  1. External simulator (e.g. wrapper of a simulator, or a bridge) has be derived from abstract_sim_if_t class and has to implement abstract functions do_load and do_store.
  2. cfg_t is now extended with std::optional<abstract_sim_if_t*> external_simulator field. This field should be filled with pointer to simulator object from Step 1.
  3. external_sim_device_t should be constructed with pointer from step 2, and create bus_t with fallback parameter of external_sim_device_t.

For all addresses which are not in Spike address space, bus will issue load/store requests to fallback branch, i.e. external simulator

@mslijepc mslijepc changed the title adding external simulator to Spike Enabling using Spike as a library Apr 10, 2025
@aswaterman aswaterman merged commit 3084a8e into riscv-software-src:master Apr 11, 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