This core was designed as a project in Processor Architecure lecture taught at UPC under Prof. Roger Espasa.
The Core currently supports:
- 6 Stage Pipeline
- Directed Mapped Parametrizable Instruction and Data Caches
- Common Memory
- Multi level Virtual Memory Support
- itlb and dtlb (Custom itlb write, dtlb write instructions to update tlbs)
- Software Page Walking
- Unified Trap Handler Code
- Supervisor mode (With Minimum CSR support for Virtual Memory Support)
- Store Buffer
- Registar Aliases Table (Used for ROB forwarding)
- Reorder buffer
- 2 bit bimodal Branch Predictor
- RISCOF framework integrated to support riscv-arch-suite
- cocotb based testbenches for basic tests
The virtual memory support is very basic, The core doesn't have a MMU, hence pagewalking and itlb updates are done by the OS code with the new priviledged itlb write and dtlb write insturctions.
The Virtual to Physicall Address mapping is done like: PA = VA + 0x41000 it can be observed from the image below why 0x41000 was chosen.
Page Tables reserved addresses from 0x5000 - 0x405FFF which is roughly equal to 4MB.
SATP Register is initalized to point to L1 Page table (0x5000)
This 2 instructions takes 2 operands, one operand has the virtual address and the other one has the mapping.
NOTE: since the Virtual address is already present in CSR STVAL this instruction can be modified to use implicit register for virtual address and explicit register that contains the mapping!.

