From ceb4b09bd5f4a1c76d713d12a40ff9661e24523f Mon Sep 17 00:00:00 2001 From: Sandipan Das Date: Sat, 6 Feb 2021 17:22:27 +0530 Subject: [PATCH] arch-power: Add time base instructions This models a pseudo time base using the simulator ticks and adds the following instructions. * Move From Time Base (mftb) * Move From Time Base Upper (mftbu) Change-Id: Idb619ec3179b2a85925998282075bde8651c68c2 Signed-off-by: Sandipan Das --- src/arch/power/insts/integer.cc | 8 ++++++-- src/arch/power/isa/decoder.isa | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/arch/power/insts/integer.cc b/src/arch/power/insts/integer.cc index 115b8674f..c43791bc9 100644 --- a/src/arch/power/insts/integer.cc +++ b/src/arch/power/insts/integer.cc @@ -49,13 +49,17 @@ IntOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const !myMnemonic.compare("mtxer") || !myMnemonic.compare("mtlr") || !myMnemonic.compare("mtctr") || - !myMnemonic.compare("mttar")) { + !myMnemonic.compare("mttar") || + !myMnemonic.compare("mttb") || + !myMnemonic.compare("mttbu")) { printDest = false; } else if (!myMnemonic.compare("mfcr") || !myMnemonic.compare("mfxer") || !myMnemonic.compare("mflr") || !myMnemonic.compare("mfctr") || - !myMnemonic.compare("mftar")) { + !myMnemonic.compare("mftar") || + !myMnemonic.compare("mftb") || + !myMnemonic.compare("mftbu")) { printSrcs = false; } diff --git a/src/arch/power/isa/decoder.isa b/src/arch/power/isa/decoder.isa index 4ecee98cd..aeee29a03 100644 --- a/src/arch/power/isa/decoder.isa +++ b/src/arch/power/isa/decoder.isa @@ -973,6 +973,8 @@ decode PO default Unknown::unknown() { 0x100: mflr({{ Rt = LR; }}); 0x120: mfctr({{ Rt = CTR; }}); 0x1f9: mftar({{ Rt = TAR; }}); + 0x188: mftb({{ Rt = curTick(); }}); + 0x1a8: mftbu({{ Rt_uw = curTick() >> 32; }}); } 467: decode SPR { -- 2.30.2