diff options
author | mbroyles <mbroyles@us.ibm.com> | 2018-08-30 13:28:41 -0500 |
---|---|---|
committer | Martha Broyles <mbroyles@us.ibm.com> | 2018-09-05 08:54:45 -0500 |
commit | 0f604d61c2858821ff81c7f3028eca636800574a (patch) | |
tree | 49e89a020f947d46fd6c5246d16835ff3ed29a02 /src | |
parent | d84708e4e986ce7650d17b380236b6893c7db9e1 (diff) | |
download | talos-occ-0f604d61c2858821ff81c7f3028eca636800574a.tar.gz talos-occ-0f604d61c2858821ff81c7f3028eca636800574a.zip |
Add WOF sensors for AMESTER
Fix char/obs to active state change going to UT on PowerVM
Change-Id: I7ecad134b31b89a392271169400c0240416d62b7
RTC: 197146
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65520
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Tested-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/occ_405/amec/amec_dps.c | 27 | ||||
-rwxr-xr-x | src/occ_405/amec/amec_part.h | 7 | ||||
-rwxr-xr-x | src/occ_405/amec/amec_sys.h | 2 | ||||
-rwxr-xr-x | src/occ_405/occbuildname.c | 2 | ||||
-rwxr-xr-x | src/occ_405/sensor/sensor.h | 1 | ||||
-rwxr-xr-x | src/occ_405/sensor/sensor_enum.h | 18 | ||||
-rwxr-xr-x | src/occ_405/sensor/sensor_info.c | 16 | ||||
-rwxr-xr-x | src/occ_405/sensor/sensor_table.c | 39 | ||||
-rwxr-xr-x | src/occ_405/state.c | 8 | ||||
-rw-r--r-- | src/occ_405/wof/wof.c | 17 | ||||
-rw-r--r-- | src/occ_405/wof/wof.h | 10 |
11 files changed, 93 insertions, 54 deletions
diff --git a/src/occ_405/amec/amec_dps.c b/src/occ_405/amec/amec_dps.c index e41783a..40a623f 100755 --- a/src/occ_405/amec/amec_dps.c +++ b/src/occ_405/amec/amec_dps.c @@ -156,7 +156,7 @@ void amec_dps_partition_update_sensors(const uint16_t i_part_id) uint32_t l_cg_slack_accumulator = 0; uint16_t l_cg_util_slack_perc = 0; uint32_t l_divide32[2] = {0, 0}; - + static bool L_trace = FALSE; /*------------------------------------------------------------------------*/ /* Code */ /*------------------------------------------------------------------------*/ @@ -184,7 +184,17 @@ void amec_dps_partition_update_sensors(const uint16_t i_part_id) } // Update the sensor of the utilization slack - sensor_update(&g_amec->part_config.part_list[i_part_id].util2msslack, l_cg_util_slack_perc); + // verify the sensor exists for the core group + if(i_part_id < AMEC_PART_MAX_PART) + { + sensor_update(&g_amec->part_config.part_list[i_part_id].util2msslack, l_cg_util_slack_perc); + } + else if(!L_trace) + { + // indicates missing support for sensors based on AMEC_PART_MAX_PART + TRAC_ERR("amec_dps_partition_update_sensors: Invalid part id[0x%04x]", i_part_id); + L_trace = TRUE; + } } // Function Specification @@ -207,6 +217,7 @@ void amec_dps_partition_alg(const uint16_t i_part_id) uint16_t l_temp16 = 0; uint32_t l_divide32[2] = {0, 0}; OCC_INTERNAL_MODE l_part_policy = 0xFF; + static bool L_trace = FALSE; /*------------------------------------------------------------------------*/ /* Code */ @@ -227,6 +238,18 @@ void amec_dps_partition_alg(const uint16_t i_part_id) case 41: // Type 41 algorithm + // verify the part id is valid + if(i_part_id >= AMEC_PART_MAX_PART) + { + if(!L_trace) + { + // indicates missing support for sensors based on AMEC_PART_MAX_PART + TRAC_ERR("amec_dps_partition_alg: Invalid part id[0x%04x]", i_part_id); + L_trace = TRUE; + } + break; + } + // l_tempreg=measure of slack over gamma time interval on a per core basis l_tempreg = (uint16_t)g_amec->part_config.part_list[i_part_id].util2msslack.sample; // Convert to 10000 is equivalent to 100.00% utilization. diff --git a/src/occ_405/amec/amec_part.h b/src/occ_405/amec/amec_part.h index b95909c..a4a1830 100755 --- a/src/occ_405/amec/amec_part.h +++ b/src/occ_405/amec/amec_part.h @@ -49,8 +49,11 @@ // Number of cores in system #define AMEC_PART_NUM_CORES (MAX_NUM_OCC * MAX_NUM_CORES) -// On a given OCC, only 12 partitions can be defined -#define AMEC_PART_MAX_PART MAX_NUM_CORES +// No support for PLPM, all cores will be in the same core group (partition) +// The main PLPM code will stay but the partition sensors were removed for all but the +// one core group in order to save SRAM +// If this ever changes then there must be sensors UTILSLCGx defined for each core group possible +#define AMEC_PART_MAX_PART 1 // Invalid core group ID #define AMEC_PART_INVALID_ID 0xFF diff --git a/src/occ_405/amec/amec_sys.h b/src/occ_405/amec/amec_sys.h index fcb988a..0d69ca0 100755 --- a/src/occ_405/amec/amec_sys.h +++ b/src/occ_405/amec/amec_sys.h @@ -721,6 +721,8 @@ typedef struct // WOF structure amec_wof_t wof; + // WOF sensors + amec_wof_sensors_t wof_sensors; //--------------------------------------------------------- // diff --git a/src/occ_405/occbuildname.c b/src/occ_405/occbuildname.c index c1fc61e..10fdbe4 100755 --- a/src/occ_405/occbuildname.c +++ b/src/occ_405/occbuildname.c @@ -34,6 +34,6 @@ volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = #else -volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_180822a\0" /*</BuildName>*/ ; +volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_180904a\0" /*</BuildName>*/ ; #endif diff --git a/src/occ_405/sensor/sensor.h b/src/occ_405/sensor/sensor.h index 9cda3c1..406021f 100755 --- a/src/occ_405/sensor/sensor.h +++ b/src/occ_405/sensor/sensor.h @@ -73,6 +73,7 @@ typedef enum AMEC_SENSOR_TYPE_FREQ = 0x0040, AMEC_SENSOR_TYPE_POWER = 0x0080, AMEC_SENSOR_TYPE_PERF = 0x0200, + AMEC_SENSOR_TYPE_WOF = 0x0400, AMEC_SENSOR_TYPE_ALL = 0xffff, }AMEC_SENSOR_TYPE; // Changes to sensor type bits would require changes to select sensor groups command diff --git a/src/occ_405/sensor/sensor_enum.h b/src/occ_405/sensor/sensor_enum.h index 4abda7b..80b8ea7 100755 --- a/src/occ_405/sensor/sensor_enum.h +++ b/src/occ_405/sensor/sensor_enum.h @@ -719,17 +719,13 @@ enum e_gsid // Partition Sensors // ------------------------------------------------------ UTILSLCG000, - UTILSLCG001, - UTILSLCG002, - UTILSLCG003, - UTILSLCG004, - UTILSLCG005, - UTILSLCG006, - UTILSLCG007, - UTILSLCG008, - UTILSLCG009, - UTILSLCG010, - UTILSLCG011, + + // ------------------------------------------------------ + // WOF Sensors + // ------------------------------------------------------ + CEFFVDDRATIO, + CEFFVDNRATIO, + VRATIO, // ------------------------------------------------------ // END of Sensor List (this must be last entry) diff --git a/src/occ_405/sensor/sensor_info.c b/src/occ_405/sensor/sensor_info.c index 812c13d..8013e39 100755 --- a/src/occ_405/sensor/sensor_info.c +++ b/src/occ_405/sensor/sensor_info.c @@ -387,17 +387,11 @@ const sensor_info_t G_sensor_info[] = /* ==PartSummarySensors== NameString Units Type Location Number Freq ScaleFactor */ SENSOR_INFO_T_ENTRY( UTILSLCG000, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG001, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG002, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG003, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG004, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG005, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG006, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG007, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG008, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG009, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG010, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), - SENSOR_INFO_T_ENTRY( UTILSLCG011, "%\0", AMEC_SENSOR_TYPE_UTIL, AMEC_SENSOR_LOC_LPAR, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP_SCALE_0_16384), + + /* ==WOF Sensors== NameString Units Type Location Number Freq ScaleFactor */ + SENSOR_INFO_T_ENTRY( CEFFVDDRATIO, "%\0", AMEC_SENSOR_TYPE_WOF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP( 1,-2) ), + SENSOR_INFO_T_ENTRY( CEFFVDNRATIO, "%\0", AMEC_SENSOR_TYPE_WOF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP( 1,-2) ), + SENSOR_INFO_T_ENTRY( VRATIO, " \0", AMEC_SENSOR_TYPE_WOF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP( 1, 0) ), }; // Cause a compile error if we don't have all the sensors in the enum in the initialization list. diff --git a/src/occ_405/sensor/sensor_table.c b/src/occ_405/sensor/sensor_table.c index 295ef36..d7ca9b5 100755 --- a/src/occ_405/sensor/sensor_table.c +++ b/src/occ_405/sensor/sensor_table.c @@ -434,20 +434,17 @@ const sensor_ptr_t G_amec_sensor_list[] = SENSOR_PTR(TEMPGPU2MEM, &g_amec_sys.gpu[2].tempgpumem), // ------------------------------------------------------ - // Partition Sensors + // Partition Sensors -- no PLPM support only 1 core group sensor + // additional sensors must be added if AMEC_PART_MAX_PART is ever changed to be more than 1 // ------------------------------------------------------ SENSOR_PTR( UTILSLCG000, &g_amec_sys.part_config.part_list[0].util2msslack), - SENSOR_PTR( UTILSLCG001, &g_amec_sys.part_config.part_list[1].util2msslack), - SENSOR_PTR( UTILSLCG002, &g_amec_sys.part_config.part_list[2].util2msslack), - SENSOR_PTR( UTILSLCG003, &g_amec_sys.part_config.part_list[3].util2msslack), - SENSOR_PTR( UTILSLCG004, &g_amec_sys.part_config.part_list[4].util2msslack), - SENSOR_PTR( UTILSLCG005, &g_amec_sys.part_config.part_list[5].util2msslack), - SENSOR_PTR( UTILSLCG006, &g_amec_sys.part_config.part_list[6].util2msslack), - SENSOR_PTR( UTILSLCG007, &g_amec_sys.part_config.part_list[7].util2msslack), - SENSOR_PTR( UTILSLCG008, &g_amec_sys.part_config.part_list[8].util2msslack), - SENSOR_PTR( UTILSLCG009, &g_amec_sys.part_config.part_list[9].util2msslack), - SENSOR_PTR( UTILSLCG010, &g_amec_sys.part_config.part_list[10].util2msslack), - SENSOR_PTR( UTILSLCG011, &g_amec_sys.part_config.part_list[11].util2msslack), + + // ------------------------------------------------------ + // WOF Sensors + // ------------------------------------------------------ + SENSOR_PTR( CEFFVDDRATIO, &g_amec_sys.wof_sensors.ceff_ratio_vdd_sensor), + SENSOR_PTR( CEFFVDNRATIO, &g_amec_sys.wof_sensors.ceff_ratio_vdn_sensor), + SENSOR_PTR( VRATIO, &g_amec_sys.wof_sensors.v_ratio_sensor), }; STATIC_ASSERT( (NUMBER_OF_SENSORS_IN_LIST != (sizeof(G_amec_sensor_list)/sizeof(sensor_ptr_t))) ); @@ -636,17 +633,13 @@ const minisensor_ptr_t G_amec_mini_sensor_list[] INIT_SECTION = // Partition Sensors // ------------------------------------------------------ MINI_SENSOR_PTR( UTILSLCG000, NULL), - MINI_SENSOR_PTR( UTILSLCG001, NULL), - MINI_SENSOR_PTR( UTILSLCG002, NULL), - MINI_SENSOR_PTR( UTILSLCG003, NULL), - MINI_SENSOR_PTR( UTILSLCG004, NULL), - MINI_SENSOR_PTR( UTILSLCG005, NULL), - MINI_SENSOR_PTR( UTILSLCG006, NULL), - MINI_SENSOR_PTR( UTILSLCG007, NULL), - MINI_SENSOR_PTR( UTILSLCG008, NULL), - MINI_SENSOR_PTR( UTILSLCG009, NULL), - MINI_SENSOR_PTR( UTILSLCG010, NULL), - MINI_SENSOR_PTR( UTILSLCG011, NULL), + + // ------------------------------------------------------ + // WOF Sensors + // ------------------------------------------------------ + SENSOR_PTR( CEFFVDDRATIO, NULL), + SENSOR_PTR( CEFFVDNRATIO, NULL), + SENSOR_PTR( VRATIO, NULL), }; STATIC_ASSERT( (NUMBER_OF_SENSORS_IN_LIST != (sizeof(G_amec_mini_sensor_list)/sizeof(uint16_t *))) ); STATIC_ASSERT( (MAX_AMEC_SENSORS < (sizeof(G_amec_mini_sensor_list)/sizeof(uint16_t *))) ); diff --git a/src/occ_405/state.c b/src/occ_405/state.c index a3ec45e..03c6922 100755 --- a/src/occ_405/state.c +++ b/src/occ_405/state.c @@ -45,6 +45,7 @@ // Maximum time to wait for a PGPE task before timeout #define WAIT_PGPE_TASK_TIMEOUT (MICS_PER_TICK * 4) +extern bool G_allowPstates; extern bool G_mem_monitoring_allowed; extern task_t G_task_table[TASK_END]; // Global task table extern bool G_simics_environment; @@ -764,6 +765,13 @@ errlHndl_t SMGR_observation_to_active() // characterization state where user was manually writing Pstates G_set_pStates = TRUE; + // for powerVM the clip is set to UT, need to make sure we determine new freq before + // 1st write to PMCR to prevent writing the clip to the PMCR and going to UT + if(!G_sysConfigData.system_type.kvm) + { + G_allowPstates = FALSE; + } + // Set the RTL Flags to indicate which tasks can run // - Clear OBSERVATION b/c not in OBSERVATION State // - Set ACTIVE b/c we're in ACTIVE State diff --git a/src/occ_405/wof/wof.c b/src/occ_405/wof/wof.c index 3d9814b..c6020e6 100644 --- a/src/occ_405/wof/wof.c +++ b/src/occ_405/wof/wof.c @@ -779,6 +779,8 @@ void read_shared_sram( void ) g_wof->v_clip = l_wofstate.fields.vclip_mv; g_wof->v_ratio = l_wofstate.fields.vratio; + sensor_update(AMECSENSOR_PTR(VRATIO), (uint16_t)l_wofstate.fields.vratio); + g_wof->f_ratio = 1; // Get the requested active quad update read_req_active_quads(); @@ -1140,6 +1142,7 @@ void calculate_ceff_ratio_vdn( void ) else { g_wof->ceff_ratio_vdn = g_wof->ceff_vdn / g_wof->ceff_tdp_vdn; + sensor_update(AMECSENSOR_PTR(CEFFVDNRATIO), (uint16_t)g_wof->ceff_ratio_vdn); } } @@ -1151,6 +1154,8 @@ void calculate_ceff_ratio_vdn( void ) */ void calculate_ceff_ratio_vdd( void ) { + uint32_t l_raw_ceff_ratio = 0; + // If we get v_ratio of 0 from pgpe, force ceff_ratio_vdd to 0; if( g_wof->v_ratio == 0 ) { @@ -1215,10 +1220,14 @@ void calculate_ceff_ratio_vdd( void ) } else { - // Save ceff_ratio_vdd. Multiply by 10000 to convert to correct granularity. - // Prevent Over current by clipping to max of 100% - g_wof->ceff_ratio_vdd = - prevent_over_current((g_wof->ceff_vdd*10000) / g_wof->ceff_tdp_vdd); + // Save raw ceff ratio vdd to a sensor, this sensor is NOT to be used by the WOF alg + // Multiply by 10000 to convert to correct granularity. + l_raw_ceff_ratio = (g_wof->ceff_vdd*10000) / g_wof->ceff_tdp_vdd; + sensor_update(AMECSENSOR_PTR(CEFFVDDRATIO), (uint16_t)l_raw_ceff_ratio); + + // Now check the raw ceff ratio to prevent Over current by clipping to max of 100% + // this is saved to the parameter used by the rest of the wof alg + g_wof->ceff_ratio_vdd = prevent_over_current(l_raw_ceff_ratio); } } } diff --git a/src/occ_405/wof/wof.h b/src/occ_405/wof/wof.h index 871f5e1..69f5412 100644 --- a/src/occ_405/wof/wof.h +++ b/src/occ_405/wof/wof.h @@ -369,6 +369,16 @@ typedef struct __attribute__ ((packed)) uint8_t avgtemp_vdn[CORE_IDDQ_MEASUREMENTS]; } amec_wof_t; +// Structure for sensors used in g_amec for AMESTER +// these will contain raw values any clipping for WOF alg will be represented +// in the parameter above in amec_wof_t +typedef struct __attribute__ ((packed)) +{ + sensor_t ceff_ratio_vdd_sensor; + sensor_t ceff_ratio_vdn_sensor; + sensor_t v_ratio_sensor; +} amec_wof_sensors_t; + typedef struct __attribute__ ((packed)) { uint8_t data[MIN_BCE_REQ_SIZE]; |