Revision 52 wattch/power.c

View differences:

power.c
246 246
static double cycle_count = 0;
247 247
#define SWITCH_CYCLES 30
248 248
static int speed_delay[SWITCH_CYCLES];
249
#define ONCHIP_VREG_LOSS_LOW 0.220
250
#define ONCHIP_VREG_LOSS_HIGH 0.120
249 251

  
250 252
static double max_cycle_power_cc1 = 0.0;
251 253
static double max_cycle_power_cc2 = 0.0;
......
781 783
  total_parasitic_cc2 += pow(current, 2) * PARASITIC_OHM;
782 784
  total_parasitic_cc3 += pow(current, 2) * PARASITIC_OHM;
783 785

  
786
  // Onchip regulator paraisitc loss
787
  if (speed_grade == 0) {
788
      total_parasitic_cc1 += ONCHIP_VREG_LOSS_LOW;
789
      total_parasitic_cc2 += ONCHIP_VREG_LOSS_LOW;
790
      total_parasitic_cc3 += ONCHIP_VREG_LOSS_LOW;
791
  } else {
792
      total_parasitic_cc1 += ONCHIP_VREG_LOSS_HIGH;
793
      total_parasitic_cc2 += ONCHIP_VREG_LOSS_HIGH;
794
      total_parasitic_cc3 += ONCHIP_VREG_LOSS_HIGH;
795
  }
796

  
784 797
  max_cycle_power_cc1 = MAX(max_cycle_power_cc1,current_total_cycle_power_cc1);
785 798
  max_cycle_power_cc2 = MAX(max_cycle_power_cc2,current_total_cycle_power_cc2);
786 799
  max_cycle_power_cc3 = MAX(max_cycle_power_cc3,current_total_cycle_power_cc3);

Also available in: Unified diff