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 macro & inline for get/set CSR #191

Merged
merged 5 commits into from
Oct 7, 2019
Merged

Add macro & inline for get/set CSR #191

merged 5 commits into from
Oct 7, 2019

Conversation

bsousi5
Copy link
Collaborator

@bsousi5 bsousi5 commented Oct 4, 2019

This PR will add two types of APIs, an inline function and a macro for get and set CSR registers.
The inline function is not fully fill yet, but will get fill up with all supported CSR listed in https://github.com/riscv/riscv-opcodes. Its purpose is to provide some prior check before calling.
The macro is intended to be a raw form of CSR set/get.

@bsousi5 bsousi5 added the NEW API Adds public API surface label Oct 4, 2019
@kito-cheng
Copy link
Member

kito-cheng commented Oct 4, 2019

This API will increasing 322 bytes on rv32ic or rv64ic with -Os for csr.c, and might be bigger once we fill up all supported CSR.

Just reminder the code size cost is high and might hard to optimize/reduce that in future.

@nategraff-sifive
Copy link
Contributor

Maybe the switch-case version should be removed from the API for code size in favor of just the macro.

@bsousi5 bsousi5 merged commit 55b9f2b into master Oct 7, 2019
@bsousi5 bsousi5 deleted the esat-25 branch October 7, 2019 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NEW API Adds public API surface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants