changeset 434228c914e5 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=434228c914e5
description:
base: Ensure the CP annotation compiles again
A bit of revamping to get the CP annotate functionality to compile.
diffstat:
src/base/cp_annotate.cc | 20 +++++++++++++++-----
src/base/cp_annotate.hh | 43 +++++++++++++++++++++++++++++++++++--------
2 files changed, 50 insertions(+), 13 deletions(-)
diffs (154 lines):
diff -r 28c63d075e0c -r 434228c914e5 src/base/cp_annotate.cc
--- a/src/base/cp_annotate.cc Fri Sep 19 10:35:11 2014 -0400
+++ b/src/base/cp_annotate.cc Fri Sep 19 10:35:12 2014 -0400
@@ -28,7 +28,7 @@
* Authors: Ali Saidi
*/
-#include "arch/alpha/linux/threadinfo.hh"
+#include "arch/generic/linux/threadinfo.hh"
#include "arch/utility.hh"
#include "base/loader/object_file.hh"
#include "base/callback.hh"
@@ -37,6 +37,8 @@
#include "base/trace.hh"
#include "config/the_isa.hh"
#include "cpu/thread_context.hh"
+#include "debug/Annotate.hh"
+#include "debug/AnnotateVerbose.hh"
#include "sim/arguments.hh"
#include "sim/core.hh"
#include "sim/sim_exit.hh"
@@ -142,6 +144,17 @@
registerExitCallback(new AnnotateDumpCallback(this));
}
+
+uint64_t
+CPA::getFrame(ThreadContext *tc)
+{
+ // This code is ISA specific and will need to be changed
+ // if the annotation code is used for something other than Alpha
+ return (tc->readMiscRegNoEffect(TheISA::IPR_PALtemp23) &
+ ~ULL(0x3FFF));
+
+}
+
void
CPA::swSmBegin(ThreadContext *tc)
{
@@ -328,12 +341,9 @@
string sym;
Addr sym_addr = 0;
- SymbolTable *symtab = NULL;
-
if (!TheISA::inUserMode(tc)) {
debugSymbolTable->findNearestSymbol(next_pc, sym, sym_addr);
- symtab = debugSymbolTable;
} else {
Linux::ThreadInfo ti(tc);
string app = ti.curTaskName();
@@ -1285,7 +1295,7 @@
paramIn(cp, section, csprintf("nameCache%d.str", x), str);
paramIn(cp, section, csprintf("nameCache%d.int", x), sysi);
- nameCache[sys] = std::make_pair<std::string,int>(str, sysi);
+ nameCache[sys] = std::make_pair(str, sysi);
}
//smStack (SmStack)
diff -r 28c63d075e0c -r 434228c914e5 src/base/cp_annotate.hh
--- a/src/base/cp_annotate.hh Fri Sep 19 10:35:11 2014 -0400
+++ b/src/base/cp_annotate.hh Fri Sep 19 10:35:12 2014 -0400
@@ -1,4 +1,16 @@
/*
+ * Copyright (c) 2014 ARM Limited
+ * All rights reserved.
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 2006-2009 The Regents of The University of Michigan
* All rights reserved.
*
@@ -40,6 +52,7 @@
#include "base/hashmap.hh"
#include "base/trace.hh"
#include "base/types.hh"
+#include "debug/AnnotateQ.hh"
#include "config/cp_annotate.hh"
#include "config/the_isa.hh"
#include "sim/serialize.hh"
@@ -109,6 +122,24 @@
int32_t count = 1) { return; }
};
#else
+
+/**
+ * Provide a hash function for the CPI Id type
+ */
+__hash_namespace_begin
+template <>
+struct hash<std::pair<std::string, uint64_t> >
+{
+
+ size_t
+ operator()(const std::pair<std::string, uint64_t>& x) const
+ {
+ return hash<std::string>()(x.first);
+ }
+
+};
+__hash_namespace_end
+
class CPA : SimObject
{
public:
@@ -290,7 +321,7 @@
if (smi == 0) {
smCache[sysi-1][smid] = smi = ++numSm;
assert(smi < 65535);
- smMap.push_back(std::make_pair<int, Id>(sysi, smid));
+ smMap.push_back(std::make_pair(sysi, smid));
}
return smi;
}
@@ -325,7 +356,7 @@
{
NameCache::iterator i = nameCache.find(s);
if (i == nameCache.end()) {
- nameCache[s] = std::make_pair<std::string,int>(s->name(),
++numSys);
+ nameCache[s] = std::make_pair(s->name(), ++numSys);
i = nameCache.find(s);
// might need to put smstackid into map here, but perhaps not
//smStack.push_back(std::vector<int>());
@@ -354,7 +385,7 @@
qBytes.push_back(0);
qData.push_back(AnnotateList());
numQ[sys-1]++;
- qMap.push_back(std::make_pair<int, Id>(sys, qid));
+ qMap.push_back(std::make_pair(sys, qid));
}
return qi;
}
@@ -494,11 +525,7 @@
CPA(Params *p);
void startup();
- // This code is ISA specific and will need to be changed
- // if the annotation code is used for something other than Alpha
- inline uint64_t getFrame(ThreadContext *tc)
- { return (tc->readMiscRegNoEffect(TheISA::IPR_PALtemp23) &
- ~ULL(0x3FFF)); }
+ uint64_t getFrame(ThreadContext *tc);
static bool available() { return true; }
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev