clock-switch-glitch-free

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

WhitePaperTechniquestoMakeClockSwitchingGlitchFreeAugust2003,ver.1.01WP-CLCKSWTCH-1.0Withmoreandmoremulti-frequencyclocksbeingusedintoday’sdevicesespeciallyinthecommunicationsfielditisoftennecessarytoswitchthesourceofaclocklinewhilethedeviceisrunning.Thissourceswitchingisusuallyimplementedbymultiplexingtwodifferentfrequencyclocksourcesinhardwareandcontrollingthemultiplexerselectlinebyinternallogic.Thetwoclockfrequenciescanbetotallyunrelatedtoeachotherortheycanbemultiplesofeachother.Ineithercase,thereisachanceofgeneratingaglitchontheclocklineatthetimeoftheswitch.Aglitchontheclocklineishazardoustothewholesystem,asitcouldbeinterpretedasacaptureclockedgebysomeregisterswhilemissedbyothers.Thiswhitepaperdiscussestwodifferentmethodsofavoidingaglitchattheoutputclocklineofaswitch.Thefirstmethodisusedwhenclocksaremultiplesofeachother;thesecondmethodshowsclocksthataretotallyunrelatedtoeachother.On-the-FlyClockSwitchingProblemsThemultiplexerhasonecontrolsignal,SELECT,whicheitherpropagatesCLK0totheoutputwhensetto“zero”orpropagatesCLK1totheoutputwhensetto“one.”WhentheSELECTvaluechanges,aglitchcanoccurduetoimmediateswitchingoftheoutputfromthecurrentclocksourcetothenextclocksource.Thecurrentclockistheclocksourcecurrentlyselected;thenextclockistheclocksourcecorrespondingtothenewSELECTvalue.ThetimingdiagraminFigure1showshowaglitchisgeneratedattheoutput,OUTCLOCK,whentheSELECTcontrolsignalchanges.Theproblemwiththiskindofswitchisthattheswitchcontrolsignalcanchangeatanytimewithrespecttothesourceclocks,thuscreatingapotentialforremovingtheoutputclockorcreatingaglitchattheoutput.Theselectcontrolsignalismostlikelygeneratedbyaregisterdrivenbyeitherofthetwosourceclocks,meaningthateitherithasaknowntimingrelationshiptobothclocks(ifbothclocksaremultiplesofeachother),oritcanbeasynchronoustoatleastoneclock(ifsourceclocksarenotrelatedinanyway).Youmustavoidswitchingduringeitherclock’shighstatewithouthavinganyknowledgeaboutthefrequenciesorphaserelationshipsoftheseclocks.Youcanuseafixeddelaytoinducethegapbetweenthestartandstoptimeofthetwosourceclocks,butonlyifafixedrelationshipexistsbetweenthetwoclocksources.Itcannotbeusedwhereeitheroneoftheinputfrequenciesisnotknown,orwhentheclocksarenotrelated.TechniquestoMakeClockSwitchingGlitchFreeAlteraCorporation2Figure1showsasimpleimplementationofaclockswitch,usinganAND/OR-typemultiplexerlogic.Figure1.ClockSwitchingMultiplexerGlitchProtectionforRelatedClockSourcesFigure2showshowtopreventaglitchattheoutputofaclockswitchwheresourceclocksaremultiplesofeachother.AnegativeedgetriggeredD-typeflipflopisinsertedintheselectionpathforeachoftheclocksources.Registeringtheselectioncontrolatthenegativeedgeoftheclock,alongwithinitiallyenablingtheselectionaftertheotherclockisde-selected,providesexcellentprotectionagainstoutputglitches.Registeringtheselectsignalatthenegativeedgeoftheclockguaranteesthatnochangesoccurattheoutputwhileeitheroftheclocksareatahighlevel,thusprotectingagainstremovingtheoutputclock.Feedbackfromoneclock’sselectiontotheotherenablestheswitchtowaitforde-selectionofthecurrentclockbeforestartingthepropagationofthenextclock,avoidinganyglitches.AlteraCorporationTechniquestoMakeClockSwitchingGlitchFree3Figure2showshowthetransitionoftheSELECTsignalfrom0to1firststopspropagationofCLK0totheoutputattheproceedingfallingedgeofCLK0,thenstartsthepropagationofCLK1totheoutputatthefollowingnegativeedgeofCLK1.Therearethreetimingpathsinthiscircuitthatneedspecialconsideration—theSELECTcontrolsignaltoeitheroneofthetwonegative-edgetriggeredflipflops,theoutputofDFF0toinputofDFF1,andtheoutputofDFF1totheinputofDFF0.Ifthesignalonanyofthesethreepathschangesatthesametimeasthecapturingedgeofthedestinationflipflop’sclock,thereisasmallchancethattheoutputofthatregistercanbecomemeta-stable,meaningitcangotoastatebetweenanideal“one”andanideal“zero.”Ameta-stablestatecanbeinterpreteddifferentlybytheclockmultiplexerandtheenablefeedbackoftheotherflipflop.Therefore,itisrequiredthatcapturingedgesofbothflipflopsandthelaunchedgeoftheSELECTsignalshouldbesetapartfromeachothertoavoidanyasynchronousinterfacing.Thiscanbeeasilyaccomplishedbyusingthepropermulti-cycleholdconstraintsorminimumdelayconstraints,asthetimingrelationshipisknownbetweenthetwoclocks.TechniquestoMakeClockSwitchingGlitchFreeAlteraCorporation4Figure2.Glitch-FreeClockSwitchingforRelatedClocksFaultToleranceAtthedevicestart-uptime,bothflipflops(DFF0andDFF1)shouldberesettothe“zero”statesothatneitheroneoftheclocksisinitiallypropagated.Bystartingbothflipflopsina“zero”state,faulttoleranceisbuiltintotheclockswitch.AlteraCorporationTechniquestoMakeClockSwitchingGlitchFree5Forexample,oneoftheclockswasnottogglingduetoafaultatstart-uptime.Iftheflipflopassociatedwiththefaultyclockhadstartedupin“one”state,itwouldpreventtheselectionoftheotherclockasthenextclock,anditsownstatecannotbechangedduetolackofarunningclock.Bystartingbothflipflopsin“zero”state,evenifoneofthesourceclocksisnotrunning,youcanstillpropagatetheothergoodclocktotheoutputoftheswitch.GlitchProtectionforUnrelatedClockSourcesThep

1 / 7
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功