Beispiel #1
0
        private void updateButton_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 5; i++)
            {
                _pStates[i] = PState.Load(i);

                // disable the current P-state and all following ones in case the
                // first core's CPU VID is > than the previous P-state's
                if ((i > 0 && _pStates[i].Msrs[0].Vid > _pStates[i - 1].Msrs[0].Vid) && (i < 3))                 //ignore Vids from NB in comprison
                {
                    for (int j = i; j < 5; j++)
                    {
                        _pStates[j] = null;
                    }

                    break;
                }
            }

            RefreshPStatesLabel();
        }
Beispiel #2
0
        /// <summary>
        /// Loads the P-state settings from each core's MSR.
        /// </summary>
        public void LoadFromHardware(int pstatetab)
        {
            if (_index < 0)
            {
                throw new InvalidOperationException("The PStateIndex property needs to be initialized first.");
            }

            if (pstatetab < 3)            //hardware loads for CPU
            {
                if (_index <= _maxPstate) //skip, in case just 2 CPU PStates are initialized
                {
                    _pState = PState.Load(_index);

                    double maxCpuVid = 0;
                    for (int i = 0; i < _pState.Msrs.Length; i++)
                    {
                        var msr = _pState.Msrs[i];

                        var control = (NumericUpDown)flowLayoutPanel1.Controls[i];
                        control.Value = (decimal)msr.Divider;

                        maxCpuVid = Math.Max(maxCpuVid, msr.Vid);
                    }

                    VidNumericUpDown.Value = Math.Min(VidNumericUpDown.Maximum, (decimal)maxCpuVid);
                    //int check = K10Manager.SetBIOSBusSpeed(80);
                    CLKNumericUpDown.Value = (decimal)K10Manager.GetBIOSBusSpeed();
                    pllfreq.Text           = "P" + _index + " Freq (CPU): " + (int)_pState.Msrs[0].PLL + "MHz";
                    Cofstate.Text          = "Mult = " + (K10Manager.CurrCOF() + 16) + " divided by ->";
                    Form1.freq[pstatetab]  = (int)_pState.Msrs[0].PLL;
                }
                else
                {
                    VidNumericUpDown.Value = (decimal)0.4;
                    CLKNumericUpDown.Value = 100;
                }
            }
            else if (pstatetab == 3)
            {
                //hardware loads for NB P0
                _pState = PState.Load(_index);
                var control = (NumericUpDown)flowLayoutPanel1.Controls[0];
                control.Value          = (decimal)K10Manager.GetNbDivPState0();
                VidNumericUpDown.Value = (decimal)(1.55 - 0.0125 * K10Manager.GetNbVidPState0());
                CLKNumericUpDown.Value = (decimal)K10Manager.GetBIOSBusSpeed();
                pllfreq.Text           = "P" + (_index - 3) + " Freq (GPU): " + (int)_pState.Msrs[0].PLL + "MHz";
                Cofstate.Text          = "Mult = " + (K10Manager.CurrCOF() + 16) + " divided by ->";
                Form1.freq[pstatetab]  = (int)_pState.Msrs[0].PLL;
            }
            else if (pstatetab == 4)
            {
                //hardware loads for NB P0
                _pState = PState.Load(_index);
                var control = (NumericUpDown)flowLayoutPanel1.Controls[0];
                control.Value          = (decimal)K10Manager.GetNbDivPState1();
                VidNumericUpDown.Value = (decimal)(1.55 - 0.0125 * K10Manager.GetNbVidPState1());
                CLKNumericUpDown.Value = (decimal)K10Manager.GetBIOSBusSpeed();
                pllfreq.Text           = "P" + (_index - 3) + " Freq (GPU): " + (int)_pState.Msrs[0].PLL + "MHz";
                Cofstate.Text          = "Mult = " + (K10Manager.CurrCOF() + 16) + " divided by ->";
                Form1.freq[pstatetab]  = (int)_pState.Msrs[0].PLL;
            }
            else if (pstatetab == 5) //settings for displaying registers
            {
                VidNumericUpDown.Value = 1;
                CLKNumericUpDown.Value = 100;
            }
            _modified = false;
        }