- •Contents
- •Preface
- •About This Manual
- •Other Information Sources
- •Syntax Conventions
- •Text Command Syntax
- •About the Graphical User Interface
- •Using Menus
- •Using Forms
- •Introduction to Ambit BuildGates Synthesis
- •Separately Licensed Software Products
- •Low Power Synthesis
- •Physically Knowledgeable Synthesis
- •Datapath Synthesis
- •AC_Shell / DC_Shell Equivalencies
- •Getting Started
- •Invoking Ambit BuildGates Synthesis
- •Exiting Ambit BuildGates Synthesis
- •Files Used in Ambit BuildGates Synthesis Software
- •Key Bindings and Mouse Operations
- •Using the GUI
- •Main Menu Functions
- •File Menu Options
- •Edit Menu Options
- •View Menu Options
- •Commands Menu Options
- •Reports Menu Options
- •Window Menu Options
- •Help Menu Options
- •The Tool Bar
- •The Browsers
- •The Module Browser
- •The Variable Browser
- •Work Area Tools
- •HDL and Tcl Editors
- •Constraints Tool
- •The Schematic Viewer
- •Distributed Processing
- •Update Mode
- •The ac_shell Console
- •The Status Bar
- •Flow Procedures
- •Typical Synthesis Flow
- •Read the Libraries
- •Read the Design Data
- •Build Generic Netlist
- •Set Constraints
- •Optimize the Design
- •Generate Reports
- •Save Final Netlist
- •Viewing the Schematic Design
- •How to Use the Schematic Viewer
- •Keyboard Shortcuts
- •Mouse Operations
- •Objects in the Schematic Database
- •Accessing Context-Sensitive Pop-Up Menus
- •Highlighting Path Between Pins
- •Viewing Bus Properties
- •The Schematic Tool Bar
- •The Module Title Bar
- •Searching for an Object
- •Grouping Instances
- •Dissolving Instances
- •Creating a Unique Module
- •Displaying Logic Cones
- •Extracting Logic Cones
- •Displaying Port Constraints
- •Printing a Schematic
- •Setting Constraints
- •Setting a Hierarchical Context
- •Units in Constraints
- •Timing Constraints
- •Timing Analysis
- •Setting up Timing Context
- •Clock Insertion Delay Time
- •Data Arrival Time
- •External Delay
- •Multicycle Paths
- •Setting Drive Cell for Input Ports
- •Setting Drive Resistance
- •Slew Related Commands
- •Technology and Design Rule Constraints
- •Operating Conditions
- •Estimating Capacitance and Resistance
- •Port Capacitance
- •Capacitance Limit
- •Fanout
- •Fanout Limit
- •External Sources and Sinks
- •Wire Capacitance
- •Wire Resistance
- •Wire Load Model Selection
- •Optimizing Before Place and Route
- •Running do_optimize Command
- •Top-Down Optimization
- •Bottom-Up Optimization
- •Deriving Constraints from Context
- •Time Budgeting
- •Preserving Module Contents
- •Uniquifying Instances
- •Collapsing Hierarchy
- •Incremental Optimization
- •Applying Timing Corrections
- •Optimizing with Logic Transforms
- •Introduction to Transforms
- •Logic Optimization Steps
- •Optimizing Generic Logic
- •Mapping and Unmapping of Generic Logic
- •Constraint-Driven Optimizing
- •Summary Listing of Transform Commands
- •Optimizing After Place and Route
- •Timing Analysis
- •Backannotating
- •A Script Showing the Backannotation of a Design
- •Reading SDF Data
- •Optimizing to Correct Late and Early Slack
- •Report Generation
- •Report Header
- •Timing Reports
- •Area Reports
- •Sample Area Report
- •Library Reports
- •Hierarchy Reports
- •Sample Hierarchy Report
- •Design Rule Violations Reports
- •Sample Design Rule Violations Report
- •VHDL Library Reports
- •Sample VHDL Library Report
- •End Point Slack and Path Histogram Reports
- •Fanin and Fanout Reports
- •Sample Fanin Report
- •Finite State Machine Reports
- •Sample FSM Report
- •Customizing Report Column Width
- •Using Tcl within ac_shell and pks_shell
- •The Tcl Language
- •Procedures
- •Tcl Variables and Control Structures
- •Variables
- •Syntax
- •Tcl Commands
- •get_names Command
- •Abbreviating Commands
- •Searching for Commands
- •Accessing Environment Variables
- •Returning Unix Command Values
- •Error Handling
- •Quick Reference
Ambit BuildGates Synthesis User Guide
Using Tcl within ac_shell and pks_shell
invalid command name “2”
The following examples show control structures:
while {$x == 1} {
# ‘break’ and ‘continue’ are supported in ‘while” and ‘for’ loops
}
for {set i 0} {$i < 10} {incr i} { puts $i
}
switch $x {
0 {puts “got a zero”}
1 {puts “got a one”}
default {puts “default case”}
# no break statements are needed in Tcl switch
}
Tcl supports associative array variables using the array command. Complex Tcl code requires associative array variables.
Tcl Commands
find Command
The find command identifies pieces of a design by name or by partial name regular expression, especially when setting constraints.
The Tcl language supports two methods of pattern matching: glob and regexp. The find command in ac_shell uses the glob style of matching by default, but supports the regular expression style if necessary using the -regexp option.
The glob style is used in the C-shell for matching file names and supports *, ?, and [] metacharacters. The pattern matches any names that match completely (including wildcard characters).
ac_shell> find -port -input clk*
Hierarchical names with wildcards are supported, such as:
September 2000 |
216 |
Product Version 4.0 |
Ambit BuildGates Synthesis User Guide
Using Tcl within ac_shell and pks_shell
ac_shell> find -port -input i*/*/clk_?
The optional regexp style is the same as that used by sed, grep, and lex. It is more powerful, but slightly different than the glob style in a richer set of supported meta-characters and that a match of a substring is sufficient to cause a pattern match.
Commonly used regexp meta-characters are . (a period) which matches any single character, ^ and $ which match the start and end, and * which matches 0 or more of the preceding character (or atom in the general case where an atom can be defined with parentheses).
Because matching any substring is sufficient to cause a match with the name, this finds all the input ports in the current module:
ac_shell> find -regexp -port -input
Beware of issuing a command like this with the -regexp option to identify port named se:
ac_shell> set_false_path -from \
[find -regexp -port -input se]
Using this command will match all input ports containing the string se. Instead, use the start and end meta-characters, enclosed in curly braces to prevent the Tcl engine from interpreting them itself:
ac_shell> set_false_path -from \
[find -regexp -port -input { ^se$ } ]
get_names Command
The get_names command is similar to the find command in that it returns a name from an object_id. The object_id is an ac_shell (not Tcl language) convention of assigning a unique integer to every design object, much like a pointer or handle. The find command goes from name to object_id, and get_names goes back:
ac_shell> find -port out
27462
ac_shell> get_names 27462
out
ac_shell> get_names [find -port out]
out
September 2000 |
217 |
Product Version 4.0 |
Ambit BuildGates Synthesis User Guide
Using Tcl within ac_shell and pks_shell
Most ac_shell commands that take a list of identifiers accept either names or object ids, since they are unambiguous (names cannot start with a number). Never enter numerical object ids manually.
Abbreviating Commands
Tcl allows command name abbreviations, but the abbreviation must be unique. The ac_shell command argument handling also follows this rule, which is helpful for interactive use. However, when writing project scripts it is a good idea to use the full command and argument names to avoid an ambiguity with new commands in a later release of the product or when additional user procedures have been defined.
Searching for Commands
When executing a command, Tcl searches a list of built-in commands, ac_shell commands, and user-defined procedures. Failing a match, it invokes a system call using the command, if it finds it in your path. This is very useful but can be confusing if you did not expect a system call to take place, especially if you are not aware of the command in your Unix path. Also, note that Unix shell features such as expanding ‘~’ to your home directory, are not available using this mechanism.
Accessing Environment Variables
Access environment variables using the global env Tcl array:
ac_shell> puts “Home directory is $env(HOME)”
Returning Unix Command Values
Obtain return values of Unix commands using the exec command:
set mydir [exec pwd]
-or-
set mydir [pwd] cd $mydir
September 2000 |
218 |
Product Version 4.0 |