gem5-dev@gem5.org

The gem5 Developer List

View all threads

[S] Change in gem5/gem5[develop]: arch-arm: Improve debugging of CC regs accesses

GT
Giacomo Travaglini (Gerrit)
Tue, May 23, 2023 6:43 AM

Giacomo Travaglini has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/70718?usp=email )

(

1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
)Change subject: arch-arm: Improve debugging of CC regs accesses
......................................................................

arch-arm: Improve debugging of CC regs accesses

As of now we are simply printing the CC reg index which is
not particularly helpful. With this patch we actually print
the (NZ|C|V) reg name.

Change-Id: Ib4b56a372b25e5bc2b6b762d2ef3ff2084097cce
Signed-off-by: Giacomo Travaglini giacomo.travaglini@arm.com
Reviewed-by: Richard Cooper richard.cooper@arm.com
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70718
Maintainer: Jason Lowe-Power power.jg@gmail.com
Tested-by: kokoro noreply+kokoro@google.com

M src/arch/arm/regs/cc.hh
1 file changed, 23 insertions(+), 11 deletions(-)

Approvals:
Richard Cooper: Looks good to me, approved
Jason Lowe-Power: Looks good to me, approved
kokoro: Regressions pass

diff --git a/src/arch/arm/regs/cc.hh b/src/arch/arm/regs/cc.hh
index ba75527..474e48e 100644
--- a/src/arch/arm/regs/cc.hh
+++ b/src/arch/arm/regs/cc.hh
@@ -61,10 +61,31 @@
NumRegs
};

+const char * const RegName[NumRegs] = {

  • "nz",
  • "c",
  • "v",
  • "ge",
  • "fp",
  • "zero"
    +};
  • } // namespace cc_reg

-inline constexpr RegClass ccRegClass(CCRegClass, CCRegClassName,

  •    cc_reg::NumRegs, debug::CCRegs);
    

+class CCRegClassOps : public RegClassOps
+{

  • public:
  • std::string
  • regName(const RegId &id) const override
  • {
  •    return cc_reg::RegName[id.index()];
    
  • }
    +};

+static inline CCRegClassOps ccRegClassOps;
+
+inline constexpr RegClass ccRegClass = RegClass(CCRegClass, CCRegClassName,

  •    cc_reg::NumRegs, debug::CCRegs).ops(ccRegClassOps);
    

    namespace cc_reg
    {
    @@ -77,15 +98,6 @@
    Fp = ccRegClass[_FpIdx],
    Zero = ccRegClass[_ZeroIdx];

-const char * const RegName[NumRegs] = {

  • "nz",

  • "c",

  • "v",

  • "ge",

  • "fp",

  • "zero"
    -};

  • } // namespace cc_reg

    enum ConditionCode

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

Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ib4b56a372b25e5bc2b6b762d2ef3ff2084097cce
Gerrit-Change-Number: 70718
Gerrit-PatchSet: 3
Gerrit-Owner: Giacomo Travaglini giacomo.travaglini@arm.com
Gerrit-Reviewer: Andreas Sandberg andreas.sandberg@arm.com
Gerrit-Reviewer: Giacomo Travaglini giacomo.travaglini@arm.com
Gerrit-Reviewer: Jason Lowe-Power power.jg@gmail.com
Gerrit-Reviewer: Richard Cooper richard.cooper@arm.com
Gerrit-Reviewer: kokoro noreply+kokoro@google.com

Giacomo Travaglini has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/70718?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: arch-arm: Improve debugging of CC regs accesses ...................................................................... arch-arm: Improve debugging of CC regs accesses As of now we are simply printing the CC reg index which is not particularly helpful. With this patch we actually print the (NZ|C|V) reg name. Change-Id: Ib4b56a372b25e5bc2b6b762d2ef3ff2084097cce Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Richard Cooper <richard.cooper@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70718 Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com> --- M src/arch/arm/regs/cc.hh 1 file changed, 23 insertions(+), 11 deletions(-) Approvals: Richard Cooper: Looks good to me, approved Jason Lowe-Power: Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/arm/regs/cc.hh b/src/arch/arm/regs/cc.hh index ba75527..474e48e 100644 --- a/src/arch/arm/regs/cc.hh +++ b/src/arch/arm/regs/cc.hh @@ -61,10 +61,31 @@ NumRegs }; +const char * const RegName[NumRegs] = { + "nz", + "c", + "v", + "ge", + "fp", + "zero" +}; + } // namespace cc_reg -inline constexpr RegClass ccRegClass(CCRegClass, CCRegClassName, - cc_reg::NumRegs, debug::CCRegs); +class CCRegClassOps : public RegClassOps +{ + public: + std::string + regName(const RegId &id) const override + { + return cc_reg::RegName[id.index()]; + } +}; + +static inline CCRegClassOps ccRegClassOps; + +inline constexpr RegClass ccRegClass = RegClass(CCRegClass, CCRegClassName, + cc_reg::NumRegs, debug::CCRegs).ops(ccRegClassOps); namespace cc_reg { @@ -77,15 +98,6 @@ Fp = ccRegClass[_FpIdx], Zero = ccRegClass[_ZeroIdx]; -const char * const RegName[NumRegs] = { - "nz", - "c", - "v", - "ge", - "fp", - "zero" -}; - } // namespace cc_reg enum ConditionCode -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/70718?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ib4b56a372b25e5bc2b6b762d2ef3ff2084097cce Gerrit-Change-Number: 70718 Gerrit-PatchSet: 3 Gerrit-Owner: Giacomo Travaglini <giacomo.travaglini@arm.com> Gerrit-Reviewer: Andreas Sandberg <andreas.sandberg@arm.com> Gerrit-Reviewer: Giacomo Travaglini <giacomo.travaglini@arm.com> Gerrit-Reviewer: Jason Lowe-Power <power.jg@gmail.com> Gerrit-Reviewer: Richard Cooper <richard.cooper@arm.com> Gerrit-Reviewer: kokoro <noreply+kokoro@google.com>