#include <fstream>
#include <iomanip>
+#include "arch/regfile.hh"
#include "base/loader/symtab.hh"
#include "cpu/base.hh"
#include "cpu/exetrace.hh"
#include "sim/system.hh"
using namespace std;
-
+using namespace TheISA;
////////////////////////////////////////////////////////////////////////
//
void
Trace::InstRecord::dump(ostream &outs)
{
- if (flags[INTEL_FORMAT]) {
+ if (flags[PRINT_REG_DELTA])
+ {
+ outs << "PC = 0x" << setbase(16)
+ << setfill('0')
+ << setw(16) << PC << endl;
+ outs << setbase(10)
+ << setfill(' ')
+ << setw(0);
+ /*
+ int numSources = staticInst->numSrcRegs();
+ int numDests = staticInst->numDestRegs();
+ outs << "Sources:";
+ for(int x = 0; x < numSources; x++)
+ {
+ int sourceNum = staticInst->srcRegIdx(x);
+ if(sourceNum < FP_Base_DepTag)
+ outs << " " << getIntRegName(sourceNum);
+ else if(sourceNum < Ctrl_Base_DepTag)
+ outs << " " << getFloatRegName(sourceNum - FP_Base_DepTag);
+ else
+ outs << " " << getMiscRegName(sourceNum - Ctrl_Base_DepTag);
+ }
+ outs << endl;
+ outs << "Destinations:";
+ for(int x = 0; x < numDests; x++)
+ {
+ int destNum = staticInst->destRegIdx(x);
+ if(destNum < FP_Base_DepTag)
+ outs << " " << getIntRegName(destNum);
+ else if(destNum < Ctrl_Base_DepTag)
+ outs << " " << getFloatRegName(destNum - FP_Base_DepTag);
+ else
+ outs << " " << getMiscRegName(destNum - Ctrl_Base_DepTag);
+ }
+ outs << endl;*/
+ }
+ else if (flags[INTEL_FORMAT]) {
#if FULL_SYSTEM
bool is_trace_system = (cpu->system->name() == trace_system);
#else
"print fetch sequence number", false);
Param<bool> exe_trace_print_cp_seq(&exeTraceParams, "print_cpseq",
"print correct-path sequence number", false);
+Param<bool> exe_trace_print_reg_delta(&exeTraceParams, "print_reg_delta",
+ "print which registers changed to what", false);
Param<bool> exe_trace_pc_symbol(&exeTraceParams, "pc_symbol",
"Use symbols for the PC if available", true);
Param<bool> exe_trace_intel_format(&exeTraceParams, "intel_format",
flags[PRINT_INT_REGS] = exe_trace_print_iregs;
flags[PRINT_FETCH_SEQ] = exe_trace_print_fetchseq;
flags[PRINT_CP_SEQ] = exe_trace_print_cp_seq;
+ flags[PRINT_REG_DELTA] = exe_trace_print_reg_delta;
flags[PC_SYMBOL] = exe_trace_pc_symbol;
flags[INTEL_FORMAT] = exe_trace_intel_format;
trace_system = exe_trace_system;
help="Print fetch sequence numbers in trace output")
bool_option("print-cpseq", default=False,
help="Print correct path sequence numbers in trace output")
+#bool_option("print-reg-delta", default=False,
+# help="Print which registers changed to what in trace output")
options = attrdict()
arguments = []
objects.ExecutionTrace.print_iregs = options.print_iregs
objects.ExecutionTrace.print_fetchseq = options.print_fetch_seq
objects.ExecutionTrace.print_cpseq = options.print_cpseq
+ #objects.ExecutionTrace.print_reg_delta = options.print_reg_delta
sys.argv = arguments
sys.path = [ os.path.dirname(sys.argv[0]) ] + sys.path