src/occ_405/wof/wof.c
/**
 * read_shared_sram
 *
 * Description: Read out data from OCC-PGPE shared SRAM and saves the
 *              data for the current iteration of the WOF algorithm
 */
read_shared_sram
Description: Read out data from OCC-PGPE shared SRAM and saves the
data for the current iteration of the WOF algorithm
read_shared_sram Description : Read out data from OCC - PGPE shared SRAM and saves the data for the current iteration of the WOF algorithm
void read_shared_sram( void )
{
    G_quad_state_0.value = in64(g_wof->quad_state_0_addr);
    G_quad_state_1.value = in64(g_wof->quad_state_1_addr);
    pgpe_wof_state_t l_wofstate;
    l_wofstate.value = in64(g_wof->pgpe_wof_state_addr);
    g_wof->f_clip_ps  = l_wofstate.fields.fclip_ps;
    g_wof->f_clip_freq = (proc_pstate2freq(g_wof->f_clip_ps))/1000;
    g_wof->v_clip  = l_wofstate.fields.vclip_mv;
    g_wof->v_ratio = l_wofstate.fields.vratio;
    g_wof->f_ratio = 1;
    read_req_active_quads();
    g_wof->core_pwr_on =
                   (((uint32_t)G_quad_state_0.fields.active_cores) << 16)
                  | ((uint32_t)G_quad_state_1.fields.active_cores);
    memset(g_wof->quad_x_pstates, 0 , MAXIMUM_QUADS);
    g_wof->quad_x_pstates[0] = (uint8_t)G_quad_state_0.fields.quad0_pstate;
    g_wof->quad_x_pstates[1] = (uint8_t)G_quad_state_0.fields.quad1_pstate;
    g_wof->quad_x_pstates[2] = (uint8_t)G_quad_state_0.fields.quad2_pstate;
    g_wof->quad_x_pstates[3] = (uint8_t)G_quad_state_0.fields.quad3_pstate;
    g_wof->quad_x_pstates[4] = (uint8_t)G_quad_state_1.fields.quad4_pstate;
    g_wof->quad_x_pstates[5] = (uint8_t)G_quad_state_1.fields.quad5_pstate;
    g_wof->quad_ivrm_states =
           (((uint8_t)G_quad_state_0.fields.ivrm_state) << 4)
          | ((uint8_t)G_quad_state_1.fields.ivrm_state);
}
void read_shared_sram ( void ) { G_quad_state_0 . value = in64 ( g_wof -> quad_state_0_addr ) ; G_quad_state_1 . value = in64 ( g_wof -> quad_state_1_addr ) ; pgpe_wof_state_t l_wofstate ; l_wofstate . value = in64 ( g_wof -> pgpe_wof_state_addr ) ; g_wof -> f_clip_ps = l_wofstate . fields . fclip_ps ; g_wof -> f_clip_freq = ( proc_pstate2freq ( g_wof -> f_clip_ps ) ) / 1000 ; g_wof -> v_clip = l_wofstate . fields . vclip_mv ; g_wof -> v_ratio = l_wofstate . fields . vratio ; g_wof -> f_ratio = 1 ; read_req_active_quads ( ) ; g_wof -> core_pwr_on = ( ( ( uint32_t ) G_quad_state_0 . fields . active_cores ) << 16 ) | ( ( uint32_t ) G_quad_state_1 . fields . active_cores ) ; memset ( g_wof -> quad_x_pstates , 0 , MAXIMUM_QUADS ) ; g_wof -> quad_x_pstates [ 0 ] = ( uint8_t ) G_quad_state_0 . fields . quad0_pstate ; g_wof -> quad_x_pstates [ 1 ] = ( uint8_t ) G_quad_state_0 . fields . quad1_pstate ; g_wof -> quad_x_pstates [ 2 ] = ( uint8_t ) G_quad_state_0 . fields . quad2_pstate ; g_wof -> quad_x_pstates [ 3 ] = ( uint8_t ) G_quad_state_0 . fields . quad3_pstate ; g_wof -> quad_x_pstates [ 4 ] = ( uint8_t ) G_quad_state_1 . fields . quad4_pstate ; g_wof -> quad_x_pstates [ 5 ] = ( uint8_t ) G_quad_state_1 . fields . quad5_pstate ; g_wof -> quad_ivrm_states = ( ( ( uint8_t ) G_quad_state_0 . fields . ivrm_state ) << 4 ) | ( ( uint8_t ) G_quad_state_1 . fields . ivrm_state ) ; }
read_shared_sram
 Description: Read out data from OCC-PGPE shared SRAM and saves the
              data for the current iteration of the WOF algorithm
read_shared_sram Description : Read out data from OCC - PGPE shared SRAM and saves the data for the current iteration of the WOF algorithm
// Get the actual quad states // Read f_clip, v_clip, f_ratio, and v_ratio // convert f_clip_ps from Pstate to frequency(mHz) // Get the requested active quad update // merge the 16-bit active_cores field from quad state 0 and the 16-bit // active_cores field from quad state 1 and save it to amec. // Clear out current quad pstates // Add the quad states to the global quad state array for easy looping. // Save IVRM bit vector states to amec // NOTE: the ivrm_state field in both quad state 0 and quad state 1 //       double words should contain the same data.