aboutsummaryrefslogtreecommitdiff
path: root/debug/targets.py
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2019-07-15 10:31:23 -0700
committerGitHub <noreply@github.com>2019-07-15 10:31:23 -0700
commit419dcecc7a9eb0b8efc2e8c82d37364a724e2227 (patch)
tree04854a0e0f6381cd4dbdb20e63a297265be77e3f /debug/targets.py
parent92862bcb27a53f246126c95203b44153d324bbd7 (diff)
downloadriscv-tests-419dcecc7a9eb0b8efc2e8c82d37364a724e2227.zip
riscv-tests-419dcecc7a9eb0b8efc2e8c82d37364a724e2227.tar.gz
riscv-tests-419dcecc7a9eb0b8efc2e8c82d37364a724e2227.tar.bz2
Make tests work with RV32E targets. (#196)
Diffstat (limited to 'debug/targets.py')
-rw-r--r--debug/targets.py42
1 files changed, 27 insertions, 15 deletions
diff --git a/debug/targets.py b/debug/targets.py
index b686b2a..c4bee73 100644
--- a/debug/targets.py
+++ b/debug/targets.py
@@ -136,21 +136,33 @@ class Target(object):
prefix=binary_name + "_")
binary_name = self.temporary_binary.name
Target.temporary_files.append(self.temporary_binary)
- march = "rv%dima" % hart.xlen
- for letter in "fdc":
- if hart.extensionSupported(letter):
- march += letter
- testlib.compile(sources +
- ("programs/entry.S", "programs/init.c",
- "-DNHARTS=%d" % len(self.harts),
- "-I", "../env",
- "-march=%s" % march,
- "-T", hart.link_script_path,
- "-nostartfiles",
- "-mcmodel=medany",
- "-DXLEN=%d" % hart.xlen,
- "-o", binary_name),
- xlen=hart.xlen)
+
+ args = list(sources) + [
+ "programs/entry.S", "programs/init.c",
+ "-DNHARTS=%d" % len(self.harts),
+ "-I", "../env",
+ "-T", hart.link_script_path,
+ "-nostartfiles",
+ "-mcmodel=medany",
+ "-DXLEN=%d" % hart.xlen,
+ "-o", binary_name]
+
+ if hart.extensionSupported('e'):
+ args.append("-march=rv32e")
+ args.append("-mabi=ilp32e")
+ args.append("-DRV32E")
+ else:
+ march = "rv%dima" % hart.xlen
+ for letter in "fdc":
+ if hart.extensionSupported(letter):
+ march += letter
+ args.append("-march=%s" % march)
+ if hart.xlen == 32:
+ args.append("-mabi=ilp32")
+ else:
+ args.append("-mabi=lp%d" % hart.xlen)
+
+ testlib.compile(args)
return binary_name
def add_target_options(parser):