示例#1
0
        /// <summary>
        ///     Calibrate module temperature by passing in current heat sink temperature.
        ///     Offsets are subtracted from the measured value to create the reported value.
        ///     Example:  heat sink is @ 25C.
        ///     You would call this method CalibrateModuleTemperature(25.0)
        ///     Note: both offsets (0C and 75C are set the same)
        /// </summary>
        /// <param name="heatSinkTemperature"></param>
        /// <param name="zeroOffsetsFirst"></param>
        public async Task <bool> CalibrateModuleTemperature(double heatSinkTemperature, bool zeroOffsetsFirst = false)
        {
            return(await Task.Run(async() =>
            {
                if (zeroOffsetsFirst)
                {
                    await Qsfp100G.SetModuleTemperatureOffsetsAsync(0, 0).ConfigureAwait(false);
                    await Task.Delay(3000).ConfigureAwait(false); // allow sometime overcome module internal smoothing
                }

                var temperatureOffset = await Qsfp100G.TemperatureAsync() - heatSinkTemperature;

                var writtenData = await Qsfp100G.SetModuleTemperatureOffsetsAsync(temperatureOffset, temperatureOffset)
                                  .ConfigureAwait(false);
                var checkSum = UtilityFunctions.ComputeCheckSum(Qsfp100G.GetCiscoSpecificConfiguration());
                await Device.SetRegAsync(Qsfp100GRegister.Page4.ModuleConfigCheckSum, checkSum);
                await Qsfp100G.Update_CalibrationAsync().ConfigureAwait(false);

                // validate page 4 upper NVR after device reset.
                var res = await DutGpio.Reset(TimeSpan.FromMilliseconds(50), TimeSpan.FromMilliseconds(2500));
                var(success, bootTime) =
                    await ResetWaitTillIntL(TimeSpan.FromMilliseconds(1000), TimeSpan.FromSeconds(10));

                var readBackData = Qsfp100G.GetCiscoSpecificConfiguration();
                return readBackData.SequenceEqual(writtenData);
            }));
        }
示例#2
0
        public async Task <bool> ResetAndDelay(TimeSpan assertTime, TimeSpan delayTime, TimeSpan timeOut,
                                               IProgress <TmgProgressReporting> progress = null)
        {
            progress?.Report(new TmgProgressReporting(DateTime.Now, $"Module Reset : Assert {assertTime}"));

            Reset(false);
            await Task.Delay(assertTime);

            Reset(true);
            await Task.Delay(delayTime);

            return(true);

            void Reset(bool s)
            {
                DutGpio.Reset(!s);
            }
        }
示例#3
0
        /// <summary>
        ///     Calibrate module temperature by passing in current heat sink temperature.
        ///     Offsets are subtracted from the measured value to create the reported value.
        ///     Example:  heat sink is @ 25C.
        ///     You would call this method CalibrateModuleTemperature(25.0)
        ///     Note: both offsets (0C and 75C are set the same)
        /// </summary>
        /// <param name="caseHotspotTemperature"></param>
        /// <param name="slope"></param>
        /// <param name="zeroOffsetsFirst"></param>
        public async Task <bool> CalibrateModuleTemperature2(double caseHotspotTemperature, double slope,
                                                             bool zeroOffsetsFirst = false)
        {
            return(await Task.Run(async() =>
            {
                if (zeroOffsetsFirst)
                {
                    await Qsfp100G.SetModuleTemperatureOffsetsAsync(0, 0).ConfigureAwait(false);
                    await Task.Delay(3000).ConfigureAwait(false); // allow sometime overcome module internal smoothing
                    var result2 = await WaitDutTemperatureStable(0.5, TimeSpan.FromSeconds(30),
                                                                 TimeSpan.FromSeconds(2), TimeSpan.FromMinutes(5));
                }

                var temperatureOffsetAtCaseHotspotTemp = await Qsfp100G.TemperatureAsync() - caseHotspotTemperature;

                var fixedOffset = temperatureOffsetAtCaseHotspotTemp - caseHotspotTemperature *slope;

                //                    fixed offset temp dependent offset
                var offsetAt0C = fixedOffset + 0.0 * slope;
                var offsetAt70C = fixedOffset + 70.0 * slope;


                var writtenData = await Qsfp100G.SetModuleTemperatureOffsetsAsync(offsetAt0C, offsetAt70C)
                                  .ConfigureAwait(false);
                var checkSum = UtilityFunctions.ComputeCheckSum(Qsfp100G.GetCiscoSpecificConfiguration());
                await Device.SetRegAsync(Qsfp100GRegister.Page4.ModuleConfigCheckSum, checkSum);
                await Qsfp100G.Update_CalibrationAsync().ConfigureAwait(false);

                // validate page 4 upper NVR after device reset.
                var res = await DutGpio.Reset(TimeSpan.FromMilliseconds(50), TimeSpan.FromMilliseconds(2500));
                var(success, _) = await ResetWaitTillIntL(TimeSpan.FromMilliseconds(1000), TimeSpan.FromSeconds(10));
                if (!success)
                {
                    throw new ArgumentException("ResetWaitTillIntL failed");
                }
                var readBackData = Qsfp100G.GetCiscoSpecificConfiguration();
                return readBackData.SequenceEqual(writtenData);
            }));
        }
示例#4
0
 public void Reset(bool s)
 {
     DutGpio.Reset(!s);
 }