Re: [GXemul-devel] [GXemul-users] Gxemul
Status: Alpha
Brought to you by:
gavare
From: Anders G. <ga...@gm...> - 2010-05-11 06:25:48
|
Hi Vincent, Tis 2010-05-11 klockan 01:20 -0400 skrev Vincent Mirian: > Hi all, > > I have a few questions... :-) > > I would like to create execution traces of a mips processor from > gxemul. I would like to run the simulation for a while (until a > breakpoint let's say) and then save the _execution_ traces in a file. I didn't quite understand which of the following two you want to do: a) run for a while (tracing instructions), hit a breakpoint, exit (saving the traced instruction) or b) run for a while without instruction trace, hit a breakpoint, turn on instruction trace, and then continue (saving instruction trace from here on). Both should be possible by hacking the source code. A brutal one-off approach could be to just hack in something in DYNTRANS_RUN_INSTR_DEF(struct cpu *cpu) in cpu_dyntrans.cc, like if (single_step || cpu->machine->instruction_trace || cpu->machine->register_dump) { /* * Single-step: */ FILE *old = stdout; // HACK! stdout = fopen("trace-output.txt", "a"); // HACK! struct DYNTRANS_IC *ic = cpu->cd.DYNTRANS_ARCH.next_ic; ... /* Execute just one instruction: */ I; n_instrs = 1; fclose(stdout); // HACK! stdout = old; // HACK! } else if (cpu->machine->statistics.enabled) { to redirect stdout to a file during single step and instruction trace. But it would probably be horribly slow. > Furthermore, I do not want to trace the cycle time that the processor > is halted for memory requests. That's easy. (Because GXemul currently does not simulate caches or memory latencies. :-)) Anders |