7. The Quartus II TimeQuest Timing Analyzer November2013 QII53018-13.1.0 QII53018-13.1.0 TheQuartus®IITimeQuestTimingAnalyzerisapowerfulASIC-styletiminganalysis toolthatvalidatesthetimingperformanceofalllogicinyourdesignusingan industry-standardconstraint,analysis,andreportingmethodology.Usethe TimeQuestanalyzerGUIorcommand-lineinterfacetoconstrain,analyze,andreport resultsforalltimingpathsinyourdesign. Thischaptercontainsthefollowingsections: ■ “GettingStartedwiththeTimeQuestAnalyzer” ■ “ConstrainingandAnalyzingwithTclCommands”onpage7–7 ■ “CreatingClocksandClockConstraints”onpage7–14 ■ “CreatingI/ORequirements”onpage7–24 ■ “CreatingDelayandSkewConstraints”onpage7–26 ■ “CreatingTimingExceptions”onpage7–27 ■ “ExamplesofBasicMulticycleExceptions”onpage7–35 ■ “ApplicationofMulticycleExceptions”onpage7–44 ■ “TimingReports”onpage7–57 f Formoreinformationaboutbasictiminganalysisconceptsandhowtheypertainto theTimeQuestanalyzer,refertotheTimingAnalysisOverviewchapterinvolume3of theQuartusIIHandbook. f FormoreinformationaboutAlteraresourcesavailablefortheTimeQuestanalyzer, refertotheTimeQuestTimingAnalyzerResourceCenteroftheAlterawebsite. f FormoreinformationabouttheTimeQuestanalyzer,refertotheAlteraTrainingpage oftheAlterawebsite. ©2013AlteraCorporation.Allrightsreserved.ALTERA,ARRIA,CYCLONE,HARDCOPY,MAX,MEGACORE,NIOS,QUARTUSandSTRATIXwordsandlogos aretrademarksofAlteraCorporationandregisteredintheU.S.PatentandTrademarkOfficeandinothercountries.Allotherwordsandlogosidentifiedas trademarksorservicemarksarethepropertyoftheirrespectiveholdersasdescribedatwww.altera.com/common/legal.html.Alterawarrantsperformanceofits ISO semiconductorproductstocurrentspecificationsinaccordancewithAltera'sstandardwarranty,butreservestherighttomakechangestoanyproductsand 9001:2008 servicesatanytimewithoutnotice.Alteraassumesnoresponsibilityorliabilityarisingoutoftheapplicationoruseofanyinformation,product,orservice Registered describedhereinexceptasexpresslyagreedtoinwritingbyAltera.Alteracustomersareadvisedtoobtainthelatestversionofdevicespecificationsbeforerelying onanypublishedinformationandbeforeplacingordersforproductsorservices. QuartusIIHandbookVersion13.1 Volume3:Verification November2013 Twitter Feedback Subscribe 7–2 Chapter7: TheQuartusIITimeQuestTimingAnalyzer GettingStartedwiththeTimeQuestAnalyzer Getting Started with the TimeQuest Analyzer Thissectionprovidesanoverviewofthedesignstepsforsettingupyourprojectfor timingandanalysisandtoconstrainyourdesignwiththeTimeQuestanalyzer. Running the TimeQuest Analyzer ToruntheTimeQuestanalyzerdirectlyfromtheQuartusIIsoftwareGUI,click TimeQuestTimingAnalyzerontheToolsmenu. h FormoreinformationabouttheTimeQuestanalyzerGUI,refertoAboutTimeQuest TimingAnalysisinQuartusIIHelp. ToruntheTimeQuestanalyzerasastand-aloneGUIapplication,typethefollowing commandatthecommandprompt: quartus_staw r ToruntheTimeQuestanalyzerincommand-linemodeforeasyintegrationwith scripteddesignflows,typethefollowingcommandatasystemcommandprompt: quartus_sta -sr Table7–1describestheavailablecommand-lineoptions. Table7–1. SummaryofCommand-LineOptions (Part1of2) Command-LineOption Description -h | --help Provideshelpinformationonquartus_sta. -t <script file> | Sourcesthe<scriptfile>. --script=<script file> -s | --shell Entersshellmode. --tcl_eval <tcl command> EvaluatestheTclcommand<tclcommand>. Forallclocksinthedesign,runthefollowingcommands: report_timing -npaths 1 -to_clock $clock report_timing -setup -npaths 1 -to_clock $clock --do_report_timing report_timing -hold -npaths 1 -to_clock $clock report_timing -recovery -npaths 1 -to_clock $clock report_timing -removal -npaths 1 -to_clock $clock --force_dat Forcesanupdateoftheprojectdatabasewithnewdelayinformation. --lower_priority Lowersthecomputingpriorityofthequartus_staprocess. --post_map Usesthepost-mapdatabaseresults. --sdc=<SDC file> Specifiesthe.sdctouse. --report_script=<script> Specifiesacustomreportscripttocall. --speed=<value> Specifiesthedevicespeedgradeusedfortiminganalysis. GeneratestemporaryfilestoconverttheTimeQuestanalyzer.sdcfile(s)toa --tq2pt PrimeTime.sdc. -f <argument file> Specifiesafilecontainingadditionalcommand-linearguments. -c <revision name> | Specifieswhichrevisionanditsassociated.qsftouse. --rev=<revision_name> QuartusIIHandbookVersion13.1 November2013 AlteraCorporation Volume3:Verification Chapter7: TheQuartusIITimeQuestTimingAnalyzer 7–3 GettingStartedwiththeTimeQuestAnalyzer Table7–1. SummaryofCommand-LineOptions (Part2of2) Command-LineOption Description Specifiesthatallslacksummaryreportsbegeneratedforbothslow-and --multicorner fast-corners. --multicorner[=on|off] Turnsoffmulticornertiminganalysis. --voltage=<value_in_mV> Specifiesthedevicevoltage,inmVusedfortiminganalysis. --temperature= SpecifiesthedevicetemperatureindegreesCelsius,usedfortiminganalysis. <value_in_C> --parallel Specifiesthenumberofcomputerprocessorstouseonamultiprocessorsystem. [=<num_processors>] --64bit Enables64-bitversionoftheexecutable. FormoreinformationaboutstepstoperformbeforeopeningtheTimeQuestanalyzer, referto“RecommendedFlow”onpage7–3. FormoreinformationaboutusingTclcommandstoconstrainandanalyzeyour design,referto“ConstrainingandAnalyzingwithTclCommands”onpage7–7. Recommended Flow TheQuartusIITimeQuestanalyzerperformsconstraintvalidationtotiming verificationaspartofthecompilationflow.Figure7–1showstherecommended designflowtomaximizethebenefitsoftheTimeQuestAnalyzer. Figure7–1. DesignFlowwiththeTimeQuestTimingAnalyzer Create Quartus II Project and Specify Design Files Perform Initial Compilation Specify Timing Requirements Perform Compilation Verify Timing CreatingandSettingUpyour Design YoumustfirstcreateyourprojectintheQuartusIIsoftware.Includeallthenecessary designfiles,includinganyexistingSynopsysDesignConstraints(.sdc)filesthat containtimingconstraintsforyourdesign. h Formoreinformation,refertoManagingFilesinaProjectinQuartusIIHelp. November2013 AlteraCorporation QuartusIIHandbookVersion13.1 Volume3:Verification 7–4 Chapter7: TheQuartusIITimeQuestTimingAnalyzer GettingStartedwiththeTimeQuestAnalyzer PerforminganInitialCompilation Ifyouhavenevercompiledyourdesign,oryoudon'thavean.sdcfile,andyouwant tousetheTimeQuestanalyzertocreateoneinteractively,youmustcompileyour designtocreateaninitialdesigndatabasebeforeyouspecifytimingconstraints.You caneitherperformAnalysisandSynthesistocreateapost-mapdatabase,orperforma fullcompilationtocreateapost-fitdatabase.Creatingapost-mapdatabaseisfaster thanapost-fitdatabase,andissufficientforcreatinginitialtimingconstraints.The typeofdatabaseyoucreatedeterminesthetypeoftimingnetlistgeneratedbythe TimeQuestanalyzer;apost-mapnetlistifyouperformAnalysisandSynthesisora post-fitnetlistifyouperformafullcompilation. 1 Ifyouareusingincrementalcompilation,youmustmergeyourdesignpartitionsafter performingAnalysisandSynthesistocreateapost-mapdatabase. h Formoreinformation,refertoSettingupandRunningAnalysisandSynthesisand SettingupandRunningaCompilationinQuartusIIHelp. SpecifyingTimingRequirements BeforerunningtiminganalysiswiththeTimeQuestanalyzer,youmustspecifyinitial timingconstraintsthatdescribetheclockcharacteristics,timingexceptions,andsignal transitionarrivalandrequiredtimes.YoucanusetheTimeQuestTimingAnalyzer Wizardtoenterinitialconstraintsforyourdesign,andthenrefinetimingconstraints withtheTimeQuestanalyzerGUIorwithaTclscript. 1 TheQuartusIIsoftwareassignsadefaultfrequencyof1GHzforclocksthathavenot beenconstrained,eitherintheTimeQuestGUIoran.sdcfile,unlessanyconstraint existsinthedesign.Inthatcase,allunconstrainedclocksremainunconstrained. h Formoreinformation,refertoSpecifyingTimingConstraintsandExceptionsin QuartusIIHelp. The.sdcmustcontainonlySDCcommands.Tclcommandstomanipulatethetiming netlistorcontrolthecompilationflowshouldberunaspartofaseparateTclscript. Afteryoucreatetimingconstraints,updatethetimingnetlisttoapplythenew constraints.TheTimeQuestanalyzerappliesallconstraintstothenetlistfor verificationandremovesanyinvalidorfalsepathsinthedesignfromverification. 1 Theconstraintsinthe.sdcarereadinsequence.Youmustfirstmakeaconstraint beforemakinganyreferencestothatconstraint.Forexample,ifageneratedclock referencesabaseclock,thebaseclockconstraintmustbemadebeforethegenerated clockconstraint. TheQuartusIITextEditorprovidestemplatesforSDCconstraints.Formore information,referto“UsingtheQuartusIITemplates”onpage7–6. PerformingaFullCompilation Aftercreatinginitialtimingconstraints,youmustfullycompileyourdesign.When compilationiscomplete,youcanopentheTimeQuestanalyzertoverifytimingresults andtogeneratesummary,clocksetupandclockhold,recovery,andremovalreports foralldefinedclocksinthedesign. QuartusIIHandbookVersion13.1 November2013 AlteraCorporation Volume3:Verification Chapter7: TheQuartusIITimeQuestTimingAnalyzer 7–5 GettingStartedwiththeTimeQuestAnalyzer VerifyingTiming TheTimeQuestanalyzerexaminesthetimingpathsinthedesign,calculatesthe propagationdelayalongeachpath,checksfortimingconstraintviolations,and reportstimingresultsaspositiveslackornegativeslack.Negativeslackindicatesa timingviolation.Ifyouencounterviolationsalongtimingpaths,usethetiming reportstoanalyzeyourdesignanddeterminehowbesttooptimizeyourdesign.If youmodify,remove,oraddconstraints,youshouldperformafullcompilationagain. Thisiterativeprocesshelpsresolvetimingviolationsinyourdesign. h Formoreinformation,refertoViewingTimingAnalysisResultsinQuartusIIHelp. Figure7–2showstherecommendedflowforconstrainingandanalyzingyourdesign withintheTimeQuestanalyzer.IncludedarethecorrespondingTclcommandsfor eachstep. Figure7–2. TheTimeQuestTimingAnalyzerFlow Open Project project_open Create Timing Netlist create_timing_netlist Apply Timing Constraints read_sdc Update Timing Netlist update_timing_netlist Verify Static Timing Analysis Results report_clocks_transfers report_sdc report_min_pulse_width report_timing report_net_timing report_clocks report_min_pulse_width report_ucp SDC File Precedence TheFitterandtheTimeQuestanalyzerprocess.sdcfilesintheorderyouspecifyinthe QuartusIISettingsFile(.qsf).Youcanspecifythefilestoprocessandtheorderthey areprocessedfromtheAssignmentsmenu.ClickSettings,thenTimeQuestTiming Analyzer.andspecifyaprocessingorderintheSDCfilestoincludeintheproject box. Ifno.sdcfilesarelistedinthe.qsf,theQuartusIIsoftwarelooksforan.sdcnamed <currentrevision>.sdcintheprojectdirectory.An.sdccanalsobeaddedfroma QuartusIIIPFile(.qip)includedinthe.qsf. November2013 AlteraCorporation QuartusIIHandbookVersion13.1 Volume3:Verification 7–6 Chapter7: TheQuartusIITimeQuestTimingAnalyzer UsingtheQuartusIITemplates Figure7–3showstheorderinwhichtheQuartusIIsoftwaresearchesforan.sdc. Figure7–3. .sdcFileOrderofPrecedence Is one or more .sdc file Yes specified in the .qsf? No Does an .sdc named Yes <current revision>.sdc exist in the project directory? No Analyze the design 1 Ifyoutypetheread_sdccommandatthecommandlinewithoutanyarguments,the TimeQuestanalyzerreadsconstraintsembeddedinHDLfiles,thenfollowsthe.sdc fileprecedenceordershowninFigure7–3. Using the Quartus II Templates Youcancreatean.sdcfromconstrainttemplatesintheQuartusIIsoftwarewiththe QuartusIITextEditor,orwithyourpreferredtexteditor. Creating a Constraint File with the Quartus II Text Editor ToinsertconstraintswiththeQuartusIITextEditor,followthesesteps: 1. OntheFilemenu,clickNew. 2. IntheNewdialogbox,selecttheSynopsysDesignConstraintsFiletypefromthe OtherFilesgroup.ClickOK. 3. ClicktheInsertTemplatebuttononthetexteditormenu,or,right-clickinthe blank.sdcfileintheQuartusIITextEditor,thenclickInsertTemplate. 4. IntheInsertTemplatedialogbox,expandtheTimeQuestsection,thenexpandthe SDCCommandssection. 5. Expandacommandcategory,forexample,Clocks. 6. Selectacommand.TheSDCconstraintappearsinthePreviewpane. 7. ClickInserttopastetheSDCconstraintintotheblank.sdcyoucreatedinstep2. 8. Repeatasneededwithotherconstraints,orclickClosetoclosetheInsert Templatedialogbox. YoucannowuseanyofthestandardfeaturesoftheQuartusIITextEditortomodify the.sdcorsavethe.sdctoeditinatexteditor. QuartusIIHandbookVersion13.1 November2013 AlteraCorporation Volume3:Verification Chapter7: TheQuartusIITimeQuestTimingAnalyzer 7–7 ConstrainingandAnalyzingwithTclCommands h FormoreinformationoninsertingatemplatewiththeQuartusIITextEditor,referto AbouttheQuartusIITextEditorinQuartusIIHelp. Constraining and Analyzing with Tcl Commands YoucanuseTclcommandsfromtheQuartusIIsoftwareTclApplication ProgrammingInterface(API)toconstrain,analyze,andcollectinformationforyour design.ThissectionfocusesonexecutingtiminganalysistaskswithTclcommands; however,youcanperformmanyofthesamefunctionsintheTimeQuestanalyzer GUI.SDCcommandsareTclcommandsforconstrainingadesign.SDCextension commandsprovideadditionalconstraintmethodsandarespecifictotheTimeQuest analyzer.AdditionalTimeQuestanalyzercommandsareavailableforcontrolling timinganalysisandreporting.ThesecommandsarecontainedinthefollowingTcl packagesavailableintheQuartusIIsoftware: ■ ::quartus::sta ■ ::quartus::sdc ■ ::quartus::sdc_ext h FormoreinformationaboutTimeQuestanalyzerTclcommandsandacompletelistof commands,referto::quartus::stainQuartusIIHelp.Formoreinformationabout standardSDCcommandsandacompletelistofcommands,referto::quartus::sdcin QuartusIIHelp.FormoreinformationaboutAlteraextensionsofSDCcommands andacompletelistofcommands,referto::quartus::sdc_extinQuartusIIHelp. Collection Commands TheTimeQuestanalyzerTclcommandsoftenreturnport,pin,cell,ornodenamesina datasetcalledacollection.InyourTclscriptsyoucaniterateoverthevaluesin collectionstoanalyzeormodifyconstraintsinyourdesign. TheTimeQuestanalyzersupportscollectioncommandsthatprovideeasyaccessto ports,pins,cells,ornodesinthedesign.Usecollectioncommandswithanyvalid constraintsorTclcommandsspecifiedintheTimeQuestanalyzer. Table7–2describesthecollectioncommandssupportedbytheTimeQuestanalyzer. Table7–2. SDCCollectionCommands (Part1of2) Command Descriptionofthecollectionreturned all_clocks Allclocksinthedesign. all_inputs Allinputportsinthedesign. all_outputs Alloutputportsinthedesign. all_registers Allregistersinthedesign. Cellsinthedesign.Allcellnamesinthecollectionmatchthespecifiedpattern.Wildcardscanbe get_cells usedtoselectmultiplecellsatthesametime. Clocksinthedesign.Whenusedasanargumenttoanothercommand,suchasthe-fromor-to get_clocks ofset_multicycle_path,eachnodeintheclockrepresentsallnodesclockedbytheclocksin thecollection.Thedefaultusesthespecificnode(evenifitisaclock)asthetargetofacommand. Netsinthedesign.Allnetnamesinthecollectionmatchthespecifiedpattern.Youcanuse get_nets wildcardstoselectmultiplenetsatthesametime. November2013 AlteraCorporation QuartusIIHandbookVersion13.1 Volume3:Verification 7–8 Chapter7: TheQuartusIITimeQuestTimingAnalyzer ConstrainingandAnalyzingwithTclCommands Table7–2. SDCCollectionCommands (Part2of2) Command Descriptionofthecollectionreturned Pinsinthedesign.Allpinnamesinthecollectionmatchthespecifiedpattern.Youcanuse get_pins wildcardstoselectmultiplepinsatthesametime. get_ports Ports(designinputsandoutputs)inthedesign. WildcardCharacters Toapplyconstraintstomanynodesinadesign,usethe“*”and“?”wildcard characters.The“*”wildcardcharactermatchesanystring;the“?”wildcardcharacter matchesanysinglecharacter. Ifyoumakeanassignmenttonodereg*,theTimeQuestanalyzersearchesforand appliestheassignmenttoalldesignnodesthatmatchtheprefixregwithanynumber offollowingcharacters,suchasreg,reg1,reg[2],regbank,andreg12bank. Ifyoumakeanassignmenttoanodespecifiedasreg?,theTimeQuestanalyzer searchesandappliestheassignmenttoalldesignnodesthatmatchtheprefixregand anysinglecharacterfollowing;forexample,reg1,rega,andreg4. AddingandRemovingCollectionItems Wildcardsusedwithcollectioncommandsdefinecollectionitemsidentifiedbythe command.Forexample,ifadesigncontainsregistersnamedsrc0,src1,src2,and dst0,thecollectioncommand[get_registers src*]identifiesregisterssrc0,src1, andsrc2,butnotregisterdst0.Toidentifyregisterdst0,youmustuseanadditional command,[get_registers dst*].Toincludedst0,youcouldalsospecifyacollection command[get_registers {src* dst*}]. Tomodifycollections,usetheadd_to_collectionandremove_from_collection commands.Theadd_to_collectioncommandallowsyoutoaddadditionalitemsto anexistingcollection. Example7–1showstheadd_to_collectioncommandand arguments. Example7–1. add_to_collectionCommand add_to_collection <first collection> <second collection> 1 Theadd_to_collectioncommandcreatesanewcollectionthatistheunionofthetwo specifiedcollections. Theremove_from_collectioncommandallowsyoutoremoveitemsfromanexisting collection.Example7–2showstheremove_from_collectioncommandand arguments. Example7–2. remove_from_collectionCommand remove_from_collection <first collection> <second collection> QuartusIIHandbookVersion13.1 November2013 AlteraCorporation Volume3:Verification Chapter7: TheQuartusIITimeQuestTimingAnalyzer 7–9 ConstrainingandAnalyzingwithTclCommands Example7–3showsexamplesofhowtoaddelementstocollections. Example7–3. AddingItemstoaCollection #Setting up initial collection of registers set regs1 [get_registers a*] #Setting up initial collection of keepers set kprs1 [get_keepers b*] #Creating a new set of registers of $regs1 and $kprs1 set regs_union [add_to_collection $kprs1 $regs1] #OR # Creating a new set of registers of $regs1 and b* # Note that the new collection appends only registers with name b* # not all keepers set regs_union [add_to_collection $regs1 b*] 1 IntheQuartusIIsoftware,keepersareI/Oportsorregisters.An.sdcthatincludes get_keeperscanonlybeprocessedaspartoftheTimeQuestanalyzerflowandisnot compatiblewiththird-partytiminganalysisflows. h Formoreinformationabouttheadd_to_collectionandremove_from_collection commands—includingfullsyntaxinformation,options,andexampleusage—referto add_to_collectionandremove_from_collectioninQuartusIIHelp. Usingthequery_collectionCommand Youcandisplaythecontentsofacollectionwiththequery_collectioncommand. Example7–4showshowtoreportthecontentsofacollection: Example7–4. query_collectionCommand query_collection -report -all $regs_union Youcanalsoexaminecollectionsandexperimentwithcollectionsusingwildcardsin theTimeQuestanalyzerbyclickingNameFinderfromtheViewmenu. Usingtheget_pinsCommand Thecollectioncommandsget_pinsallowyoutorefinesearchesthatincludewildcard characters. Table7–3showsexamplesofsearchstringsthatuseoptionstorefinethesearchand wildcards.TheexamplesinTable7–3filterthefollowingnodeandpinnamesto illustratefunction: ■ foo ■ foo|dataa ■ foo|datab ■ foo|bar ■ foo|bar|datac November2013 AlteraCorporation QuartusIIHandbookVersion13.1 Volume3:Verification 7–10 Chapter7: TheQuartusIITimeQuestTimingAnalyzer ConstrainingandAnalyzingwithTclCommands ■ foo|bar|datad Table7–3. SampleSearchStringsandSearchResults SearchString SearchResult get_pins *|dataa foo|dataa get_pins *|datac <empty>(1) get_pins *|*|datac foo|bar|datac get_pins foo*|* foo|dataa, foo|datab get_pins -hierarchical *|*|datac <empty> (1) get_pins -hierarchical foo|* foo|dataa, foo|datab get_pins -hierarchical *|datac foo|bar|datac get_pins -hierarchical foo|*|datac <empty> (1) get_pins -compatibility_mode *|datac foo|bar|datac get_pins -compatibility_mode *|*|datac foo|bar|datac NotetoTable7–3: (1) Thesearchresultis<empty>becausemorethanonepipecharacter(|)isnotsupported. Thedefaultmethodseparateshierarchylevelsofinstancesfromnodesandpinswith thepipecharacter(|).Amatchoccurswhenthelevelsofhierarchymatch,andthe stringvaluesincludingwildcardsmatchtheinstanceand/orpinnames.Forexample, thecommandget_pins <instance_name>|*|datac returnsallthedatacpinsfor registersinagiveninstance.However,thecommandget_pins *|datacreturnsand emptycollectionbecausethelevelsofhierarchydonotmatch. Usethe-hierarchicalmatchingschemetoreturnacollectionofcellsorpinsinall hierarchiesofyourdesign. Forexample,thecommandget_pins -hierarchical *|datacreturnsallthedatac pinsforallregistersinyourdesign.However,thecommandget_pins -hierarchical *|*|datacreturnsanemptycollectionbecausemorethanonepipecharacter(|)isnot supported. The-compatibility_modeoptionreturnscollectionsmatchingwildcardstrings throughanynumberofhierarchylevels.Forexample,anasteriskcanmatchapipe characterwhenusing-compatibility_mode. QuartusIIHandbookVersion13.1 November2013 AlteraCorporation Volume3:Verification
Description: