scons: Not compiling with systemc when host is RISCV
Compiling gem5 with systemc enabled results in the errors
described in https://gem5.atlassian.net/browse/GEM5-1027.
This change tells scons not to compile gem5 with systemc
when the host ISA is RISC-V.
JIRA: https://gem5.atlassian.net/browse/GEM5-1027
Change-Id: I04e1bc722c9d702472152c9116d89938e8408047
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47660
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
diff --git a/src/systemc/SConsopts b/src/systemc/SConsopts
index 4f2ae5c..891431c 100644
--- a/src/systemc/SConsopts
+++ b/src/systemc/SConsopts
@@ -28,6 +28,14 @@
from gem5_scons import warning
def use_systemc_check(env, warn=False):
+ import platform
+ host_isa = platform.machine()
+ # Disallow compiling systemc if the host ISA is RISC-V.
+ # The error is described here: https://gem5.atlassian.net/browse/GEM5-1027
+ if host_isa.startswith("riscv"):
+ if warn:
+ warning('Warning: Systemc may not work on RISC-V.')
+ return False
if env['PLATFORM'] == 'darwin':
if warn:
warning('Warning: Systemc may not work on Mac OS.')