Hello,

I am attempting to instrument branch instructions in a program in gem5. So far, I have code in AtomicSimpleCPU which determines when branch instructions are executed. For every branch, I would like to call an instrumentation function and then return to execution of the simulated program. This would be fairly simple, but I would like to execute the instrumentation function within the simulator, so the instrumentation time is taken into account on the simulator statistics.

Is it possible to do something like this? Any ideas on how to do this? The function could be compiled in with the program, so we might be able to instrument by manually setting up arguments and changing the PC to the instrumentation function. Another idea I had would be to have two thread contexts for one CPU with one running the application and one doing instrumentation, and switching between them as needed. Is this sort of thing possible; is there any simulation time used by thread context switches?

Thanks,
David G.

--
David Gloe
gloex...@umn.edu da...@cs.umn.edu dcg...@gmail.com
Masters Student, Computer Science
University of Minnesota

_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to