resources: Merge branch 'stable' into develop

This is done periodically as stable can be updated at any time, though
these changes should also be available on the develop branch.

Change-Id: I6767ae43e0c2e258291ace67d711faac45f50496
diff --git a/README.md b/README.md
index 17a13db..ef0c0e7 100644
--- a/README.md
+++ b/README.md
@@ -331,6 +331,14 @@
 
 To compile:
 
+**Note**: Make sure you are in gem5-resources directory (resources like square are not present in the gem5 repository)
+To clone the gem5-resources repository, run the following command:
+
+```
+git clone https://gem5.googlesource.com/public/gem5-resources
+```
+
+
 ```
 cd src/gpu/square
 docker run --rm -v ${PWD}:${PWD} -w ${PWD} -u $UID:$GID gcr.io/gem5-test/gcn-gpu make gfx8-apu
diff --git a/resources.json b/resources.json
index f72af6b..7fdab28 100644
--- a/resources.json
+++ b/resources.json
@@ -377,16 +377,42 @@
                 {
                     "type" : "resource",
                     "name" : "riscv-lupio-linux-kernel",
-                    "documentation": "A kernel built with LupIO device (https://gitlab.com/luplab/lupio) drivers. Must be used when setting LupIO board workloads. Compataible with the 'riscv-lupio-busybox-img' disk image resource.",
+                    "documentation": "A kernel built with LupIO device (https://gitlab.com/luplab/lupio) drivers. Must be used when setting LupIO board workloads. Compatible with the 'riscv-lupio-busybox-img' disk image resource.",
                     "is_zipped" : false,
                     "architecture" : "RISCV",
-                    "md5sum" : "f94351edbbb0e7bd9617f7b381635546",
-                    "url" : "{url_base}/kernels/riscv/static/lupio-linux",
+                    "md5sum" : "1b7d6523647db85f9dd2b00d751f5f6f",
+                    "url" : "{url_base}/kernels/riscv/static/lupio-linux-20220727",
                     "source" : "src/lupv"
                 }
             ]
         },
         {
+            "type": "group",
+            "name": "print-this",
+            "contents": [
+                {
+                    "type" : "resource",
+                    "name": "riscv-print-this",
+                    "documentation": "A simple RISC-V binary that prints a string a set number of times. It takes two mandatory arguments: A string to print and an integer specifying how many times the string is to be printed.",
+                    "architecture" :"RISCV",
+                    "is_zipped" : false,
+                    "md5sum" : "ee2963ca71ce13ae2f096198b58064ad",
+                    "url" : "{url_base}/test-progs/print-this/riscv-print-this",
+                    "source" : "src/print-this"
+                },
+                {
+                    "type" : "resource",
+                    "name": "x86-print-this",
+                    "documentation": "A simple X86 binary that prints a string a set number of times. It takes two mandatory arguments: A string to print and an integer specifying how many times the string is to be printed.",
+                    "architecture" :"X86",
+                    "is_zipped" : false,
+                    "md5sum" : "eab785f7c14ab97b89e17c9af2f43002",
+                    "url" : "{url_base}/test-progs/print-this/x86-print-this",
+                    "source" : "src/print-this"
+                }
+            ]
+        },
+        {
             "type" : "group",
             "name" : "hello",
             "contents" : [
@@ -397,7 +423,7 @@
                     "architecture" : "RISCV",
                     "is_zipped" :  false,
                     "md5sum" : "6d9494d22b90d817e826b0d762fda973",
-                    "url" : "{url_base}/test-progs/hello/bin/riscv/linux/hello",
+                    "url" : "{url_base}/test-progs/hello/bin/riscv/linux/hello-20220728",
                     "source" : "src/simple"
                 },
                 {
diff --git a/src/gpu/heterosync/README.md b/src/gpu/heterosync/README.md
index 83bd3c5..14607c1 100644
--- a/src/gpu/heterosync/README.md
+++ b/src/gpu/heterosync/README.md
@@ -28,7 +28,7 @@
 GCN3-based dGPU. There are other targets (release) that build for GPU types
 that are currently unsupported in gem5.
 
-## Running HeterSync on GCN3_X86/gem5.opt
+## Running HeteroSync on GCN3_X86/gem5.opt
 
 HeteroSync has multiple applications that can be run (see below).  For example, to run sleepMutex with 10 ld/st per thread, 16 WGs, and 4 iterations of the critical section:
 
diff --git a/src/lupv/README.md b/src/lupv/README.md
index a425059..7b9b8aa 100644
--- a/src/lupv/README.md
+++ b/src/lupv/README.md
@@ -11,9 +11,11 @@
 author: ["Joël Porquet-Lupine"]
 ---
 
-This README will cover how to create a bootloader/kernel, and a disk image which may be used to run LupV (LupIO with RISC-V) in gem5.
+This README will cover how to create a bootloader/kernel, and a disk image which
+may be used to run LupV (LupIO with RISC-V) in gem5.
 
-An example script which uses these resources is provided here: <https://gem5.googlesource.com/public/gem5/+/refs/tags/v21.2.0.0/configs/example/lupv/>.
+An example script which uses these resources is provided here:
+<https://gem5.googlesource.com/public/gem5/+/refs/tags/v21.2.0.0/configs/example/lupv/>.
 
 
 ## Toolchain
@@ -36,7 +38,7 @@
 ```terminal
 $ git clone https://gitlab.com/luplab/lupio/linux
 $ cd linux
-$ git checkout lupio
+$ git checkout lupio-dev-v5.8
 $ make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- lupv_defconfig
 $ make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- -j8
 ```
@@ -45,9 +47,7 @@
 - Adapt `CROSS_COMPILE` to your toolchain's prefix
 - Adapt `-j8` to the number of parallel jobs you want to run
 
-The resulting kernel image is in `arch/riscv/boot/Image`
-
-
+The resulting kernel image is in `arch/riscv/boot/Image`.
 
 ### Bootloader
 
@@ -65,7 +65,8 @@
 The resulting firmware which includes the bootloader and the kernel, and can be
 loaded as a kernel image in gem5, is in `build/bbl`.
 
-A pre-built bootloader/kernel binary can be obtained from [here](http://dist.gem5.org/dist/v21-2/kernels/riscv/static/lupio-linux).
+A pre-built bootloader/kernel binary can be obtained from
+[here](http://dist.gem5.org/dist/v21-2/kernels/riscv/static/lupio-linux).
 
 ## Root filesystem
 
@@ -76,8 +77,8 @@
 
 ### Busybox
 
-Copy `config_busybox_rv64_092021` file to your computer and compile busybox using this
-configuration.
+Copy `config_busybox_rv64_092021` file to your computer and compile busybox
+using this configuration.
 
 ```terminal
 $ git clone https://git.busybox.net/busybox/
@@ -134,4 +135,5 @@
 The resulting filesystem image, which can be loaded as a partition image in
 gem5, is `rootfs.img`.
 
-A pre-built, gzipped, image can be obtained [here](http://dist.gem5.org/dist/v21-2/images/riscv/busybox/riscv-lupio-busybox.img.gz).
+A pre-built, gzipped, image can be obtained
+[here](http://dist.gem5.org/dist/v21-2/images/riscv/busybox/riscv-lupio-busybox.img.gz).
diff --git a/src/print-this/Makefile b/src/print-this/Makefile
new file mode 100644
index 0000000..3bb1445
--- /dev/null
+++ b/src/print-this/Makefile
@@ -0,0 +1,8 @@
+all: print-this
+
+print_this: print-this-src.c Makefile
+	gcc -O0 -ggdb3 -std=c99 -static print-this-src.c -o print-this
+
+
+clean:
+	rm -rf print-this
diff --git a/src/print-this/README.md b/src/print-this/README.md
new file mode 100644
index 0000000..689540e
--- /dev/null
+++ b/src/print-this/README.md
@@ -0,0 +1,53 @@
+---
+title: The 'print-this' binary
+layout: default
+permalink: resources/print-this
+shortdoc: >
+    Sources for 'print-this' binary.
+author: ["Zhantong Qiu"]
+---
+
+This 'print-this' resource is a simple binary which takes in two parameters: a string to print and an integer specifying the number of times it is to be printed.
+
+This resource is deliberately kept simple and is used primarily for testing purposes.
+
+## Building Instructions
+
+Run `make`.
+
+## Cleaning Instructions
+
+Run `make clean` on the Makefile directory.
+
+## Usage
+
+It takes two parameters, a string to print and an integer stating how many times it should be printed.
+
+### Example
+
+`./print_this "a string to print" 10`
+
+Will output:
+
+```
+1 a string to print
+2 a string to print
+3 a string to print
+4 a string to print
+5 a string to print
+6 a string to print
+7 a string to print
+8 a string to print
+9 a string to print
+10 a string to print
+```
+
+## Pre-built binaries
+
+Compiled to the RISC-V ISA: http://dist.gem5.org/dist/develop/test-progs/print-this/riscv-print-this
+
+Compiled to the X86 ISA: http://dist.gem5.org/dist/develop/test-progs/print-this/x86-print-this
+
+## License
+
+This code is covered by By the [03-Clause BSD License (BSD-3-Clause)](https://opensource.org/licenses/BSD-3-Clause).
diff --git a/src/print-this/print-this.c b/src/print-this/print-this.c
new file mode 100644
index 0000000..f717685
--- /dev/null
+++ b/src/print-this/print-this.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2022 The Regents of the University of California
+ * All rights reserved
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void main(int argc, char *argv[]) {
+
+    if(argc<=2) {
+        printf("please enter a string and an number\n ex. ['print this' 9]\n");
+        exit(1);
+     }  //otherwise continue on our merry way....
+
+    int arg2 = atoi(argv[2]);
+
+    for(int i =0; i<arg2; i++){
+        printf("%i %s\n",i+1,argv[1]);
+    }
+}