| // Copyright 2023 Google LLC | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // https://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| // See the License for the specific language governing permissions and | |
| // limitations under the License. | |
| slot riscv32i_base { | |
| default size = 4; | |
| opcodes { | |
| addi{: rs1, I_imm12 : rd}; | |
| slti{: rs1, I_imm12 : rd}; | |
| sltiu{: rs1, I_imm12 : rd}; | |
| andi{: rs1, I_imm12 : rd}; | |
| ori{: rs1, I_imm12 : rd}; | |
| xori{: rs1, I_imm12 : rd}; | |
| slli{: rs1, I_uimm5 : rd}; | |
| srli{: rs1, I_uimm5 : rd}; | |
| srai{: rs1, I_uimm5 : rd}; | |
| lui{: U_imm20 : rd}; | |
| auipc{: U_imm20 : rd}; | |
| add{: rs1, rs2 : rd}; | |
| slt{: rs1, rs2 : rd}; | |
| sltu{: rs1, rs2 : rd}; | |
| and{: rs1, rs2 : rd}; | |
| or{: rs1, rs2 : rd}; | |
| xor{: rs1, rs2 : rd}; | |
| sll{: rs1, rs2 : rd}; | |
| srl{: rs1, rs2 : rd}; | |
| sub{: rs1, rs2 : rd}; | |
| sra{: rs1, rs2 : rd}; | |
| nop{}; | |
| hint{}; | |
| jal{: J_imm20 : next_pc, rd}; | |
| jalr{: rs1, J_imm12 : next_pc, rd}; | |
| j{: J_imm20 : next_pc, rd}; | |
| jr{: rs1, J_imm12 : next_pc, rd}; | |
| beq{: rs1, rs2, B_imm12 : next_pc}; | |
| bne{: rs1, rs2, B_imm12 : next_pc}; | |
| blt{: rs1, rs2, B_imm12 : next_pc}; | |
| bltu{: rs1, rs2, B_imm12 : next_pc}; | |
| bge{: rs1, rs2, B_imm12 : next_pc}; | |
| bgeu{: rs1, rs2, B_imm12 : next_pc}; | |
| lw{(: rs1, I_imm12), (: : rd)}; | |
| lh{(: rs1, I_imm12 :), (: : rd)}; | |
| lhu{(: rs1, I_imm12 :), (: : rd)}; | |
| lb{(: rs1, I_imm12 :), (: : rd)}; | |
| lbu{(: rs1, I_imm12 :), (: : rd)}; | |
| sw{: rs1, S_imm12, rs2 : }; | |
| sh{: rs1, S_imm12, rs2 : }; | |
| sb{: rs1, S_imm12, rs2 : }; | |
| fence{: I_imm12 : }; | |
| ecall{}; | |
| ebreak{}; | |
| } | |
| } |