From 9c5373ca61587409e4d0f6ad4c032e8d53be28ca Mon Sep 17 00:00:00 2001 From: Austin Harris Date: Wed, 26 Dec 2018 19:19:00 -0600 Subject: arch-riscv: Enable support for riscv 32-bit in SE mode. This patch splits up the riscv SE mode support for 32 and 64-bit. A future patch will add support for decoding rv32 instructions. Change-Id: Ia79ae19f753caf94dc7e5830a6630efb94b419d7 Signed-off-by: Austin Harris Reviewed-on: https://gem5-review.googlesource.com/c/15355 Reviewed-by: Jason Lowe-Power Reviewed-by: Alec Roelke Maintainer: Alec Roelke --- src/sim/process.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/sim/process.cc') diff --git a/src/sim/process.cc b/src/sim/process.cc index 62959b4c5..c4dd64107 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -623,14 +623,19 @@ ProcessParams::create() fatal("Unknown/unsupported operating system."); } #elif THE_ISA == RISCV_ISA - if (obj_file->getArch() != ObjectFile::Riscv) + ObjectFile::Arch arch = obj_file->getArch(); + if (arch != ObjectFile::Riscv64 && arch != ObjectFile::Riscv32) fatal("Object file architecture does not match compiled ISA (RISCV)."); switch (obj_file->getOpSys()) { case ObjectFile::UnknownOpSys: warn("Unknown operating system; assuming Linux."); // fall through case ObjectFile::Linux: - process = new RiscvLinuxProcess(this, obj_file); + if (arch == ObjectFile::Riscv64) { + process = new RiscvLinuxProcess64(this, obj_file); + } else { + process = new RiscvLinuxProcess32(this, obj_file); + } break; default: fatal("Unknown/unsupported operating system."); -- cgit v1.2.3