-
Notifications
You must be signed in to change notification settings - Fork 267
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
Implement selectable big-endian, little-endian and bi-endian configurations #54
base: master
Are you sure you want to change the base?
Conversation
Swap comments for the inputs exu2csr_r_req_i and exu2csr_rw_addr_i of module scr1_pipe_csr.
Hi @gambaman, Thank you for your note about incorrect comment. And if you do not mind, I'm closing your pull request. Many thanks, |
Thank you very much for your reply, Alexander. I would like to make some contributions to the SCR1 core. Do you have any convention for coding style, code comments and/or commit messages? Best regards
|
@gambaman, we do not have strict requirements for code style. Please use existing files as reference. Best regards, |
Sure. According to the instruction set manual V20211, in mono-endian implementations of RV32I, mstatush.MBE is read-only. Its value should be 0 if the implementation is little-endian. However, it looks that the mstatush CSR is not implemented in SCR1. I was going to fix that. Also, I was going to add support for big-endian and bi-endian. When bi-endian implementation is selected, mstatush.MBE will be read-write in concordance with the ISA manual. I hope it will suit you. |
Hello, Alexander. The mandatory RV32-only CSR mstatush has been implemented. Not a big contribution since only little-endian is supported for now, but it had to be done. I was going to update the documentation accordingly, but it looks the doc source is not in the repository. |
Hi, In order to implement multi-endian I have written some utility modules. In which directory do you prefer me to store them? Maybe in src/core/primitives? P.D. I cannot send e-mails to [email protected] because it is a restricted group. |
Augment interfaces between CSRF, EXU and LSU for multiendian
…nfigurations Now the data endianness can be selected in concordance with ISA V20211. The default configuration is bi-endian so mstatush.MBE is writtable. Single endian can be selected by editing scr1_arch_description.svh. The following line can be uncommented to select little-endian only: //`define SCR1_IMMUTABLE_ENDIANNES LITTLE_ENDIAN The following line can be uncommented to select big-endian only: //`define SCR1_IMMUTABLE_ENDIANNES BIG_ENDIAN
Hello, Alexander. Selectable big-endian, little-endian and bi-endian configurations have been implemented. The following line must be uncommented to force a little-endian only implementation: The following line must be uncommented to force a big-endian only implementation: Again, the source code of the documentation is not available so I could not update it. |
Hi @gambaman, Many thanks for update. Let me check it internally and back to you. Best regards, |
Hello, Alexander. I'm not sure if you received my answer. Just in case, gcc can generate big-endian code for RV32 if you use the option -mbig-endian. |
Hi @gambaman, I did some checks of changes. Default and little-endian are working fine, but it is hard to say about big-endian because I cannot build and run test suite.
Best regards, |
Hello, Alexander. I don't know how to modify the test suit to expect a big-endian only implementation. I did test the big-endian behavior in a bi-endian implementation by setting mstatush.MBE bit just before every big-endian test access and clearing it right after. I did not found any error. However, today I have carried out more test and it looks that the SH instructions is not always working properly when mstatush.MBE=1. I will tell you as soon as I found the error.
Only the one in the src1 folder in order to carry out my own test.
I installed it from source following the instructions in page 10 of your user manual: https://github.com/riscv/riscv-gnu-toolchain Best regars |
Hello Alexander, again, what I thought was a fail turned out to be a compiler issue. It looks the biendian implementation was working after all. I have pushed a sample program to test it. You can run with this command:
It will test every load/store instruction using big-endian as well as little-endian byte order. Best regards |
Swap comments for the inputs exu2csr_r_req_i and exu2csr_rw_addr_i of module scr1_pipe_csr.