dvfs_manager.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __DVFS_MANAGER_H
  2. #define __DVFS_MANAGER_H
  3. #include "subsecond_time.h"
  4. #include <vector>
  5. // Each process has a copy of all global frequencies, and of the core frequencies local to that process
  6. // In addition, process 0 has a copy of all core frequencies so as to quickly fulfill queries from the MCP/scripts
  7. class DvfsManager
  8. {
  9. public:
  10. enum DvfsGlobalDomain {
  11. DOMAIN_GLOBAL_DEFAULT,
  12. // If we wanted separate domains for e.g. DRAM, add them here and initialize them in DvfsManager::DvfsManager()
  13. DOMAIN_GLOBAL_MAX
  14. };
  15. DvfsManager();
  16. UInt32 getCoreDomainId(UInt32 core_id);
  17. const ComponentPeriod* getCoreDomain(UInt32 core_id);
  18. const ComponentPeriod* getGlobalDomain(DvfsGlobalDomain domain_id = DOMAIN_GLOBAL_DEFAULT);
  19. protected:
  20. // Make sure all frequency updates pass through the correct path
  21. void setCoreDomain(UInt32 core_id, ComponentPeriod new_freq);
  22. friend class MagicServer;
  23. private:
  24. UInt32 m_cores_per_socket;
  25. SubsecondTime m_transition_latency;
  26. UInt32 m_num_proc_domains;
  27. UInt32 m_num_app_cores;
  28. std::vector<ComponentPeriod> app_proc_domains;
  29. std::vector<ComponentPeriod> global_domains;
  30. };
  31. #endif /* __DVFS_MANAGER_H */