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)
Wed, May 17, 2023 10:56 AM

Attention is currently required from: Richard Cooper.

Hello Richard Cooper,

I'd like you to do a code review.
Please visit

 https://gem5-review.googlesource.com/c/public/gem5/+/70718?usp=email

to review the following change.

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

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

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: newchange
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ib4b56a372b25e5bc2b6b762d2ef3ff2084097cce
Gerrit-Change-Number: 70718
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini giacomo.travaglini@arm.com
Gerrit-Reviewer: Richard Cooper richard.cooper@arm.com
Gerrit-Attention: Richard Cooper richard.cooper@arm.com

Attention is currently required from: Richard Cooper. Hello Richard Cooper, I'd like you to do a code review. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/70718?usp=email to review the following change. 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> --- M src/arch/arm/regs/cc.hh 1 file changed, 23 insertions(+), 11 deletions(-) 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: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ib4b56a372b25e5bc2b6b762d2ef3ff2084097cce Gerrit-Change-Number: 70718 Gerrit-PatchSet: 1 Gerrit-Owner: Giacomo Travaglini <giacomo.travaglini@arm.com> Gerrit-Reviewer: Richard Cooper <richard.cooper@arm.com> Gerrit-Attention: Richard Cooper <richard.cooper@arm.com>