resources: Added sparc64 compilation to simple

At present only the pthreads are supported as they are the only SPARC
binaries that have been tested.

Change-Id: I3d8871ef49d7f73e375447e161ddbf2627645296
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5-resources/+/37515
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: Bobby R. Bruce <bbruce@ucdavis.edu>
diff --git a/README.md b/README.md
index 316620e..cdb0399 100644
--- a/README.md
+++ b/README.md
@@ -222,6 +222,7 @@
 - `arm`
 - `riscv`
 - `x86_64`
+- `sparc64`
 
 You have to specify the path to the gem5 source code with `GEM5_ROOT` variable so that
 m5ops can be used from there. For example for a native build:
@@ -377,6 +378,22 @@
 
 <http://dist.gem5.org/dist/v20-1/test-progs/pthreads/riscv64/test_std_condition_variable>
 
+<http://dist.gem5.org/dist/v20-1/test-progs/pthreads/sparc64/test_pthread_create_seq>
+
+<http://dist.gem5.org/dist/v20-1/test-progs/pthreads/sparc64/test_pthread_create_para>
+
+<http://dist.gem5.org/dist/v20-1/test-progs/pthreads/sparc64/test_pthread_mutex>
+
+<http://dist.gem5.org/dist/v20-1/test-progs/pthreads/sparc64/test_atomic>
+
+<http://dist.gem5.org/dist/v20-1/test-progs/pthreads/sparc64/test_pthread_cond>
+
+<http://dist.gem5.org/dist/v20-1/test-progs/pthreads/sparc64/test_std_thread>
+
+<http://dist.gem5.org/dist/v20-1/test-progs/pthreads/sparc64/test_std_mutex>
+
+<http://dist.gem5.org/dist/v20-1/test-progs/pthreads/sparc64/test_std_condition_variable>
+
 
 # Resource: Square
 
diff --git a/src/simple/Makefile b/src/simple/Makefile
index 60c7fa8..2b39334 100644
--- a/src/simple/Makefile
+++ b/src/simple/Makefile
@@ -126,11 +126,28 @@
 M5OP_OBJ =
 USER_INS := $(filter-out ./m5_checkpoint ./m5_exit, $(USER_INS))
 else
+ifeq ($(ISA),sparc64)
+PREFIX = sparc64-linux-
+# sparc64 does not have an util/m5/m5op_
+M5OP_OBJ =
+# At present sparc64 only compiles the pthread binaries. Other binaries have
+# not been tested.
+USER_INS := $(filter-out ./m5_checkpoint \
+                         ./m5_exit \
+                         ./chdir_print \
+                         ./hello \
+                         ./hellp_cpp \
+                         ./m5_exit_addr \
+                         ./page_access_wrap \
+                         ./stack_print \
+                         ./std_thread, $(USER_INS))
+else
 $(error unknown isa $(ISA))
 endif
 endif
 endif
 endif
+endif
 
 # Calculated values.
 BARE_OUTS = $(addprefix $(OUT_BARE_DIR)/, $(addsuffix $(OUT_EXT), $(BARE_INS) $(addprefix $(ISA)/,$(ISA_BARE_INS))))