magic_server.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef MAGIC_SERVER_H
  2. #define MAGIC_SERVER_H
  3. #include "fixed_types.h"
  4. #include "progress.h"
  5. class MagicServer
  6. {
  7. public:
  8. // data type to hold arguments in a HOOK_MAGIC_MARKER callback
  9. struct MagicMarkerType {
  10. thread_id_t thread_id;
  11. core_id_t core_id;
  12. UInt64 arg0, arg1;
  13. const char* str;
  14. };
  15. MagicServer();
  16. ~MagicServer();
  17. UInt64 Magic(thread_id_t thread_id, core_id_t core_id, UInt64 cmd, UInt64 arg0, UInt64 arg1);
  18. bool inROI(void) const { return m_performance_enabled; }
  19. static UInt64 getGlobalInstructionCount(void);
  20. // To be called while holding the thread manager lock
  21. UInt64 Magic_unlocked(thread_id_t thread_id, core_id_t core_id, UInt64 cmd, UInt64 arg0, UInt64 arg1);
  22. UInt64 setFrequency(UInt64 core_number, UInt64 freq_in_mhz);
  23. UInt64 getFrequency(UInt64 core_number);
  24. void enablePerformance();
  25. void disablePerformance();
  26. UInt64 setPerformance(bool enabled);
  27. UInt64 setInstrumentationMode(UInt64 sim_api_opt);
  28. void setProgress(float progress) { m_progress.setProgress(progress); }
  29. private:
  30. bool m_performance_enabled;
  31. Progress m_progress;
  32. };
  33. #endif // SYNC_SERVER_H