( ESNUG 256 Item 2 ) -------------------------------------------- [11/22/96]
Subject: (ESNUG 254 #4 255 #3) Can't Reset "max_capacitance" Post-layout!
> ... (DC_SHELL couldn't multiply the value itself because
> the value was a string not a floating point). I then used perl
> to multiply the numbers and add the other syntax of the command.
>
> Here is the dc_shell script (just fill in YOUR_LIB_NAME):
> ...
> max_cap = get_attribute(fullname, max_capacitance)
> ...
> You can use perl to multiply the number and format the file into a
> dc_shell script to be read back into synopsys ...
From: "David C. Black" <dblack@ink.apple.com>
John,
I loved Jeff Scott's solution except that there is a minor optimization
that can be had. He apparently didn't realize that the return from the
get_attribute command is actually a list consisting of zero or one
elements. This can be processed as follows (replacing respective part of
Jeffrey's script):
$max_cap_list = get_attribute fullname "max_capacitance"
if($max_cap_list) {
foreach ($max_cap,$max_cap_list) {
set_attribute fullname "max_capacitance" (1.25 * $max_cap)
}/*endforeach*/
}/*endif*/
If preferred, you may echo the set_attribute line to a file for later
execution. Just remember that the in-line version is more reliable in
case your library changes and you might forget to update a script. On
the other hand, stability in the file for regression might be preferred.
SCRIPTING NOTE/TIP: I put a dollar sign in front of all user defined
variables in Synopsys to avoid potential collisions with current and/or
future keywords in dc_shell. Also, I quote all synopsys keyword
arguments unless I intend to use a variable.
This comes from experience where another designer tried:
design = "top";
...
all_designs = find(design,"*")
Synopsys complained of syntax because it was processing find(top,"*")!
Instead, we now use:
$design = "top";
...
all_designs = find("design","*");
Since Synopsys is always adding new and even hidden features to their
syntax, I chose to take preventive measures. Too bad Synopsys doesn't
advertise a reasonable safe naming space BTW, I dislike my_ in all
variables, and $ is quite natural to anyone with UNIX(tm) scripting
experience.
- David C. Black
Apple Computer
---- ---- ---- ---- ---- ---- ----
From: sgolson@trilobyte.com (Steve Golson)
John,
The get_attribute doesn't return a string; it returns a list. If it was
a string there would be no problem, because dc_shell will coerce the
string to a number when it needs to.
What you need to do is extract the number from the list. Here is a
trick using foreach that works great. It extracts the first (and only)
element from the list and returns it in the variable "thecap":
dc_shell> get_attribute access05_5v/AND2X2/A capacitance
Performing get_attribute on port 'A'.
{0.012400}
dc_shell> foreach (thecap, dc_shell_status) { ; }
1
dc_shell> list thecap
thecap = 0.012400
1
So your script would look like
library = YOUR_LIB_NAME
cells_in_lib = library + "/" + "*"
cells = find( cell, cells_in_lib)
foreach ( cellname, cells ) {
pins_in_cell = cellname + "/" + "*"
pins = find( pin, pins_in_cell)
list pins
foreach ( pinname, pins ) {
fullname = cellname + "/" + pinname
list fullname
get_attribute fullname max_capacitance
if (dc_shell_status) {
foreach (thecap, dc_shell_status) { ; }
newcap = thecap * 1.25
set_attribute fullname max_capacitance newcap
}
}
}
No need to use perl.
Let me know how it works for you.
- Steve Golson
Trilobyte Systems
---- ---- ---- ---- ---- ---- ----
From: eugena@taec.com (Eugena Talvola)
Hi John,
I have modified the max_capacitance setting script to do everything
within dc_shell. It's probably more convenient than running dc_shell
and perl.
library = YOUR_LIBRARY
cells_in_lib = library + "/" + "*"
cells = find( cell, cells_in_lib)
foreach ( cellname, cells ) {
pins_in_cell = cellname + "/" + "*"
pins = find( pin, pins_in_cell)
list pins
foreach ( pinname, pins ) {
fullname = cellname + "/" + pinname
pindir = get_attribute(fullname,pin_direction) > /dev/null
list fullname
if (pindir == "out" || pindir == "inout"){
get_attribute fullname max_capacitance
if(dc_shell_status) {
max_cap = get_attribute(fullname,max_capacitance)
echo "set_attribute" fullname "max_capacitance" max_cap >> cap.list}
}
}
}
sh "cat cap.list | sed -e 's/[{}]//g' > .normal_max_cap"
sh "awk '{$4 = 1.5 * $4; print $0}' .normal_max_cap > new_max_cap.inc"
include new_max_cap.inc
Change 1.5 to whatever multiplication factor you want all max_cap
values will be modified uniformly. You can always modify some values
further in ".normal_max_cap" if there are other requirements.
- Eugena Talvola
Toshiba America Electronic Components, Inc
|
|