Sandipan Das has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/40937 )

Change subject: arch-power: Add time base instructions
......................................................................

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 <[email protected]>
---
M src/arch/power/insts/integer.cc
M src/arch/power/isa/decoder.isa
2 files changed, 8 insertions(+), 2 deletions(-)



diff --git a/src/arch/power/insts/integer.cc b/src/arch/power/insts/integer.cc
index 115b867..c43791b 100644
--- a/src/arch/power/insts/integer.cc
+++ b/src/arch/power/insts/integer.cc
@@ -49,13 +49,17 @@
                !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 4ecee98..aeee29a 100644
--- a/src/arch/power/isa/decoder.isa
+++ b/src/arch/power/isa/decoder.isa
@@ -973,6 +973,8 @@
                             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 {

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40937
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Idb619ec3179b2a85925998282075bde8651c68c2
Gerrit-Change-Number: 40937
Gerrit-PatchSet: 1
Gerrit-Owner: Sandipan Das <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to