Rename emulator to host, for clarity

This commit is contained in:
Toby Jaffey 2025-12-06 22:37:10 +00:00
parent 6d12ce5a80
commit 3e4c87fa1d
21 changed files with 29 additions and 29 deletions

View file

@ -1,12 +1,12 @@
all: all:
(cd emulator && make) (cd host && make)
(cd emulator-mini && make) (cd host-mini && make)
(cd emulator-parallel && make) (cd host-parallel && make)
#(cd apps && make) # do not build apps by default, as they require a variety of dev tools #(cd apps && make) # do not build apps by default, as they require a variety of dev tools
clean: clean:
(cd emulator && make clean) (cd host && make clean)
(cd emulator-mini && make clean) (cd host-mini && make clean)
(cd emulator-parallel && make clean) (cd host-parallel && make clean)
(cd apps && make clean) (cd apps && make clean)

View file

@ -16,7 +16,7 @@ Check out the [apps](apps) folder for more.
## Quickstart ## Quickstart
make 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) 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 Run the app
./emulator ../apps/helloworld/helloworld.bin ./host ../apps/helloworld/helloworld.bin
## Quickstart API ## 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()`. 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. 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 ## Samples
* [emulator](emulator) vm host which loads a binary and runs to completion, handling multiple ioreq types * [host](host) 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 * [host-mini](host-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 * [host-parallel](host-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-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/helloworld](apps/helloworld) C hello world program
* [apps/sketch](apps/sketch) C Arduino/Wiring/Processing type program in `setup()` and `loop()` style * [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 * [apps/rust-hello](apps/rust-hello) Rust hello world program

View file

@ -20,7 +20,7 @@ disasm: all
$(PREFIX)objdump -S -d -f ${PROJECT}.elf $(PREFIX)objdump -S -d -f ${PROJECT}.elf
test: all test: all
../../emulator/emulator ${PWD}/${PROJECT}.bin ../../host/host ${PWD}/${PROJECT}.bin
clean: clean:
rm -f ${PROJECT}.o ${PROJECT}.elf ${PROJECT}.bin rm -f ${PROJECT}.o ${PROJECT}.elf ${PROJECT}.bin

View file

@ -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 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 test: all
../../emulator/emulator rust-hello.bin ../../host/host rust-hello.bin
clean: clean:
rm -rf rust-hello.bin target rm -rf rust-hello.bin target

View file

@ -20,7 +20,7 @@ disasm: all
$(PREFIX)objdump -S -d -f ${PROJECT}.elf $(PREFIX)objdump -S -d -f ${PROJECT}.elf
test: all test: all
../../emulator/emulator ${PWD}/${PROJECT}.bin ../../host/host ${PWD}/${PROJECT}.bin
clean: clean:
rm -f ${PROJECT}.o ${PROJECT}.elf ${PROJECT}.bin rm -f ${PROJECT}.o ${PROJECT}.elf ${PROJECT}.bin

View file

@ -7,6 +7,6 @@ clean:
rm -rf mandel.bin zig-out .zig-cache rm -rf mandel.bin zig-out .zig-cache
test: all test: all
../../emulator/emulator mandel.bin ../../host/host mandel.bin

View file

@ -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

View file

@ -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

5
host-mini/Makefile Normal file
View file

@ -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

5
host-parallel/Makefile Normal file
View file

@ -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

View file

@ -1,5 +1,5 @@
all: 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: clean:
rm -f emulator rm -f host