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

[B ISA extension] add single-bit instructions (Zbs) support #259

Merged
merged 9 commits into from
Jan 26, 2022

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Jan 26, 2022

This PR adds another sub-extension to the recently ratified RISC-V bit-manipulation ISA extension "B":

  • Zbs - single-bit instructions

The NEORV32 CPU now supports three of the four B subsets (if the bit-manipulation is enabled by setting the CPU_EXTENSION_RISCV_B top generic true):

  • ✔️ Zbb - basic bit-manipulation instructions
  • ✔️ Zba - address-computation instructions
  • ✔️ Zbs - single-bit instructions
  • Zbc - carry-less multiplication instructions - not supported yet (but coming soon)

Since there is no upstream gcc support yet, Zbs intrinsics and emulation functions have been added to sw/example/bitmanip_test/neorv32_b_extension_intrinsics.h to verify correct operations. Furthermore, according test cases have been added to sw/example/bitmanip_test/main.c. The new testcases also check that instructions from the Zbc subset do raise an illegal instruction exception (as they are not supported yet).


🐛 This PR also fixes a minor bug in the CPU's co-processor arbitration logic: multi-cycle ALU operations (= CPU co-processor operations) that are triggered by an illegal instruction are allowed to complete execution even though there will be no data committed (for example no register file write-back). This is required to ensure that no co-processor operation is still in progress when the CPU enters trap state.

@stnolting stnolting added enhancement New feature or request risc-v compliance Modification to comply with official RISC-V specs. HW Hardware-related SW Software-related labels Jan 26, 2022
@stnolting stnolting self-assigned this Jan 26, 2022
@stnolting stnolting marked this pull request as ready for review January 26, 2022 05:56
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 risc-v compliance Modification to comply with official RISC-V specs. SW Software-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant