gem5-dev@gem5.org

The gem5 Developer List

View all threads

[XS] Change in gem5/gem5[develop]: arch-riscv: Fix invalid std::map access

AR
Alex Richardson (Gerrit)
Wed, Mar 8, 2023 11:47 AM

Alex Richardson has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/68759?usp=email )

Change subject: arch-riscv: Fix invalid std::map access
......................................................................

arch-riscv: Fix invalid std::map access

The CSRData map uses a RISC-V CSR number as the key rather than one of
the MISCREG_* enumerators. Use MiscRegNames[] instead to stringify the
argument for the debug message.

Change-Id: I2533bc29d148d3b34c01022eeaeedf64c39a99b9

M src/arch/riscv/isa.cc
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/arch/riscv/isa.cc b/src/arch/riscv/isa.cc
index d778957..7964de5 100644
--- a/src/arch/riscv/isa.cc
+++ b/src/arch/riscv/isa.cc
@@ -510,7 +510,7 @@
{
if (idx >= MISCREG_CYCLE && idx <= MISCREG_HPMCOUNTER31) {
// Ignore writes to HPM counters for now

  •    warn("Ignoring write to %s.\n", CSRData.at(idx).name);
    
  •    warn("Ignoring write to miscreg %s.\n", MiscRegNames[idx]);
    } else {
        switch (idx) {
    

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/68759?usp=email
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: I2533bc29d148d3b34c01022eeaeedf64c39a99b9
Gerrit-Change-Number: 68759
Gerrit-PatchSet: 1
Gerrit-Owner: Alex Richardson alexrichardson@google.com
Gerrit-MessageType: newchange

Alex Richardson has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/68759?usp=email ) Change subject: arch-riscv: Fix invalid std::map access ...................................................................... arch-riscv: Fix invalid std::map access The CSRData map uses a RISC-V CSR number as the key rather than one of the MISCREG_* enumerators. Use MiscRegNames[] instead to stringify the argument for the debug message. Change-Id: I2533bc29d148d3b34c01022eeaeedf64c39a99b9 --- M src/arch/riscv/isa.cc 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/riscv/isa.cc b/src/arch/riscv/isa.cc index d778957..7964de5 100644 --- a/src/arch/riscv/isa.cc +++ b/src/arch/riscv/isa.cc @@ -510,7 +510,7 @@ { if (idx >= MISCREG_CYCLE && idx <= MISCREG_HPMCOUNTER31) { // Ignore writes to HPM counters for now - warn("Ignoring write to %s.\n", CSRData.at(idx).name); + warn("Ignoring write to miscreg %s.\n", MiscRegNames[idx]); } else { switch (idx) { -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/68759?usp=email 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: I2533bc29d148d3b34c01022eeaeedf64c39a99b9 Gerrit-Change-Number: 68759 Gerrit-PatchSet: 1 Gerrit-Owner: Alex Richardson <alexrichardson@google.com> Gerrit-MessageType: newchange