qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

QEMU RISC-V


From: Peter Samir
Subject: QEMU RISC-V
Date: Sun, 25 Jun 2023 01:16:21 +0300

hello, 
I built RISC-V toolchain and QEMU as follows:
# Install prerequisites: https://github.com/riscv-collab/riscv-gnu-toolchain#prerequisites
# Install additional prerequisites: https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1251
git clone https://github.com/riscv-collab/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=/home/RISCV-installed-Tools --with-arch=rv32i_zicsr --with-abi=ilp32
make
make build-qemu


QEMU Version:  
qemu-riscv32 version 7.1.0 (v7.1.0)
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers


i debug as follows:
riscv32-unknown-elf-gcc -g test.S -o test
qemu-riscv32 -g 3333 test
// in another terminal
riscv32-unknown-elf-gdb test -ex "target remote :3333"

but Qemu reports this error when I use CSR instructions:
Program received signal SIGILL, Illegal instruction. main () at main.S:2 2 main: csrw mepc, t0

how to resolve this error ? 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]