On Jul 7, 2008, at 5:47 PM, nathan binkert wrote: >> Is it possible to put m5ops into a binary that is being simulated >> in m5 >> full system? In this case, I want very accurate timing of a getpid, >> and >> want to do resetstats, the system call, and then dump stats. So it >> would >> be nice if I could put these calls into a binary without actually >> inacting the system call utility to call the m5 binary. > > The answer to your question is, yes. You can stick m5ops into > binaries that you create. It's not even that difficult. That said, > the Alpha rpcc (read processor cycle counter) instruction is > implemented in M5 and probably already does what you want. In both cases take a look at the util directory. ccdrv is a kernel module that times accesses to a memory location. While that part isn't important you can see the use of the rpcc instruction to time events. It's by far the highest resolution timer available.
To see how to insert a m5op into a binary take a loop at util/m5. The directory contains the source to the m5 binary that we put on the disk image to execute m5ops. You can see how we insert an operation into a program as a asm constant and then wrap m5op so it can be called from C. Ali _______________________________________________ m5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
