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

⚠️ remove CPU's A ISA extension (atomic memory access) #308

Merged
merged 11 commits into from
Apr 28, 2022

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Apr 26, 2022

This PR removes the RISC-V A ISA extension (atomic memory access) support of the NEORV32. Furthermore, this is a clean-up of the CPU's instruction and data bus interfaces.

Rationale

The NEORV32 A extensions only supports the load-reservate and store-conditional instruction (lr.w, sc.w). None of the atomic memory operations (AMO) are supported.

The load-reservate and store-conditional instructions are not required to implement lock-free mutexes and semaphores (the NEORV32 is a single-core setup without DMA). Furthermore, the "exclusive" memory access concept of the core is quite complex and sets high expectations regarding the memory system. Also see the discussion in #284.

However, atomic or exclusive memory accesses even for multi-core/DMA-system can still be implemented by the memory system via dedicated "reservation stations"

RTL Changes

Major

  • the CPU_EXTENSION_RISCV_A CPU and processor top generic is removed; it is also removed from all wrappers and testbenches
  • the Wishbone lock signal wb_lock_o is removed from the processor top entity and also from all wrappers and testbenches

Minor

  • the i_bus_lock_o and d_bus_lock_o output signals of the CPU top entity are removed
  • the i_bus_priv_o and d_bus_priv_o output signals of the CPU top entity are removed and are replaced by a new "global" priv_o output signal
  • the i_bus_wdata_o, i_bus_ben_o and i_bus_re_o output signals of the CPU top entity are removed (those signals were hardwired to zero)

@stnolting stnolting added risc-v compliance Modification to comply with official RISC-V specs. HW hardware-related labels Apr 26, 2022
@stnolting stnolting self-assigned this Apr 26, 2022
@stnolting stnolting changed the title ⚠️ remove CPU's A extension (atomic memory access) ⚠️ remove CPU's A ISA extension (atomic memory access) Apr 26, 2022
@stnolting stnolting marked this pull request as ready for review April 27, 2022 12:11
@stnolting stnolting merged commit 752b697 into main Apr 28, 2022
@stnolting stnolting deleted the remove_atomic_extension branch April 28, 2022 02:59
@NikLeberg
Copy link
Collaborator

Hi @stnolting,
pretty old pr, but I'm wondering what you meant by:

However, atomic or exclusive memory accesses even for multi-core/DMA-system can still be implemented by the memory system via dedicated "reservation stations"

Could you explain what you mean by that? Is there some more terminology such that google finds relevant content? 😀
Or do you mean things like the Peterson's algorithm?

@stnolting
Copy link
Owner Author

Hey Nik!

Actually, I was not thinking/talking about a specific algorithm... You can add any features to the memory system that you like. One option might be to implement atomic/locked/exclusive accesses via specific memory modules: Accessing memory location A (load or store) from core 1 could lock an entire memory region until the same core accesses memory location B. While locked, any access to this region from other cores simply fails.

Obviously, this would be a very platform-specific mechanism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HW hardware-related risc-v compliance Modification to comply with official RISC-V specs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants