summaryrefslogtreecommitdiff
path: root/src/cpu/static_inst.cc
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-02-10 22:19:27 -0800
committerNathan Binkert <nate@binkert.org>2009-02-10 22:19:27 -0800
commitf255957b902e8d7c0a274d8a2f5afe326a813be8 (patch)
tree6d63d8b930e9dc7a746ecbad8f64c44b875ac6f2 /src/cpu/static_inst.cc
parentcf4a00ca410226d3fd1b4db816938b7ddf78a333 (diff)
downloadgem5-f255957b902e8d7c0a274d8a2f5afe326a813be8.tar.xz
style
Diffstat (limited to 'src/cpu/static_inst.cc')
-rw-r--r--src/cpu/static_inst.cc43
1 files changed, 40 insertions, 3 deletions
diff --git a/src/cpu/static_inst.cc b/src/cpu/static_inst.cc
index 52a7ede03..01136bda1 100644
--- a/src/cpu/static_inst.cc
+++ b/src/cpu/static_inst.cc
@@ -40,11 +40,17 @@ StaticInst::DecodeCache StaticInst::decodeCache;
StaticInst::AddrDecodeCache StaticInst::addrDecodeCache;
StaticInst::cacheElement StaticInst::recentDecodes[2];
+using namespace std;
+
+StaticInst::~StaticInst()
+{
+ if (cachedDisassembly)
+ delete cachedDisassembly;
+}
+
void
StaticInst::dumpDecodeCacheStats()
{
- using namespace std;
-
cerr << "Decode hash table stats @ " << curTick << ":" << endl;
cerr << "\tnum entries = " << decodeCache.size() << endl;
cerr << "\tnum buckets = " << decodeCache.bucket_count() << endl;
@@ -81,6 +87,37 @@ StaticInstPtr
StaticInst::fetchMicroop(MicroPC micropc)
{
panic("StaticInst::fetchMicroop() called on instruction "
- "that is not microcoded.");
+ "that is not microcoded.");
}
+Addr
+StaticInst::branchTarget(Addr branchPC) const
+{
+ panic("StaticInst::branchTarget() called on instruction "
+ "that is not a PC-relative branch.");
+ M5_DUMMY_RETURN;
+}
+
+Addr
+StaticInst::branchTarget(ThreadContext *tc) const
+{
+ panic("StaticInst::branchTarget() called on instruction "
+ "that is not an indirect branch.");
+ M5_DUMMY_RETURN;
+}
+
+Request::Flags
+StaticInst::memAccFlags()
+{
+ panic("StaticInst::memAccFlags called on non-memory instruction");
+ return 0;
+}
+
+const string &
+StaticInst::disassemble(Addr pc, const SymbolTable *symtab) const
+{
+ if (!cachedDisassembly)
+ cachedDisassembly = new string(generateDisassembly(pc, symtab));
+
+ return *cachedDisassembly;
+}