From 3e4c87fa1d2719b6ed235afc4f035c6d9374a796 Mon Sep 17 00:00:00 2001 From: Toby Jaffey Date: Sat, 6 Dec 2025 22:37:10 +0000 Subject: [PATCH] Rename emulator to host, for clarity --- Makefile | 12 ++++++------ README.md | 14 +++++++------- apps/helloworld/Makefile | 2 +- apps/rust-hello/Makefile | 2 +- apps/sketch/Makefile | 2 +- apps/zig-mandel/Makefile | 2 +- emulator-mini/Makefile | 5 ----- emulator-parallel/Makefile | 5 ----- .../common/uvm32_common_custom.h | 0 .../common/uvm32_sys.h | 0 {emulator-arduino => host-arduino}/config.h | 0 .../host-arduino.ino | 0 {emulator-arduino => host-arduino}/mini-rv32ima.h | 0 {emulator-arduino => host-arduino}/uvm32.cpp | 0 {emulator-arduino => host-arduino}/uvm32.h | 0 host-mini/Makefile | 5 +++++ .../emulator-mini.c => host-mini/host-mini.c | 0 host-parallel/Makefile | 5 +++++ .../host-parallel.c | 0 {emulator => host}/Makefile | 4 ++-- emulator/emulator.c => host/host.c | 0 21 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 emulator-mini/Makefile delete mode 100644 emulator-parallel/Makefile rename {emulator-arduino => host-arduino}/common/uvm32_common_custom.h (100%) rename {emulator-arduino => host-arduino}/common/uvm32_sys.h (100%) rename {emulator-arduino => host-arduino}/config.h (100%) rename emulator-arduino/emulator-arduino.ino => host-arduino/host-arduino.ino (100%) rename {emulator-arduino => host-arduino}/mini-rv32ima.h (100%) rename {emulator-arduino => host-arduino}/uvm32.cpp (100%) rename {emulator-arduino => host-arduino}/uvm32.h (100%) create mode 100644 host-mini/Makefile rename emulator-mini/emulator-mini.c => host-mini/host-mini.c (100%) create mode 100644 host-parallel/Makefile rename emulator-parallel/emulator-parallel.c => host-parallel/host-parallel.c (100%) rename {emulator => host}/Makefile (53%) rename emulator/emulator.c => host/host.c (100%) diff --git a/Makefile b/Makefile index 9853501..1a8c807 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ all: - (cd emulator && make) - (cd emulator-mini && make) - (cd emulator-parallel && make) + (cd host && make) + (cd host-mini && make) + (cd host-parallel && make) #(cd apps && make) # do not build apps by default, as they require a variety of dev tools clean: - (cd emulator && make clean) - (cd emulator-mini && make clean) - (cd emulator-parallel && make clean) + (cd host && make clean) + (cd host-mini && make clean) + (cd host-parallel && make clean) (cd apps && make clean) diff --git a/README.md b/README.md index af12f8b..24c488a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Check out the [apps](apps) folder for more. ## Quickstart make - emulator/emulator precompiled/mandel.bin + host/host precompiled/mandel.bin Build one of the sample apps (requires docker for C, or Zig, or Rust) @@ -24,7 +24,7 @@ Build one of the sample apps (requires docker for C, or Zig, or Rust) Run the app - ./emulator ../apps/helloworld/helloworld.bin + ./host ../apps/helloworld/helloworld.bin ## Quickstart API @@ -86,7 +86,7 @@ There are two system ioreqs used by uvm32, `halt()` and `yield()`. New ioreqs can be added to the host via `uvm32_init()`. Each ioreq maps a CSR number to a value understood by the host (`F_PRINTD` below) and has an associated type which tells the host how to interpret the data passed to the CSR. -Here is a full example of a working VM host from [apps/emulator-mini](apps/emulator-mini) +Here is a full example of a working VM host from [apps/host-mini](apps/host-mini) -- @@ -150,10 +150,10 @@ int main(int argc, char *argv[]) { ## Samples - * [emulator](emulator) vm host which loads a binary and runs to completion, handling multiple ioreq types - * [emulator-mini](emulator-mini) minimal vm host (shown above), with baked in bytecode - * [emulator-parallel](emulator-parallel) parallel vm host running multiple vm instances concurrently, with baked in bytecode - * [emulator-arduino](emulator-arduino) vm host as Arduino sketch (tested on Arduino Uno ATmega328P, uses 9950 bytes of flash/1254 bytes RAM) + * [host](host) vm host which loads a binary and runs to completion, handling multiple ioreq types + * [host-mini](host-mini) minimal vm host (shown above), with baked in bytecode + * [host-parallel](host-parallel) parallel vm host running multiple vm instances concurrently, with baked in bytecode + * [host-arduino](host-arduino) vm host as Arduino sketch (tested on Arduino Uno ATmega328P, uses 9950 bytes of flash/1254 bytes RAM) * [apps/helloworld](apps/helloworld) C hello world program * [apps/sketch](apps/sketch) C Arduino/Wiring/Processing type program in `setup()` and `loop()` style * [apps/rust-hello](apps/rust-hello) Rust hello world program diff --git a/apps/helloworld/Makefile b/apps/helloworld/Makefile index 8946223..e508431 100644 --- a/apps/helloworld/Makefile +++ b/apps/helloworld/Makefile @@ -20,7 +20,7 @@ disasm: all $(PREFIX)objdump -S -d -f ${PROJECT}.elf test: all - ../../emulator/emulator ${PWD}/${PROJECT}.bin + ../../host/host ${PWD}/${PROJECT}.bin clean: rm -f ${PROJECT}.o ${PROJECT}.elf ${PROJECT}.bin diff --git a/apps/rust-hello/Makefile b/apps/rust-hello/Makefile index 9422f4a..90d1694 100644 --- a/apps/rust-hello/Makefile +++ b/apps/rust-hello/Makefile @@ -2,7 +2,7 @@ all: cargo build -r --target riscv32im-unknown-none-elf && docker run -v `pwd`:/data -w /data --rm riscv-dev riscv64-unknown-elf-objcopy target/riscv32im-unknown-none-elf/release/rust-hello -O binary rust-hello.bin test: all - ../../emulator/emulator rust-hello.bin + ../../host/host rust-hello.bin clean: rm -rf rust-hello.bin target diff --git a/apps/sketch/Makefile b/apps/sketch/Makefile index 9da16a2..ac77db1 100644 --- a/apps/sketch/Makefile +++ b/apps/sketch/Makefile @@ -20,7 +20,7 @@ disasm: all $(PREFIX)objdump -S -d -f ${PROJECT}.elf test: all - ../../emulator/emulator ${PWD}/${PROJECT}.bin + ../../host/host ${PWD}/${PROJECT}.bin clean: rm -f ${PROJECT}.o ${PROJECT}.elf ${PROJECT}.bin diff --git a/apps/zig-mandel/Makefile b/apps/zig-mandel/Makefile index 814f75a..826a64b 100644 --- a/apps/zig-mandel/Makefile +++ b/apps/zig-mandel/Makefile @@ -7,6 +7,6 @@ clean: rm -rf mandel.bin zig-out .zig-cache test: all - ../../emulator/emulator mandel.bin + ../../host/host mandel.bin diff --git a/emulator-mini/Makefile b/emulator-mini/Makefile deleted file mode 100644 index 37a865e..0000000 --- a/emulator-mini/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: - gcc -Wall -DUVM32_MEMORY_SIZE=512 -I../uvm32 -o emulator-mini ../uvm32/uvm32.c emulator-mini.c - -clean: - rm -f emulator-mini diff --git a/emulator-parallel/Makefile b/emulator-parallel/Makefile deleted file mode 100644 index 35aaa30..0000000 --- a/emulator-parallel/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: - gcc -Wall -DUVM32_MEMORY_SIZE=512 -I../uvm32 -o emulator-parallel ../uvm32/uvm32.c emulator-parallel.c - -clean: - rm -f emulator-parallel diff --git a/emulator-arduino/common/uvm32_common_custom.h b/host-arduino/common/uvm32_common_custom.h similarity index 100% rename from emulator-arduino/common/uvm32_common_custom.h rename to host-arduino/common/uvm32_common_custom.h diff --git a/emulator-arduino/common/uvm32_sys.h b/host-arduino/common/uvm32_sys.h similarity index 100% rename from emulator-arduino/common/uvm32_sys.h rename to host-arduino/common/uvm32_sys.h diff --git a/emulator-arduino/config.h b/host-arduino/config.h similarity index 100% rename from emulator-arduino/config.h rename to host-arduino/config.h diff --git a/emulator-arduino/emulator-arduino.ino b/host-arduino/host-arduino.ino similarity index 100% rename from emulator-arduino/emulator-arduino.ino rename to host-arduino/host-arduino.ino diff --git a/emulator-arduino/mini-rv32ima.h b/host-arduino/mini-rv32ima.h similarity index 100% rename from emulator-arduino/mini-rv32ima.h rename to host-arduino/mini-rv32ima.h diff --git a/emulator-arduino/uvm32.cpp b/host-arduino/uvm32.cpp similarity index 100% rename from emulator-arduino/uvm32.cpp rename to host-arduino/uvm32.cpp diff --git a/emulator-arduino/uvm32.h b/host-arduino/uvm32.h similarity index 100% rename from emulator-arduino/uvm32.h rename to host-arduino/uvm32.h diff --git a/host-mini/Makefile b/host-mini/Makefile new file mode 100644 index 0000000..3f23026 --- /dev/null +++ b/host-mini/Makefile @@ -0,0 +1,5 @@ +all: + gcc -Wall -DUVM32_MEMORY_SIZE=512 -I../uvm32 -o host-mini ../uvm32/uvm32.c host-mini.c + +clean: + rm -f host-mini diff --git a/emulator-mini/emulator-mini.c b/host-mini/host-mini.c similarity index 100% rename from emulator-mini/emulator-mini.c rename to host-mini/host-mini.c diff --git a/host-parallel/Makefile b/host-parallel/Makefile new file mode 100644 index 0000000..d853710 --- /dev/null +++ b/host-parallel/Makefile @@ -0,0 +1,5 @@ +all: + gcc -Wall -DUVM32_MEMORY_SIZE=512 -I../uvm32 -o host-parallel ../uvm32/uvm32.c host-parallel.c + +clean: + rm -f host-parallel diff --git a/emulator-parallel/emulator-parallel.c b/host-parallel/host-parallel.c similarity index 100% rename from emulator-parallel/emulator-parallel.c rename to host-parallel/host-parallel.c diff --git a/emulator/Makefile b/host/Makefile similarity index 53% rename from emulator/Makefile rename to host/Makefile index a7763c3..0adb487 100644 --- a/emulator/Makefile +++ b/host/Makefile @@ -1,5 +1,5 @@ all: - gcc -Wall -Werror -pedantic -std=c99 -DUVM32_MEMORY_SIZE=16384 -I../uvm32 -o emulator ../uvm32/uvm32.c emulator.c + gcc -Wall -Werror -pedantic -std=c99 -DUVM32_MEMORY_SIZE=16384 -I../uvm32 -o host ../uvm32/uvm32.c host.c clean: - rm -f emulator + rm -f host diff --git a/emulator/emulator.c b/host/host.c similarity index 100% rename from emulator/emulator.c rename to host/host.c