From f426b38b283da0af44e09dba49a8ce68c2034992 Mon Sep 17 00:00:00 2001 From: David Harris Date: Mon, 2 Dec 2024 01:56:39 -0800 Subject: [PATCH] Adjusted hello and gpio examples to use new wsim --elf syntax --- examples/C/gpio/Makefile | 3 +-- examples/C/gpio/gpio.c | 2 +- examples/C/hello/Makefile | 3 +-- examples/C/hello/hello.c | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/C/gpio/Makefile b/examples/C/gpio/Makefile index c33425ac7..237578a46 100644 --- a/examples/C/gpio/Makefile +++ b/examples/C/gpio/Makefile @@ -2,7 +2,6 @@ TARGET = gpio $(TARGET).objdump: $(TARGET) riscv64-unknown-elf-objdump -S -D $(TARGET) > $(TARGET).objdump - cp $(TARGET) $(TARGET).elf $(TARGET): $(TARGET).c Makefile riscv64-unknown-elf-gcc -o $(TARGET) -gdwarf-2 -O\ @@ -30,4 +29,4 @@ $(TARGET): $(TARGET).c Makefile # -fno-common -fno-builtin-printf -nostartfiles -lgcc \ clean: - rm -f $(TARGET) $(TARGET).objdump + rm -f $(TARGET) $(TARGET).objdump* $(TARGET).memfile diff --git a/examples/C/gpio/gpio.c b/examples/C/gpio/gpio.c index 64f3b5a08..8d303a797 100644 --- a/examples/C/gpio/gpio.c +++ b/examples/C/gpio/gpio.c @@ -4,7 +4,7 @@ // General-Purpose I/O (GPIO) example program illustrating compiled C code // compile with make -// simulate with: wsim rv64gc hello.elf --sim verilator +// simulate with: wsim rv64gc --elf hello.elf --sim verilator #include #include "gpiolib.h" diff --git a/examples/C/hello/Makefile b/examples/C/hello/Makefile index ea1ceb910..b6003d5c0 100644 --- a/examples/C/hello/Makefile +++ b/examples/C/hello/Makefile @@ -2,7 +2,6 @@ TARGET = hello $(TARGET).objdump: $(TARGET) riscv64-unknown-elf-objdump -S -D $(TARGET) > $(TARGET).objdump - cp $(TARGET) $(TARGET).elf $(TARGET): $(TARGET).c Makefile riscv64-unknown-elf-gcc -o $(TARGET) -gdwarf-2 -O\ @@ -30,4 +29,4 @@ $(TARGET): $(TARGET).c Makefile # -fno-common -fno-builtin-printf -nostartfiles -lgcc \ clean: - rm -f $(TARGET) $(TARGET).objdump + rm -f $(TARGET) $(TARGET).objdump* $(TARGET).memfile diff --git a/examples/C/hello/hello.c b/examples/C/hello/hello.c index 2a6cfa033..77c562369 100644 --- a/examples/C/hello/hello.c +++ b/examples/C/hello/hello.c @@ -11,8 +11,8 @@ // such that using \n\r for new lines works best. // compile with make -// simulate Wally with: wsim rv64gc hello.elf --sim verilator -// simulate in Spike with: spike hello.elf +// simulate Wally with: wsim rv64gc --elf hello --sim verilator +// simulate in Spike with: spike hello #include