Minimizing CPU energy in real-time systems with discrete speed management