Skip to content

Commit

Permalink
Stop State and Throttle Sensor Updates
Browse files Browse the repository at this point in the history
Change-Id: Ic2589a9e3fb5bad67ce85fb7a5f2c3e9af9f5047
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41887
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Shawn M. McCarney <shawnmm@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
  • Loading branch information
marthabroyles authored and wilbryan committed Jun 16, 2017
1 parent ca4e0ea commit 2c557cd
Show file tree
Hide file tree
Showing 12 changed files with 134 additions and 71 deletions.
13 changes: 0 additions & 13 deletions src/occ_405/amec/amec_analytics.c
Expand Up @@ -190,13 +190,6 @@ void amec_analytics_main(void)
return;
}

g_amec->packednapsleep[0] = (g_amec->proc[0].winkcnt4ms.sample<<8) +
g_amec->proc[0].sleepcnt4ms.sample;
// There are no other elements in proc[] array other than element 0
g_amec->packednapsleep[1] = 0;
g_amec->packednapsleep[2] = 0;
g_amec->packednapsleep[3] = 0;

switch (g_amec->analytics_group)
{
case 45: // Group 45
Expand Down Expand Up @@ -342,12 +335,6 @@ void amec_analytics_main(void)
l=l+1;
}

g_amec->g44_avg[(i*MSA)+48] = g_amec->g44_avg[(i*MSA)+48] +
(UINT32)(g_amec->proc[i].winkcnt4ms.sample<<3); // counter of cores that entered winkle for at least part of the 2msec interval: 1/8th resolution
g_amec->g44_avg[(i*MSA)+49] = g_amec->g44_avg[(i*MSA)+49] +
(UINT32)(g_amec->proc[i].sleepcnt4ms.sample<<3); // counter of cores that entered sleep for at least part of the 2msec interval: 1/8th resolution


m=0; // counter for actual configured # of cores - 1.
for (j=0; j<12; j++) // Group 45 supports up to 12 cores to be configured per OCC chip
{
Expand Down
23 changes: 23 additions & 0 deletions src/occ_405/amec/amec_controller.c
Expand Up @@ -143,6 +143,17 @@ void amec_controller_proc_thermal()
g_amec->thermalproc.freq_request = amec_controller_speed2freq(
g_amec->thermalproc.speed_request,
g_amec->sys.fmax);

// Update the Processor OT Throttle Sensor
if(g_amec->thermalproc.freq_request < g_amec->sys.fmax)
{
// frequency is less than max indicate throttle due to OT
sensor_update(AMECSENSOR_PTR(PROCOTTHROT), 1);
}
else // not currently throttled due to OT
{
sensor_update(AMECSENSOR_PTR(PROCOTTHROT), 0);
}
}

//*************************************************************************
Expand Down Expand Up @@ -235,6 +246,18 @@ void amec_controller_dimm_thermal()

// Generate the new thermal speed request
g_amec->thermaldimm.speed_request = (uint16_t) l_mem_speed;

// Update the Memory OT Throttle Sensor
if(g_amec->thermaldimm.speed_request < AMEC_MEMORY_MAX_STEP)
{
// Memory speed is less than max indicate throttle due to OT
sensor_update(AMECSENSOR_PTR(MEMOTTHROT), 1);
}
else // not currently throttled due to OT
{
sensor_update(AMECSENSOR_PTR(MEMOTTHROT), 0);
}

}


Expand Down
1 change: 0 additions & 1 deletion src/occ_405/amec/amec_init.c
Expand Up @@ -334,7 +334,6 @@ void amec_init_gamec_struct(void)
g_amec->index_probe250us[l_idx] = 0; // Initialize all offsets to 0 (used only if size > 2)
}

// g_amec->ptr_probe250us[1] = g_amec->proc[0].sleepcnt2ms.sample;
// g_amec->ptr_probe250us[2] = &g_amec->g44_avg[(0*MSA)+49];
// g_amec->ptr_probe250us[2] = g_amec->ptr_probe250us[2]+2; // Point to low 16 bits of g44_avg
// g_amec->ptr_probe250us[3] = &g_amec->proc[0].core[0].thread[0].util2ms_thread;
Expand Down
20 changes: 20 additions & 0 deletions src/occ_405/amec/amec_pcap.c
Expand Up @@ -389,6 +389,26 @@ void amec_power_control(void)
// Calculate the performance preserving bounds voting box input freq
amec_ppb_fmax_calc();
}

// Update the Processor and Memory Throttle due to power sensors
if(g_amec->proc[0].pwr_votes.proc_pcap_vote < G_proc_fmax_mhz)
{
// Frequency is being throttled due to power cap
sensor_update(AMECSENSOR_PTR(PROCPWRTHROT), 1);
}
else // not currently throttled due to power
{
sensor_update(AMECSENSOR_PTR(PROCPWRTHROT), 0);
}
if(g_amec->pcap.active_mem_level != 0)
{
// Memory is being throttled due to power cap
sensor_update(AMECSENSOR_PTR(MEMPWRTHROT), 1);
}
else // not currently throttled due to power
{
sensor_update(AMECSENSOR_PTR(MEMPWRTHROT), 0);
}
}
else
{
Expand Down
38 changes: 12 additions & 26 deletions src/occ_405/amec/amec_sensors_core.c
Expand Up @@ -494,38 +494,24 @@ void amec_calc_freq_and_util_sensors(CoreData * i_core_data_ptr, uint8_t i_core)
// No sensors to update for perThread Util

// ------------------------------------------------------
// Per Core Sleep/Winkle Count
// Per Core Stop State Sensors
// ------------------------------------------------------

// Get deepest idle state entered by the chiplet since the last read
// Get deepest idle state requested since the last read. bits 12:15 OCC stop state hist reg
temp16 = CONVERT_UINT64_UINT16_UPPER(i_core_data_ptr->stop_state_hist);
temp16 &= 0x000F;
if(temp16 != 0x000F) // Don't update with reset value
{
sensor_update(AMECSENSOR_ARRAY_PTR(STOPDEEPREQC0,i_core), temp16);
}

// The SLEEPCNT and WINKLECNT sensors are updated in amec_slv_state_0() function
// Get deepest idle state entered by the chiplet since the last read bits 16:19 OCC stop state hist reg
temp16 = CONVERT_UINT64_UINT16_MIDUPPER(i_core_data_ptr->stop_state_hist);
temp16 = temp16 & 0xF000;
temp16 = temp16 >> 12;
switch(temp16)
temp16 = temp16 & 0x000F;
if(temp16 != 0x000F) // Don't update with reset value
{
case 0: // Stop 0: Run State
case 1: // Stop 1: Nap
break;
case 2: // Stop 2: Fast Sleep
case 3: // Stop 3: Fast Sleep @ Vmin
case 4: // Stop 4: Deep Sleep "instant on"
case 5: // Stop 5-7: Higher Latency Deep Sleep
case 6:
case 7:
case 8: // Stop 8-10: Deep Sleep+
case 9:
case 10:
SETBIT(g_amec->proc[0].sleep_cnt,i_core);
break;
case 11: // Stop 11-15: Quad Deep Winkle
case 12:
case 13:
case 14:
case 15:
SETBIT(g_amec->proc[0].winkle_cnt,i_core);
break;
sensor_update(AMECSENSOR_ARRAY_PTR(STOPDEEPACTC0,i_core), temp16);
}

// ------------------------------------------------------
Expand Down
11 changes: 0 additions & 11 deletions src/occ_405/amec/amec_slave_smh.c
Expand Up @@ -398,17 +398,6 @@ void amec_slv_state_0(void)
//-------------------------------------------------------
amec_update_centaur_sensors(CENTAUR_0);
*/
//-------------------------------------------------------
// Update Sleep Count & Winkle Count Sensors
//-------------------------------------------------------
sensor_update(AMECSENSOR_PTR(SLEEPCNT4MSP0),
__builtin_popcount( g_amec->proc[0].sleep_cnt));
g_amec->proc[0].sleep_cnt = 0;

sensor_update(AMECSENSOR_PTR(WINKCNT4MSP0),
__builtin_popcount(g_amec->proc[0].winkle_cnt));
g_amec->proc[0].winkle_cnt = 0;

//-------------------------------------------------------
// Update vector sensors
//-------------------------------------------------------
Expand Down
13 changes: 6 additions & 7 deletions src/occ_405/amec/amec_sys.h
Expand Up @@ -298,6 +298,8 @@ typedef struct
sensor_t ppic;
sensor_t pwrpx250us;
sensor_t tempc;
sensor_t stopdeepreqc;
sensor_t stopdeepactc;

//-----------------------------------
// Previous Tick Data
Expand Down Expand Up @@ -456,8 +458,6 @@ typedef struct
sensor_t curvdd;
sensor_t pwrvcsviovdn;
sensor_t pwr250usmem;
sensor_t sleepcnt4ms;
sensor_t winkcnt4ms;
sensor_t sp250us;
sensor_t tempprocavg;
vectorSensor_t temp4ms_vector;
Expand All @@ -471,6 +471,8 @@ typedef struct
sensor_t temp2mscent;
sensor_t tempdimmthrm;
sensor_t memsp2ms_tls;
sensor_t mempwrthrot;
sensor_t memotthrot;

// Nimbus DIMM Sensors
sensor_t tempdimm[NUM_DIMM_PORTS*NUM_DIMMS_PER_I2CPORT];
Expand All @@ -483,11 +485,10 @@ typedef struct
sensor_t curvdn;
sensor_t pwrvdd;
sensor_t pwrvdn;
sensor_t procpwrthrot;
sensor_t procotthrot;

// Calculations & Interim Data
uint16_t sleep_cnt;
uint16_t winkle_cnt;

uint16_t core_max_freq; // Maximum requested freq for all cores on chip.

// Parameters used through Amester interface
Expand Down Expand Up @@ -727,8 +728,6 @@ typedef struct
uint8_t analytics_slot;
// Used to hold selected analytics group
uint16_t analytics_array[STREAM_VECTOR_SIZE_EX];
// for group 44 support core bit maps of their napping cores (upper byte) and sleeping cores (lower byte)
uint16_t packednapsleep[MAX_NUM_CHIP_MODULES];
// holds the sum of all the memory power sensors (32msec)
uint16_t total_memory_power;
uint16_t probetemp[NUM_AMEC_FW_PROBES]; // array holding temporary probe data
Expand Down
1 change: 1 addition & 0 deletions src/occ_405/cmdh/cmdh_fsp_cmds.c
Expand Up @@ -118,6 +118,7 @@ errlHndl_t cmdh_tmgt_poll (const cmdh_fsp_cmd_t * i_cmd_ptr,
}
else
{
CMDH_TRAC_ERR("cmdh_tmgt_poll: Invalid version 0x%02X", l_poll_cmd->version);
l_rc = ERRL_RC_INVALID_DATA;
break;
}
Expand Down
6 changes: 3 additions & 3 deletions src/occ_405/dcom/dcom.h
Expand Up @@ -200,13 +200,13 @@ typedef struct __attribute__ ((packed))
uint16_t memsp2msp0mx[MAX_NUM_MEM_CONTROLLERS]; // [148]
uint16_t pwrproc; // [164]
uint16_t pwr250usmemp0; // [166]
uint16_t sleepcnt4msp0; // [168]
uint16_t winkcnt4msp0; // [170]
uint16_t reserved0; // [168]
uint16_t reserved1; // [170]
uint16_t tempprocavg; // [172]
uint16_t tempprocthermal; // [174]
uint16_t utilcy[MAX_CORES]; // [176]
uint16_t vrfan; // [224]
uint16_t reserved0; // [226]
uint16_t reserved2; // [226]
uint16_t mrd2msp0mx[MAX_NUM_MEM_CONTROLLERS]; // [228]
uint16_t mwr2msp0mx[MAX_NUM_MEM_CONTROLLERS]; // [244]
uint16_t pwrpx250usp0cy[MAX_CORES]; // [260]
Expand Down
58 changes: 55 additions & 3 deletions src/occ_405/sensor/sensor_enum.h
Expand Up @@ -117,8 +117,6 @@ enum e_gsid
PWR250USVDD0, // from APSS (no change)
PWRVCSVIOVDN, // from APSS - rename from PWR250USVCS0 to show what it includes
PWR250USMEM0,
SLEEPCNT4MSP0,
WINKCNT4MSP0,
SP250USP0,
TEMPPROCAVG,
TEMPPROCTHRM,
Expand All @@ -128,7 +126,8 @@ enum e_gsid
VOLTVDNSENSE, // chip voltage (remote sense adjusted for loadline)
PWRVDD, // calculated from AVSBUS data
PWRVDN, // calculated from AVSBUS data

PROCPWRTHROT,
PROCOTTHROT,
TEMPQ0,
TEMPQ1,
TEMPQ2,
Expand Down Expand Up @@ -461,6 +460,56 @@ enum e_gsid
TEMPC22,
TEMPC23,

STOPDEEPREQC0,
STOPDEEPREQC1,
STOPDEEPREQC2,
STOPDEEPREQC3,
STOPDEEPREQC4,
STOPDEEPREQC5,
STOPDEEPREQC6,
STOPDEEPREQC7,
STOPDEEPREQC8,
STOPDEEPREQC9,
STOPDEEPREQC10,
STOPDEEPREQC11,
STOPDEEPREQC12,
STOPDEEPREQC13,
STOPDEEPREQC14,
STOPDEEPREQC15,
STOPDEEPREQC16,
STOPDEEPREQC17,
STOPDEEPREQC18,
STOPDEEPREQC19,
STOPDEEPREQC20,
STOPDEEPREQC21,
STOPDEEPREQC22,
STOPDEEPREQC23,

STOPDEEPACTC0,
STOPDEEPACTC1,
STOPDEEPACTC2,
STOPDEEPACTC3,
STOPDEEPACTC4,
STOPDEEPACTC5,
STOPDEEPACTC6,
STOPDEEPACTC7,
STOPDEEPACTC8,
STOPDEEPACTC9,
STOPDEEPACTC10,
STOPDEEPACTC11,
STOPDEEPACTC12,
STOPDEEPACTC13,
STOPDEEPACTC14,
STOPDEEPACTC15,
STOPDEEPACTC16,
STOPDEEPACTC17,
STOPDEEPACTC18,
STOPDEEPACTC19,
STOPDEEPACTC20,
STOPDEEPACTC21,
STOPDEEPACTC22,
STOPDEEPACTC23,

// ------------------------------------------------------
// Regulator Sensors
// ------------------------------------------------------
Expand Down Expand Up @@ -513,6 +562,9 @@ enum e_gsid
LOCDIMMAXP0M6,
LOCDIMMAXP0M7,

MEMPWRTHROT,
MEMOTTHROT,

// Individual DIMM temperatures (NIMBUS)
TEMPDIMM00,
TEMPDIMM01,
Expand Down
11 changes: 8 additions & 3 deletions src/occ_405/sensor/sensor_info.c
Expand Up @@ -31,6 +31,7 @@
#define AMEEFP_1MS_IN_HZ AMEFP(1,3) // 1000 Hz
#define AMEEFP_2MS_IN_HZ AMEFP(5,2) // 500 Hz
#define AMEEFP_4MS_IN_HZ AMEFP(25,1) // 250 Hz
#define AMEEFP_16MS_IN_HZ AMEFP(625,-1) // 62.5 Hz
#define AMEEFP_32MS_IN_HZ AMEFP(3125,-2) // 31.25 Hz
#define AMEEFP_3S_IN_HZ AMEFP(333,-3) // 0.333 Hz
#define AMEFP_SCALE_0_16384 AMEFP(610352,-8) // scalar so that digital 16384=100%
Expand Down Expand Up @@ -305,8 +306,6 @@ const sensor_info_t G_sensor_info[] =
SENSOR_INFO_T_ENTRY( PWR250USVDD0, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( PWRVCSVIOVDN, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( PWR250USMEM0, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( SLEEPCNT4MSP0, "#\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( WINKCNT4MSP0, "#\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( SP250USP0, "%\0", AMEC_SENSOR_TYPE_FREQ, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( TEMPPROCAVG, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( TEMPPROCTHRM, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ),
Expand All @@ -316,6 +315,8 @@ const sensor_info_t G_sensor_info[] =
SENSOR_INFO_T_ENTRY( VOLTVDNSENSE, "mV\0", AMEC_SENSOR_TYPE_VOLTAGE, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, -1) ),
SENSOR_INFO_T_ENTRY( PWRVDD, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_500US_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( PWRVDN, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_500US_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( PROCPWRTHROT, "#\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( PROCOTTHROT, "#\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_16MS_IN_HZ, AMEFP( 1, 0) ),

SENS_QUAD_ENTRY_SET( TEMPQ, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ),

Expand All @@ -342,7 +343,9 @@ const sensor_info_t G_sensor_info[] =
SENS_CORE_ENTRY_SET( PPICP0C, "%\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ),
SENS_CORE_ENTRY_SET( PWRPX250USP0C, "W\0", AMEC_SENSOR_TYPE_POWER, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ),
SENS_CORE_ENTRY_SET( TEMPC, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ),

SENS_CORE_ENTRY_SET( STOPDEEPREQC, "ss\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ),
SENS_CORE_ENTRY_SET( STOPDEEPACTC, "ss\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_CORE, AMEC_SENSOR_NONUM, AMEEFP_4MS_IN_HZ, AMEFP( 1, 0) ),

/* ==MemSensors== NameString Units Type Location Number Freq ScaleFactor */
SENS_MEMC_ENTRY_SET( MRD2MSP0M, "GBs\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 128, -5) ),
SENS_MEMC_ENTRY_SET( MWR2MSP0M, "GBs\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 128, -5) ),
Expand All @@ -351,6 +354,8 @@ const sensor_info_t G_sensor_info[] =
SENS_DIMM_ENTRY_SET( TEMPDIMM, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_32MS_IN_HZ, AMEFP( 1, 0) ),
SENS_MEMC_ENTRY_SET( TEMPDIMMAXP0M, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ),
SENS_MEMC_ENTRY_SET( LOCDIMMAXP0M, "loc\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( MEMPWRTHROT, "#\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( MEMOTTHROT, "#\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_16MS_IN_HZ, AMEFP( 1, 0) ),

/* ==CentaurSensors== NameString Units Type Location Number Freq ScaleFactor */
SEN_CENTR_ENTRY_SET( MAC2MSP0M, "rps\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ),
Expand Down

0 comments on commit 2c557cd

Please sign in to comment.