Skip to content

Commit

Permalink
Adds another qemu platform.
Browse files Browse the repository at this point in the history
qemu_virt: One core, deterministic.
qemu_virt4: Four core, non-deterministic.
  • Loading branch information
HAKarlsson committed Nov 6, 2023
1 parent 74e7ea4 commit 4ed0cad
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 46 deletions.
2 changes: 1 addition & 1 deletion common/inc/plat/config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#if defined(PLATFORM_qemu_virt)
#if defined(PLATFORM_qemu_virt) || defined(PLATFORM_qemu_virt4)
#include "plat/qemu_virt.h"
#elif defined(PLATFORM_sifive_unleashed)
#include "plat/sifive_unleashed.h"
Expand Down
3 changes: 2 additions & 1 deletion common/plat/qemu_virt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ export ARCH=rv64imac_zicsr
export ABI=lp64
export CMODEL=medany
export QEMU_MACHINE=virt
export QEMU_SMP=4
export QEMU_SMP=1
export QEMU_OPTIONS=-icount 3
export COMMON_INC:=${ROOT}/common/inc
export COMMON_LIB:=${ROOT}/common/build/${PLATFORM}
export STARTFILES:=${ROOT}/common/build/${PLATFORM}/start
Expand Down
9 changes: 9 additions & 0 deletions common/plat/qemu_virt4.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export ARCH=rv64imac_zicsr
export ABI=lp64
export CMODEL=medany
export QEMU_MACHINE=virt
export QEMU_SMP=4
export COMMON_INC:=${ROOT}/common/inc
export COMMON_LIB:=${ROOT}/common/build/${PLATFORM}
export STARTFILES:=${ROOT}/common/build/${PLATFORM}/start
PLAT_SRCS=src/drivers/uart/ns16550a.c src/drivers/time.c
2 changes: 1 addition & 1 deletion projects/ping-pong/app0/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int main(void)
s3k_msg_t msg;
s3k_reply_t reply;
memcpy(msg.data, "pong", 5);
s3k_reg_write(S3K_REG_SERVTIME, 4500);
s3k_reg_write(S3K_REG_SERVTIME, 100);
while (1) {
do {
reply = s3k_sock_sendrecv(11, &msg);
Expand Down
31 changes: 0 additions & 31 deletions projects/ping-pong/scripts/gdb.sh

This file was deleted.

11 changes: 0 additions & 11 deletions projects/ping-pong/scripts/qemu.sh

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ if [[ -z "$QEMU_SMP" ]]; then
fi

qemu-system-riscv64 -M $QEMU_MACHINE -smp $QEMU_SMP -m 128M -nographic -bios none \
$LOADER $@
$LOADER $QEMU_OPTIONS $@

0 comments on commit 4ed0cad

Please sign in to comment.