1#!/bin/sh
2
3qemu=qemu-system-riscv32
4
5# select the program
6elf=hello-world-riscv.elf
7
8# Set the target machine
9machine=spike
10cpu=sifive-e31
11
12# Map stdio to a multiplexed character device so we can use it
13# for the monitor and semihosting output
14
15chardev=stdio,mux=on,id=stdio0
16
17# Point the semihosting driver at our new chardev
18
19semi=enable=on,chardev=stdio0,arg="test-file"
20
21# Point the monitor at the new chardev too
22
23mon=chardev=stdio0,mode=readline
24
25# Disable the serial port
26
27serial=chardev:stdio0
28
29$qemu -chardev $chardev -semihosting-config $semi -mon $mon -serial $serial -machine $machine -cpu $cpu -kernel $elf -nographic "$@"
30