src/occ_405/wof/wof.c
/** multiply_ratio
 *
 *  Description: Helper function to multiply V/F Ratio's by their
 *               operating point preserving the correct granularity
 *
 *  Param[in]: i_operating_point - Operating point taken from the OPPB
 *  Param[in]: i_ratio - the V/F ratio taken from shared OCC-PGPE SRAM
 *
 *  Return: Operating point * ratio
 */
multiply_ratio
Description: Helper function to multiply V/F Ratio's by their
operating point preserving the correct granularity

Param[in]: i_operating_point - Operating point taken from the OPPB
Param[in]: i_ratio - the V/F ratio taken from shared OCC-PGPE SRAM

Operating point * ratio
multiply_ratio Description : Helper function to multiply V / F Ratio ' s by their operating point preserving the correct granularity Param [ in ] : i_operating_point - Operating point taken from the OPPB Param [ in ] : i_ratio - the V / F ratio taken from shared OCC - PGPE SRAM Operating point * ratio
inline uint32_t multiply_ratio( uint32_t i_operating_point,
                                uint32_t i_ratio )
{
    return ((((i_ratio*10000)/0xFFFF) * i_operating_point) / 10000);
}
inline uint32_t multiply_ratio ( uint32_t i_operating_point , uint32_t i_ratio ) { return ( ( ( ( i_ratio * 10000 ) / 0xFFFF ) * i_operating_point ) / 10000 ) ; }
multiply_ratio
  Description: Helper function to multiply V/F Ratio's by their
               operating point preserving the correct granularity
multiply_ratio Description : Helper function to multiply V / F Ratio ' s by their operating point preserving the correct granularity
// We get i_ratio from the PGPE ranging from 0x0000 to 0xffff // These hex values conceptually translate from 0.0 to 1.0 // Extra math is used to convert units to avoid floating point math.