Function definitions for RISCV driver.
Macros | |
| #define | csr_swap(csr, val) |
| This function is used to swap the value of a CSR with a specified value. | |
| #define | csr_read(csr) |
| This function is used to read the value of a CSR. | |
| #define | csr_write(csr, val) |
| This function is used to write a value to a CSR. | |
| #define | csr_read_set(csr, val) |
| This function is used to read and set a CSR with a specified value. | |
| #define | csr_set(csr, val) |
| This function is used to set a CSR to a specified value. | |
| #define | csr_read_clear(csr, val) |
| This function is used for performing a read-clear operation on the specified CSR. | |
| #define | csr_clear(csr, val) |
| This function is used to clear a CSR. | |
| #define | opcode_R(opcode, func3, func7, rs1, rs2) |
| Macor for generating the opcode of an R-type instruction. | |
| #define | cfu_type_R(func3, func7, rs1, rs2) |
| Macros for defining custom R-type instructions with specific opcodes and function fields. | |
| #define | cfu_push(func3, func7, rs1, rs2) |
| Macros for defining cfu_push and cfu_pop instructions using the CUSTOM1 opcode. | |
| #define | cfu_pop2() |
| #define | cfu_pop() |
| #define cfu_pop | ( | ) |
| #define cfu_pop2 | ( | ) |
| #define cfu_push | ( | func3, | |
| func7, | |||
| rs1, | |||
| rs2 ) |
#include <riscv.h>
Macros for defining cfu_push and cfu_pop instructions using the CUSTOM1 opcode.
| func3 | The 3-bit function field for the cfu_push instruction. |
| func7 | The 7-bit function field for the cfu_push instruction. |
| rs1 | The source register 1 for the cfu_push instruction. |
| rs2 | The source register 2 for the cfu_push instruction. |
| #define cfu_type_R | ( | func3, | |
| func7, | |||
| rs1, | |||
| rs2 ) |
#include <riscv.h>
Macros for defining custom R-type instructions with specific opcodes and function fields.
| func3 | The 3-bit function field for the custom instruction. |
| func7 | The 7-bit function field for the custom instruction. |
| rs1 | The source register 1 for the custom instruction. |
| rs2 | The source register 2 for the custom instruction. |
| #define csr_clear | ( | csr, | |
| val ) |
#include <riscv.h>
This function is used to clear a CSR.
| csr | The name of the CSR to be cleared. |
| val | The value to be used for the operation (unused in clearing). |
| #define csr_read | ( | csr | ) |
#include <riscv.h>
This function is used to read the value of a CSR.
| csr | The name of the CSR to be read. |
| #define csr_read_clear | ( | csr, | |
| val ) |
#include <riscv.h>
This function is used for performing a read-clear operation on the specified CSR.
| csr | The Control and Status Register (CSR) to read-clear. |
| val | The value to use for the operation. |
| #define csr_read_set | ( | csr, | |
| val ) |
#include <riscv.h>
This function is used to read and set a CSR with a specified value.
| csr | The name of the CSR to be read and set. |
| val | The value to be ORed with the current value of the CSR. |
| #define csr_set | ( | csr, | |
| val ) |
#include <riscv.h>
This function is used to set a CSR to a specified value.
| csr | The name of the CSR to be set. |
| val | The value to be set for the CSR. |
| #define csr_swap | ( | csr, | |
| val ) |
#include <riscv.h>
This function is used to swap the value of a CSR with a specified value.
| csr | The name of the CSR to be swapped. |
| val | The value to be swapped with the CSR. |
| #define csr_write | ( | csr, | |
| val ) |
#include <riscv.h>
This function is used to write a value to a CSR.
| csr | The name of the CSR to which the value will be written. |
| val | The value to be written to the CSR. |
| #define opcode_R | ( | opcode, | |
| func3, | |||
| func7, | |||
| rs1, | |||
| rs2 ) |
#include <riscv.h>
Macor for generating the opcode of an R-type instruction.
| opcode | The base opcode value for the instruction. |
| func3 | The 3-bit function field. |
| func7 | The 7-bit function field. |
| rs1 | Register number for source register 1. |
| rs2 | Register number for source register 2. |