Wattch: A framework for architectural-level power analysis and optimizations