Simulator hooks

From Sniper
Revision as of 06:27, 16 January 2012 by Wheirman (talk | contribs) (Created page with "Applications can interface with the simulation using a number of hooks defined in <code>sniper/include/sim_api.h</code>. To use these, include <code>#include <sim_api.h></c...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Applications can interface with the simulation using a number of hooks defined in sniper/include/sim_api.h. To use these, include #include <sim_api.h> in your application and compile it with the -I${GRAPHITE_ROOT}/include flag.

  • SimRoiStart() and SimRoiEnd(): start or end the region of interest (ROI), this will start or end detailed performance simulation
  • SimSetFreqMHz(proc, mhz): set the clock frequency of core proc to mhz MHz
  • SimSetOwnFreqMHz(mhz): set the clock frequency of the core executing this function to mhz MHz
  • SimGetFreqMHz(proc), SimGetOwnFreqMHz(): retrieve the clock frequency of a specific or the current core, in MHz
  • SimMarker(arg0, arg1): define a marker. Scripts register to receive a callback when these markers are executed, see Scripting
  • SimUser(cmd, arg): user-defined function returning a value, see Scripting
  • SimInSimulator(): return 1 when the application is being run inside Sniper, and 0 otherwise