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 <austinharris@utexas.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/15355
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>
This commit is contained in:
Austin Harris
2018-12-26 19:19:00 -06:00
committed by Austin Harris
parent ea487f9bb7
commit 9c5373ca61
10 changed files with 691 additions and 84 deletions

View File

@@ -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.");