7

I have downloaded the latest...

RISC-V Instruction Set Manual, Volume 1: User-Level ISA

...which is interesting but it never actually gives values for the opcodes/funct3 and other instruction formats. For example, the LOAD/STORE/BRANCH opcodes are listed by name but it does not provide the actual bit values they represent.

Where are all the codes actual listed?

Phil Wright
  • 22,580
  • 14
  • 83
  • 137
  • It's actually really irritating. I still don't understand why they didn't just put the value beside the name and be done with it. Not like it's ever going to change. – gonzo Oct 19 '19 at 06:54

2 Answers2

7

They are also already conveniently encoded in the source code of the sodor project:

https://github.com/ucb-bar/riscv-sodor

for constants that capture the bit patterns in various useful ways, see:

src/common/instructions.scala

or, directly from the browser:

https://github.com/ucb-bar/riscv-sodor/blob/master/src/main/scala/common/instructions.scala

Zbynek Vyskovsky - kvr000
  • 18,186
  • 3
  • 35
  • 43
seanhalle
  • 973
  • 7
  • 27
3

https://riscv.org/specifications/

Table 9.1 and all of Chapter 9.

Chris
  • 3,827
  • 22
  • 30
  • 6
    I think you mean Chapter 19. 9 is the double precision floats. – David C. Bishop Aug 20 '17 at 13:25
  • 1
    Looks like it keeps moving around. In the riscV-spec.pdf "Document Version 20191214-draft" I believe it's now Chapter 26 "RV32/64G Instruction Set Listings" – James May 09 '22 at 23:09