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

Add SYSINFO flag to check if processor is being simulated #231

Merged
merged 4 commits into from
Dec 4, 2021

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Dec 3, 2021

This PR adds a new flag to the SYSINFO module to check if the processor is being simulated:
NEORV32_SYSINFO.SOC bit 13: SYSINFO_SOC_IS_SIM, set if processor is being simulated

The state of this flag cannot be guaranteed for all platforms as it depends on the toolchains 'pragma' support (works with GHDL, Intel Quartus, Lattice Radiant):

  -- Check if we're inside the Matrix -------------------------------------------------------
  -- -------------------------------------------------------------------------------------------
  constant is_simulation_c : boolean := false -- seems like we're on real hardware
-- pragma translate_off
-- synthesis translate_off
-- synthesis synthesis_off
-- RTL_SYNTHESIS OFF
  or true -- this MIGHT be a simulation
-- RTL_SYNTHESIS ON
-- synthesis synthesis_on
-- synthesis translate_on
-- pragma translate_on
  ;

@stnolting stnolting added enhancement New feature or request HW hardware-related labels Dec 3, 2021
@stnolting stnolting self-assigned this Dec 3, 2021
@stnolting stnolting marked this pull request as ready for review December 3, 2021 05:51
@stnolting stnolting changed the title Add is-simulation flag to SYSINFO Add SYSINFO flag to check if processor is being simulated Dec 3, 2021
@stnolting stnolting merged commit f8d8867 into master Dec 4, 2021
@stnolting stnolting deleted the add_sysinfo_sim_flag branch December 4, 2021 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HW hardware-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant