[sw] Move hello_world programs to example dir
`hello_world` and `hello_usbdev` are mainly used for demo purposes, and
are better suited to reside in an example folder.
Updated all documentation and configuration files to reference correct
paths to these programs (some docs were stale).
diff --git a/doc/ug/getting_started_fpga.md b/doc/ug/getting_started_fpga.md
index 04495be..9a6a9e9 100644
--- a/doc/ug/getting_started_fpga.md
+++ b/doc/ug/getting_started_fpga.md
@@ -22,7 +22,7 @@
Synthesizing a design for a FPGA board is done with the following commands.
The FPGA build will pull in a program to run from the internal
-SRAM. This is pulled in from the `sw/hello_world directory` (see the
+SRAM. This is pulled in from the `sw/examples/hello_world directory` (see the
`parameters:` section of the `top_earlgrey_nexysvideo.core` file). At
the moment there is no check that the `hello_world.vmem` is up to
date, so it is best to follow the instructions to [Build
@@ -190,7 +190,7 @@
It is especially useful in the context of our `boot_rom.elf`, which resides in the ROM region, which will eventually jump to a different executable as part of the flash region.
```console
-(gdb) file sw/tests/hello_world/hello_world.elf
+(gdb) file sw/examples/hello_world/hello_world.elf
(gdb) disassemble 0x200005c0,0x200005c0+16*4
```
diff --git a/doc/ug/getting_started_sw.md b/doc/ug/getting_started_sw.md
index 126dfff..e988525 100644
--- a/doc/ug/getting_started_sw.md
+++ b/doc/ug/getting_started_sw.md
@@ -7,7 +7,7 @@
## Building software
```console
-$ cd $REPO_TOP/sw/hello_world
+$ cd $REPO_TOP/sw/examples/hello_world
$ make CC=/tools/riscv/bin/riscv32-unknown-elf-gcc
```
diff --git a/doc/ug/getting_started_verilator.md b/doc/ug/getting_started_verilator.md
index b996725..673a537 100644
--- a/doc/ug/getting_started_verilator.md
+++ b/doc/ug/getting_started_verilator.md
@@ -28,7 +28,7 @@
```console
$ cd $REPO_TOP/sw/boot_rom
$ make clean && make SIM=1
-$ cd $REPO_TOP/sw/hello_world
+$ cd $REPO_TOP/sw/examples/hello_world
$ make clean && make SIM=1
```
@@ -39,7 +39,7 @@
$ cd $REPO_TOP
$ build/lowrisc_systems_top_earlgrey_verilator_0.1/sim-verilator/Vtop_earlgrey_verilator \
--rominit=sw/boot_rom/boot_rom.vmem \
- --flashinit=sw/tests/hello_world/hello_world.vmem
+ --flashinit=sw/examples/hello_world/hello_world.vmem
```
To stop the simulation press CTRL-c.
@@ -182,6 +182,6 @@
```console
$ cd $REPO_TOP
-$ build/lowrisc_systems_top_earlgrey_verilator_0.1/sim-verilator/Vtop_earlgrey_verilator --meminit=sw/hello_world/hello_world.vmem --trace
+$ build/lowrisc_systems_top_earlgrey_verilator_0.1/sim-verilator/Vtop_earlgrey_verilator --meminit=sw/examples/hello_world/hello_world.vmem --trace
$ gtkwave sim.fst
```
diff --git a/doc/ug/quickstart.md b/doc/ug/quickstart.md
index decc522..2b3b0da 100644
--- a/doc/ug/quickstart.md
+++ b/doc/ug/quickstart.md
@@ -12,9 +12,9 @@
$ cd $REPO_TOP
$ fusesoc --cores-root . sim --build-only lowrisc:systems:top_earlgrey_verilator
$ make SIM=1 -C sw/boot_rom clean all
-$ make SIM=1 -C sw/tests/hello_world clean all
+$ make SIM=1 -C sw/examples/hello_world clean all
$ build/lowrisc_systems_top_earlgrey_verilator_0.1/sim-verilator/Vtop_earlgrey_verilator --rominit=sw/boot_rom/boot_rom.vmem \
-$ --flashinit=sw/tests/hello_world/hello_world.vmem
+$ --flashinit=sw/examples/hello_world/hello_world.vmem
```
See the [getting started](getting_started_verilator.md) for a complete guide.
@@ -30,7 +30,7 @@
```console
$ cd $REPO_TOP
$ make -C sw/boot_rom clean all
-$ make -C sw/tests/hello_world clean all
+$ make -C sw/examples/hello_world clean all
$ . /tools/xilinx/Vivado/2018.3/settings64.sh
$ fusesoc --cores-root . build lowrisc:systems:top_earlgrey_nexysvideo
$ fusesoc --cores-root . pgm lowrisc:systems:top_earlgrey_nexysvideo:0.1
diff --git a/hw/top_earlgrey/top_earlgrey_artys7-50.core b/hw/top_earlgrey/top_earlgrey_artys7-50.core
index 841966e..852b565 100644
--- a/hw/top_earlgrey/top_earlgrey_artys7-50.core
+++ b/hw/top_earlgrey/top_earlgrey_artys7-50.core
@@ -21,14 +21,14 @@
parameters:
# XXX: This parameter needs to be absolute, or relative to the *.runs/synth_1
# directory. It's best to pass it as absolute path when invoking fusesoc, e.g.
- # --SRAM_INIT_FILE=$PWD/sw/hello_world/hello_world.vmem
+ # --SRAM_INIT_FILE=$PWD/sw/examples/hello_world/hello_world.vmem
# XXX: The VMEM file should be added to the sources of the Vivado project to
# make the Vivado dependency tracking work. However this requires changes to
# fusesoc first.
SRAM_INIT_FILE:
datatype: str
description: SRAM initialization file in vmem hex format
- default: "../../../../../sw/hello_world/hello_world.vmem"
+ default: "../../../../../sw/examples/hello_world/hello_world.vmem"
paramtype: vlogdefine
PRIM_DEFAULT_IMPL:
datatype: str
diff --git a/hw/top_earlgrey/top_earlgrey_nexysvideo.core b/hw/top_earlgrey/top_earlgrey_nexysvideo.core
index 85886ca..ecd16ba 100644
--- a/hw/top_earlgrey/top_earlgrey_nexysvideo.core
+++ b/hw/top_earlgrey/top_earlgrey_nexysvideo.core
@@ -22,7 +22,7 @@
parameters:
# XXX: This parameter needs to be absolute, or relative to the *.runs/synth_1
# directory. It's best to pass it as absolute path when invoking fusesoc, e.g.
- # --SRAM_INIT_FILE=$PWD/sw/hello_world/hello_world.vmem
+ # --SRAM_INIT_FILE=$PWD/sw/examples/hello_world/hello_world.vmem
# XXX: The VMEM file should be added to the sources of the Vivado project to
# make the Vivado dependency tracking work. However this requires changes to
# fusesoc first.
diff --git a/hw/top_earlgrey/top_earlgrey_usb_nexysvideo.core b/hw/top_earlgrey/top_earlgrey_usb_nexysvideo.core
index 61b4881..798108f 100644
--- a/hw/top_earlgrey/top_earlgrey_usb_nexysvideo.core
+++ b/hw/top_earlgrey/top_earlgrey_usb_nexysvideo.core
@@ -21,14 +21,14 @@
parameters:
# XXX: This parameter needs to be absolute, or relative to the *.runs/synth_1
# directory. It's best to pass it as absolute path when invoking fusesoc, e.g.
- # --SRAM_INIT_FILE=$PWD/sw/hello_world/hello_world.vmem
+ # --SRAM_INIT_FILE=$PWD/sw/examples/hello_world/hello_world.vmem
# XXX: The VMEM file should be added to the sources of the Vivado project to
# make the Vivado dependency tracking work. However this requires changes to
# fusesoc first.
SRAM_INIT_FILE:
datatype: str
description: SRAM initialization file in vmem hex format
- default: "../../../../../sw/hello_usbdev/hello_usbdev.vmem"
+ default: "../../../../../sw/examples/hello_usbdev/hello_usbdev.vmem"
paramtype: vlogdefine
PRIM_DEFAULT_IMPL:
datatype: str
diff --git a/sw/tests/hello_usbdev/Makefile b/sw/examples/hello_usbdev/Makefile
similarity index 100%
rename from sw/tests/hello_usbdev/Makefile
rename to sw/examples/hello_usbdev/Makefile
diff --git a/sw/tests/hello_usbdev/hello_usbdev.c b/sw/examples/hello_usbdev/hello_usbdev.c
similarity index 100%
rename from sw/tests/hello_usbdev/hello_usbdev.c
rename to sw/examples/hello_usbdev/hello_usbdev.c
diff --git a/sw/tests/hello_world/Makefile b/sw/examples/hello_world/Makefile
similarity index 100%
rename from sw/tests/hello_world/Makefile
rename to sw/examples/hello_world/Makefile
diff --git a/sw/tests/hello_world/hello_world.c b/sw/examples/hello_world/hello_world.c
similarity index 100%
rename from sw/tests/hello_world/hello_world.c
rename to sw/examples/hello_world/hello_world.c
diff --git a/sw/host/spiflash/README.md b/sw/host/spiflash/README.md
index 656800e..270463c 100644
--- a/sw/host/spiflash/README.md
+++ b/sw/host/spiflash/README.md
@@ -44,7 +44,7 @@
Build hello_world program:
```shell
-$ cd ${REPO_TOP}/sw/hello_world
+$ cd ${REPO_TOP}/sw/examples/hello_world
$ make clean && make SIM=1
```
@@ -55,7 +55,7 @@
```shell
$ cd ${REPO_TOP}/util/spiflash
$ make clean && make
-$ ./spiflash --input=../../sw/hello_world/hello_world.bin --verilator=/dev/pts/3
+$ ./spiflash --input=../../sw/examples/hello_world/hello_world.bin --verilator=/dev/pts/3
```
## TODOs