From 63d4005a29dea37e0219444a3de2cdb25289fdfb Mon Sep 17 00:00:00 2001 From: Alec Roelke Date: Thu, 15 Jun 2017 15:33:25 -0400 Subject: arch-riscv: Restructure ISA description This patch restructures the RISC-V ISA description to use fewer classes and improve its ability to be extended with nonstandard extensions in the future. It also cleans up the disassembly for some of the CSR and system instructions by removing source and destination registers for instructions that don't have any. [Fix class UImmOp to have an "imm" member rather than "uimm".] [Update disassembly generation for new RegId class.] Change-Id: Iec1c782020126e5e8e73460b84e31c7b5a5971d9 Reviewed-on: https://gem5-review.googlesource.com/3800 Maintainer: Alec Roelke Reviewed-by: Jason Lowe-Power --- src/arch/riscv/utility.hh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/arch/riscv/utility.hh') diff --git a/src/arch/riscv/utility.hh b/src/arch/riscv/utility.hh index fc67fc806..38109a208 100644 --- a/src/arch/riscv/utility.hh +++ b/src/arch/riscv/utility.hh @@ -12,7 +12,7 @@ * unmodified and in its entirety in all distributions of the software, * modified or unmodified, in source code or in binary form. * - * Copyright (c) 2016 The University of Virginia + * Copyright (c) 2016-2017 The University of Virginia * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,8 +48,11 @@ #include #include +#include +#include "arch/riscv/registers.hh" #include "base/types.hh" +#include "cpu/reg_class.hh" #include "cpu/static_inst.hh" #include "cpu/thread_context.hh" @@ -126,6 +129,16 @@ copyRegs(ThreadContext *src, ThreadContext *dest) dest->pcState(src->pcState()); } +inline std::string +registerName(RegId reg) +{ + if (reg.isIntReg()) { + return IntRegNames[reg.index()]; + } else { + return FloatRegNames[reg.index()]; + } +} + inline void skipFunction(ThreadContext *tc) { -- cgit v1.2.3