FPGA学习笔记7-Quartus II其余的部分TCL指令
2012-01-27 14:41
381 查看
Agenda
-Other Tcl Scripting Commands
-Accessing Command Line Options
-Using Tcl in Quartus II Software
-Getting More Help
::quartus::misc Package
-Utility and Miscellaneous Commands
Loaded by Default in Every Executable
-Some Commonly Used Commands
escape_brackets
post_message
escape_brackets Command
-Many Quartus II Tcl Commands Allow Regular Expressions in Option Arguments
-Improperly Escaping Bus Names Is a Common Error
address\[10\]
Regular Expression Matches address0 or address1
-Square Brackets Must Be Escaped Twice
address\\\[10\\\]
-Use escape_brackets Command For Convenience
-Example:Get All Location Assignments for Bus address[]
Example:
post_message Command
-Formats Text Like Quartus II Message Types
-Specify Message Type and Text
info,extra_info,warning,critical_warning,error
Tcl Collections
-Some Tcl Commands Return Large Sets of Data
-Collection Is Container for Large Data Sets
Specific to Quartus II Tcl API
-Access Collection Elements with foreach_in_collection Command
Same Syntax as foreach Tcl Command
-Packages with Commonds that Return Collections Include foreach_in_collection
-No Need to Load Separate Package
Tcl Collection Example
-Print Details of All Instance Assignments
Access Command-Line Options
-Quartus II Version 4.1 Supports argv,argc,and argv0
Earlier Versions Pass Arguments in quartus(args) Variable
quartus(args) Still Supported
Command-Line Options Example
-cmdline Package Provides Flexible Access to Command-Line Options
More Robust than Hard-Coded Indexing into List of Command_Line Options
Include with Quartus II
-Example with cmdline Package
quartus_sh -t myscript.tcl -project my_project -revision second-Open Project with Optional Revision Name
Using Tcl in Quartus II
-Command-Line Executables
Batch Mode to Execute Script Files
Interactive Shell
Quick Tcl Evaluation of Command Arguments
-Tcl Console in GUI
Interactive Shell
View Menu(View->Unity windows->Tcl console)
Using Tcl at the Command Line
-Run Script File
quartus_sh -t <script file> [<script arguments>]
quartus_sh -t myscript.tcl Stratix
-Interactive Tcl Shell
quartus_sh -s
-Direct Tcl Evaluation
quartus_sh --tcl_eval <tcl command>
quartus_sh --tcl_eval help -pkg flow
-Same Syntax for Other Executable
Running Tcl Scripts
-Command-Line Executables Supporting Tcl
Why Different Executables?
-Different Executables Support Different Functionality
Different Tcl Packages Available
-Example
quartus_cdb Supports LogicLock Functions,
Not Timing Analysis Functions
Basic Project Functions Supported by All
-Executable and Package Matrix in Tcl Script Chapter of Quartus II Handbook
Also Type help at Tcl Shell Prompt for List
Quartus II Tcl Scripts
-Tcl Scripts Included with Quartus II
Design Space Explorer(DSE)
QHelp Unility
QFlow Script
-Scripts Listed in Tcl Scripts (Tools menu)
-Modify to Suit Needs
Pop Quiz
-List Three Ways to Use Tcl Scripts and Commands with Quartus II software
Pop Quiz Answer
-Tcl Console in Quartus II GUI
-Interactive Tcl Shell in Command-Line Executable
Batch Mode of Command-Line Executables
Direct Execution Mode of Command-Line Executable
-Tcl Toolbar Buttions(Not Covered in Presentation)
-Other Tcl Scripting Commands
-Accessing Command Line Options
-Using Tcl in Quartus II Software
-Getting More Help
::quartus::misc Package
-Utility and Miscellaneous Commands
Loaded by Default in Every Executable
-Some Commonly Used Commands
escape_brackets
post_message
escape_brackets Command
-Many Quartus II Tcl Commands Allow Regular Expressions in Option Arguments
-Improperly Escaping Bus Names Is a Common Error
address\[10\]
Regular Expression Matches address0 or address1
-Square Brackets Must Be Escaped Twice
address\\\[10\\\]
-Use escape_brackets Command For Convenience
-Example:Get All Location Assignments for Bus address[]
Example:
set address_names "address\[*\]" set address_locations [get_all_instance_assignments \ -to [escape_brackets $address_names] -name LOCATION]
post_message Command
-Formats Text Like Quartus II Message Types
-Specify Message Type and Text
info,extra_info,warning,critical_warning,error
Tcl Collections
-Some Tcl Commands Return Large Sets of Data
-Collection Is Container for Large Data Sets
Specific to Quartus II Tcl API
-Access Collection Elements with foreach_in_collection Command
Same Syntax as foreach Tcl Command
-Packages with Commonds that Return Collections Include foreach_in_collection
-No Need to Load Separate Package
Tcl Collection Example
-Print Details of All Instance Assignments
set instance_assignments [get_all_instance_assignments -name *] foreach_in_collection instance $instance_assignments { set sect_id[lindex $instance 0] set src[lindex $instance 1] set dest[lindex $instance 2] set name[lindex $instance 3] set value[lindex $instance 4] puts "Section ID ($sect_id)" puts "Source ($src)" puts "Destination ($dest)" puts "Assignment Name ($name)" puts "Assignment value ($value)" }
Access Command-Line Options
-Quartus II Version 4.1 Supports argv,argc,and argv0
Earlier Versions Pass Arguments in quartus(args) Variable
quartus(args) Still Supported
Version 4.1 Variable | Earlier Version Equivalent |
argv | quartus(args) |
argc | llength $quartus(args) |
argv0 | info nameofexecutable |
-cmdline Package Provides Flexible Access to Command-Line Options
More Robust than Hard-Coded Indexing into List of Command_Line Options
Include with Quartus II
-Example with cmdline Package
quartus_sh -t myscript.tcl -project my_project -revision second-Open Project with Optional Revision Name
package require cmdline set options {\ {"project.arg""""Project Name"}\ {"revision.arg""""Revision Name"}\ } array set optshash [::cmdline::getoptions ::argv $options "Options:"] if{[string equal "" $optshash(revision)]}{ #No revision is specified project_open $optshash(project) }else{ project_open $optshash(project) -revision $optshash(revision) } #The rest of your script follows here
Using Tcl in Quartus II
-Command-Line Executables
Batch Mode to Execute Script Files
Interactive Shell
Quick Tcl Evaluation of Command Arguments
-Tcl Console in GUI
Interactive Shell
View Menu(View->Unity windows->Tcl console)
Using Tcl at the Command Line
-Run Script File
quartus_sh -t <script file> [<script arguments>]
quartus_sh -t myscript.tcl Stratix
-Interactive Tcl Shell
quartus_sh -s
-Direct Tcl Evaluation
quartus_sh --tcl_eval <tcl command>
quartus_sh --tcl_eval help -pkg flow
-Same Syntax for Other Executable
Running Tcl Scripts
-Command-Line Executables Supporting Tcl
Name | Common Uses |
quartus_sh | Assignments,General Reporting,Compiling,Simple Shell |
quartus_tan | Timing Reporting,Advanced Timing Analysis |
quartus_cdb | Back Annotation,LogicLock Regions,Chip Editor Functions |
quartus_sim | Simulate with Tcl Testbenches |
-Different Executables Support Different Functionality
Different Tcl Packages Available
-Example
quartus_cdb Supports LogicLock Functions,
Not Timing Analysis Functions
Basic Project Functions Supported by All
-Executable and Package Matrix in Tcl Script Chapter of Quartus II Handbook
Also Type help at Tcl Shell Prompt for List
Quartus II Tcl Scripts
-Tcl Scripts Included with Quartus II
Design Space Explorer(DSE)
QHelp Unility
QFlow Script
-Scripts Listed in Tcl Scripts (Tools menu)
-Modify to Suit Needs
Pop Quiz
-List Three Ways to Use Tcl Scripts and Commands with Quartus II software
Pop Quiz Answer
-Tcl Console in Quartus II GUI
-Interactive Tcl Shell in Command-Line Executable
Batch Mode of Command-Line Executables
Direct Execution Mode of Command-Line Executable
-Tcl Toolbar Buttions(Not Covered in Presentation)
相关文章推荐
- FPGA学习笔记6-Quartus II中的TCL脚本(翻译)
- FPGA学习笔记7-Quartus II其余的部分TCL指令(翻译)
- FPGA学习笔记6-Quartus II中的TCL脚本
- Vue学习笔记——指令和部分组件
- SIM900AAT指令GPRS部分学习笔记
- OA学习笔记-010-Struts部分源码分析、Intercepter、ModelDriver、OGNL、EL
- android 多媒体部分学习笔记十二----mediaplay自定义播放器
- java学习之部分笔记
- docker学习笔记18:Dockerfile 指令 VOLUME 介绍
- angular学习的一些小笔记(中)之基础ng指令
- 【精选】Nginx模块Lua-Nginx-Module学习笔记(二)Lua指令详解(Directives)
- centos学习笔记--gdb调试部分
- 【SpringBoot学习笔记】SpringBoot_03_SpringData—JpaRepository部分字段查询功能
- Linux 学习笔记 -- 第二部分 Linux 文件、目录与磁盘格式 -- 第9章 文件与文件系统的压缩与打包
- 开始新的学习之旅--PHP开发学习--基础部分笔记
- angularjs学习笔记—事件指令
- 编译原理之学习 lua 1.1 笔记 (三) 表对象 array 及其相关指令
- OpenMP 之for指令并行求和(学习笔记)
- arm学习笔记四(arm伪指令)