没有合适的资源?快使用搜索试试~ 我知道了~
首页ug835-vivado-tcl-commands,TCL脚本语言教程
ug835-vivado-tcl-commands,TCL脚本语言教程
需积分: 49 543 浏览量
更新于2023-05-30
评论
收藏 8.84MB PDF 举报
Tcl(Tool Command Language)是一种很通用的脚本语言,它几乎在所有的平台上都可以解释运行,而且VIVADO也提供了TCL命令行。最近发现TCL脚本貌似比GUI下操作VIVADO效率高一些,方便一些。 应用程序(如VIVADO)使用Tcl作为它的命令语言的好处: 1 Tcl提供了标准语法,一旦用户掌握了Tcl就可以很容易的发布命令给基于Tcl的程序。 2 Tcl实现了很多的功能,使你的工作变得很方便。 3 TCl可作为程序间通信的接口。
资源详情
资源评论
资源推荐

VivadoDesignSuiteTclCommand
ReferenceGuide
UG835(v2012.2)July25,2012

NoticeofDisclaimer
Theinformationdisclosedtoyouhereunder(the"Materials")isprovidedsolelyfortheselectionanduse
ofXilinxproducts.Tothemaximumextentpermittedbyapplicablelaw:(1)Materialsaremadeavailable
"ASIS"andwithallfaults,XilinxherebyDISCLAIMSALLWARRANTIESANDCONDITIONS,EXPRESS,
IMPLIED,ORSTATUTORY,INCLUDINGBUTNOTLIMITEDTOWARRANTIESOFMERCHANTABILITY,
NON-INFRINGEMENT,ORFITNESSFORANYPARTICULARPURPOSE;and(2)Xilinxshallnotbeliable
(whetherincontractortort,includingnegligence,orunderanyothertheoryofliability)foranylossor
damageofanykindornaturerelatedto,arisingunder,orinconnectionwith,theMaterials(including
youruseoftheMaterials),includingforanydirect,indirect,special,incidental,orconsequentiallossor
damage(includinglossofdata,prots,goodwill,oranytypeoflossordamagesufferedasaresultof
anyactionbroughtbyathirdparty)evenifsuchdamageorlosswasreasonablyforeseeableorXilinx
hadbeenadvisedofthepossibilityofthesame.Xilinxassumesnoobligationtocorrectanyerrors
containedintheMaterialsortonotifyyouofupdatestotheMaterialsortoproductspecications.
Youmaynotreproduce,modify,distribute,orpubliclydisplaytheMaterialswithoutpriorwritten
consent.CertainproductsaresubjecttothetermsandconditionsoftheLimitedWarrantieswhichcan
beviewedath
ttp://www.xilinx.com/warranty.htm;IPcoresmaybesubjecttowarrantyandsupport
termscontainedinalicenseissuedtoyoubyXilinx.Xilinxproductsarenotdesignedorintendedtobe
fail-safeorforuseinanyapplicationrequiringfail-safeperformance;youassumesoleriskandliability
foruseofXilinxproductsinCriticalApplications:http://www.xilinx.com/warranty.htm#critapps.
©Copyright2002-2012XilinxInc.Allrightsreserved.Xilinx,theXilinxlogo,Artix,ISE,Kintex,Spartan,
Virtex,Zynq,andotherdesignatedbrandsincludedhereinaretrademarksofXilinxintheUnitedStates
andothercountries.ThePowerPCnameandlogoareregisteredtrademarksofIBMCorp.,andused
underlicense.Allothertrademarksarethepropertyoftheirrespectiveowners.
VivadoDesignSuiteTclCommandReferenceGuide
UG835(v2012.2)July25,2012w
ww.xilinx.com2

Chapter1
Introduction
OverviewofTclCapabilitiesinVivado
TheToolCommandLanguage(Tcl)isthescriptinglanguageintegratedintheVivado™
toolenvironment.Tclisastandardlanguageinthesemiconductorindustryforapplication
programminginterfaces,andisusedbySynopsys®DesignConstraints(SDC).
SDCisthemechanismforcommunicatingtimingconstraintsforFPGAsynthesistoolsfrom
SynopsysSynplifyaswellasothervendors,andisatimingconstraintindustrystandard;
consequently,theTclinfrastructureisa“BestPractice”forscriptinglanguage.
Tclletsyouperforminteractivequeriestodesigntoolsinadditiontoexecutingautomated
scripts.Tclofferstheabilityto“ask”questionsinteractivelyofdesigndatabases,particularly
aroundtoolanddesignsettingsandstate.Examplesare:queryingspecictiminganalysis
reportingcommandslive,applyingincrementalconstraints,andperformingqueriesimmediately
aftertoverifyexpectedbehaviorwithoutre-runninganytoolsteps.
ThefollowingsectionsdescribesomeofthebasiccapabilitiesofTclwithVivado.
NoteThischapterisnotacomprehensivereferencetoTclcommands.Thischapterdoes
providereferencestoTclresources,anddescribesthegeneralcapabilitiesofTclintheVivado
environment.
TclJournalFiles
WhenyouinvoketheVivadotool,itwritesthevivado.logletorecordthevariouscommand
andoperationsperformedduringthedesignsession.TheVivadotoolalsowritesalecalled
vivado.jouwhichisajournalofjusttheTclcommandsrunduringthesessionthatcanbe
usedasasourcetocreatenewTclscripts.
NoteAbackupversionofthisle,calledvivado.jou.backup,iswrittentosavethedetails
ofthepreviousrun.
VivadoDesignSuiteTclCommandReferenceGuide
UG835(v2012.2)July25,2012www.xilinx.com3

Introduction
TclHelp
TheTclhelpcommandprovidesinformationrelatedtothesupportedTclcommands.
•help—ReturnsalistofTclcommandcategories.
help
Commandcategoriesaregroupsofcommandsperformingaspecicfunction,like
FileI/Oforinstance.
•help-categorycategory—Returnsalistofcommandsfoundinthespecied
category.
help-categoryobject
ThisexamplereturnsthelistofTclcommandsforhandlingobjects.
•helppattern—Returnsalistofcommandsthatmatchthespeciedsearchpattern.
Thisformcanbeusedtoquicklylocateaspeciccommandfromagroupofcommands.
helpget_*
ThisexamplereturnsthelistofTclcommandsbeginningwithget_.
•helpcommand—Providesdetailedinformationrelatedtothespeciedcommand.
helpget_cells
Thisexamplereturnsspecicinformationoftheget_cellscommand.
•help-argscommand—Providesanabbreviatedhelptextforthespecied
command,includingthecommandsyntaxandabriefdescriptionofeachargument.
help-argsget_cells
•help-syntaxcommand—Reportsthecommandsyntaxtforthespeciedcommand.
help-syntaxget_cells
StartingtheVivadoTool
TheVivadoDesignSuiteprovidesthreeprimarymodesofoperation:
•TheGUImode(default)
•StartingtheVivadotoolusingaTclcommand-lineoption(Batchmode)
•Tclshellmode
BatchMode
WhenyoustarttheVivadotool,itlooksforaTclinitializationscriptintwodifferentlocations:
1.installdir/Vivado/version/scripts/init.tcl
2.userdir/Xilinx/Vivado/init.tcl
VivadoDesignSuiteTclCommandReferenceGuide
UG835(v2012.2)July25,2012www.xilinx.com4

Introduction
Where:
•installdiristheinstallationdirectorywheretheVivadoDesignSuiteisinstalled,and
•userdirisyourhomedirectory.
°
ForWindows7:%APPDATA%/Roaming/Xilinx/Vivado/init.tcl
°
ForWindowsXP:%APPDATA%/Xilinx/Vivado/init.tcl
°
ForLinux:$HOME/.Xilinx/Vivado/init.tcl
Ifinit.tclexists,inoneorbothofthoselocations,theVivadotoolsourcesthisle;rst
fromtheinstallationdirectoryandsecondfromyourhomedirectory.
•Theinit.tclleintheinstallationdirectoryallowsacompanyordesigngroupto
supportacommoninitializationscriptforallusers.AnyonestartingtheVivadotool
fromthatinstallationlocationsourcesthatinit.tclscript.
•Theinit.tclleinthehomedirectoryallowseachusertospecifyadditional
commands,ortooverridecommandsfromthetoolinstallationtomeettheirspecic
designrequirements.
Theinit.tcllleisastandardTclcommandlethatcancontainanyvalidTclcommand
supportedbytheVivadotool.YoucanalsosourceanotherTclscriptlefromwithininit.tcl
byaddingthefollowingstatement:
sourcepath_to_file/file_name.tcl
GeneralTclSyntaxGuidelines
TclusestheLinuxleseparator(/)conventionregardlessofwhichOperatingSystemyou
arerunning.
ThefollowingsubsectionsdescribethegeneralsyntaxguidelinesforusingTclintheVivado
DesignSuite.
SourcingaTclScript
ATclscriptcanbesourcedfromeitheroneofthecommand-lineoptionsorfromtheGUI.
WithintheVivadoIntegratedDesignEnvironment(IDE)youcansourceaTclscriptfromTools>
RunTclScript.
YoucansourceaTclscriptfromaTclcommand-lineoption:
sourcefile_name
WhenyouinvokeaTclscriptfromtheVivadoIDE,aprogressbarisdisplayedandalloperations
intheIDEareblockeduntilthescriptscompletes.
VivadoDesignSuiteTclCommandReferenceGuide
UG835(v2012.2)July25,2012www.xilinx.com5
剩余816页未读,继续阅读














安全验证
文档复制为VIP权益,开通VIP直接复制

评论0