A RISC-V SystemC-TLM simulator
CARRV 2020 Màrius Montón
A RISC-V SystemC-TLM simulator CARRV 2020 Mrius Montn Outline - - PowerPoint PPT Presentation
A RISC-V SystemC-TLM simulator CARRV 2020 Mrius Montn Outline Introduction Simulator Tests Conclusions Motivation Motivation Develop a simple simulator based on a RISC-V CPU As a embedded processor Small
CARRV 2020 Màrius Montón
Develop a simple simulator based on a RISC-V CPU
○ Small CPU ○ Simple memory scheme
○ Out-of-the-box binary from gcc ○ Easy tools ○ No semi-hosting facilities
○ Attach new peripherals ○ Add new RISC-V extensions ○ Modify CPU architecture
SystemC as language
TLM-2 as modeling
TLM Transactions & sockets
○ Details not important ○ Information about time and address/data
○ Initiator/Target <--> Master/Slave ○ Interchangeable
Instruction set simulator
○ Extensions
○ x0-x31 ○ PC ○ CSR
○ Data / Instr. Bus
Bus controller
○ To memory ○ Peripherals ■ Trace ■ Timer ■ …
Peripherals
○ Exe file pre-loaded
debug/console
Simulation helper
○ Log file ○ Operands and result
○ Memory accesses ○ Registers accesses ○ Instructions executed
Simulation helper
○ Log file ○ Operands and result
○ Memory accesses ○ Registers accesses ○ Instructions executed
Simulation helper
○ Log file ○ Operands and result
○ Memory accesses ○ Registers accesses ○ Instructions executed
Pure bare-metal simulator
○ ECALL Stops simulation ○ EBREAK Raise Breakpoint exception
Docker version
Pure bare-metal simulator
○ ECALL Stops simulation ○ EBREAK Raise Breakpoint exception
Docker version
Pure bare-metal simulator
○ ECALL Stops simulation ○ EBREAK Raise Breakpoint exception
Docker version
Tool-chain
CFLAGS = -Wall -I. -O0 -static -march=rv32imac -mabi=ilp32
> objcopy -Oihex file.elf file.hex
Check ISS correctness - Compliance tests
Check whole simulator - C programs
Simulator is working fine
Need to add more components
Increase performance, but similar to other SystemC simulators Open-Source https://github.com/mariusmm/RISC-V-TLM