You are on page 1of 11

Question:

How can I load .lib files without using Library Compiler?


Answer:
The new data preparation flow is able to load the Synopsys library format (.lib)
files directly into Milkyway. Astro calls Library Compiler to convert the .lib
files to LM views in Milkyway. If Library Compiler is not available, it is
possible to use Design Compiler. Design Compiler can convert .lib files if
they do not have function attributes and if they can be considered to be black
box cells (such as RAMs, ROMs, or other macros, but not standard cells).

If the cells have functionality and you are using Design Compiler to load
the .lib files, all functionality will be stripped when you create the
LM view.

To use Design compiler, create a symbolic link in your search path. For example,

ln -s /<DCPath>/dc_shell lc_shell

Astro calls lc_shell by default, but when you create this link, Design Compiler
is called.


Question:
We usually have max, min, and typical corners. Is it possible to define
multiple corners using different .db files in the Milkyway library preparation
flow?
Answer:
Yes, you can set multiple .db files in the Milkyway library preparation flow
as shown below.

----------------------
readLibForm "logical"
gePrepLibs
setFormField "Library Preparation" "Library Name" "fromlef"
setFormField "Library Preparation" "Min DB To Import" "../DB/std_cell_fast.db
../DB/std_cell_fast1.db ../DB/std_cell_fast2.db"
setFormField "Library Preparation" "Max DB To Import" "../DB/std_cell_slow.db
../DB/std_cell_slow1.db ../DB/std_cell_slow2.db"
formOK "Library Preparation"


Question:
How can I remove a Milkyway library lock?

lib_bck can become corrupt or locked; what can I do when this happens?
Answer:
To resolve this problem, use the following steps:

1. Rename the locked library to another library name; that is, change design to
design_bck.
2. Create a Milkway library with the same name as the original locked library;
that is, using the same technology file (.tf), change the name to design.
3. Copy the CEL/FRAM/NETL/EXP from the backup design_bck library to the newly
created design library.


4. Run dbRebuildLib on "design".


Question:
How do I complete or create a Milkyway library using UNIX/Linux copy?

Answer:
It is recommended that you use Milkyway Copy Cell commands to copy cells
from one library to another. However, sometimes you only have directories with
a part of the views and no library to copy views or cells from. If you only use
UNIX cp (use the same command for Linux) to copy a view directory (for example,
NETL) into your library, Milkyway, Apollo, Astro, and so on will not see these
views, because they are not registered in the .lib file.

If you cannot use Milkyway Copy Commands (these are recommended) to copy cell
views, you basically have to follow 6 steps to complete your library. (Detailed
steps follow the summary.)

Summary of Steps
1. Start from an existing library or create one.
2. Create a list of cells to be copied.
3. Create all these cells as empty views in the Milkyway library
(then, they're registered).
4. Remove these empty cells through UNIX/Linux
5. Replace the removed cells with the cells/views you wanted to
copy.
6.Run dbRebuildLib (just in case).

Detailed Steps
1. Either start from an existing library or create a library (cmCreateLib).
2. Create a list of cells to be copied.

Gain a list of all cells that have to be copied by going into the source
directory, listing all cells (ls in UNIX), and redirecting the result into
a file.

For example, say you want to copy .NETL views into a library named std_lib but
you have only a NETL directory with contents but no library:

# ls ./download/NETL > ../../contents.text

You will need this list again, so keep a copy. Be sure to remove any :1, :2,
and so on from the end of the cell name.

You can do the same for any other view (such as .CEL or .FRAM) by replacing
NETL in the example.

3. Create all the cells as empty views in the Milkyway library (this way,
they become registered).

Create a command script by completing a copy of this list (in an editor or
by using cat) to read

geCreateCell
setFormField "Create Cell" "Cell Name" "XXXXX.NETL"
formOK "Create Cell"
geCloseWindow
formButton "Close Window" "DiscardAll"
formOK "Close window"

For every cell in the list, replace XXXXX with the cell name.
Load the script into Milkyway, Apollo, or Astro. First, open the library in
question (geOpenLib). Next, load your cell creation script. You will have all


the cells you want to copy as empty cells in the view you wanted.

4. Remove the empty cells by using UNIX/Linux.
You can keep Apollo or Astro open for this step:

IMPORTANT Do not use the Milkyway remove command for this step.

You can remove the whole NETL directory or single cells within the directory by
using the UNIX rm command:

# rm NETL/XXXXXXXXX:1

You can create a script by using a copy of your content list.

Repeat steps 2 through 4 for every view type you want to copy.


5. Replace the removed cells with the cells/views you wanted to copy.

You can now copy all the views you wanted to copy into the view directory where
they should be (in this case, NETL).

Example line of the script:

cp ../../download/NETL/XXXXXXX* ./std_lib/NETL


6. Run dbRebuildLib.

Use dbRebuildLib "library name" in case there are mismatches.

All cells should now be in the view directory and registered in the .lib file.


Disabling Layer Translation With nonMask in the Milkyway
Technology File
Question:

In the Milkyway technology file, the following layer definition specifies metal1 on layer 16 and
metal1 blockage (M1BLOCK) on layer 16, datatype 9:
Layer "metal1" {
layerNumber = 16
maskName = "metal1"
color = "cyan"
lineStyle = "solid"
pattern = "dot"
...

LayerDataType "M1BLOCK" {
layerNumber = 16
dataTypeNumber = 9
visible = 0
selectable = 0
...


Why does StarRC translate datatype 9 of metal1 blockage even though it is not mapped in the
layer mapping file?
Answer:

For backward compatibility, in the library technology file (library.tf), the default of
the nonMask field is false for any layer datatype (LayerDataType). Therefore, all the layer
datatypesLayerDataType (x;9), (x;40)that share a common layer (16;0) merge into their
corresponding common layer as follows:
(16;9) + (16;40) + (16;0) = (16;0)
If this default behavior produces undesirable results, you can separate the LayerDataType from
the respective layers. To do this, disable layer translation for each datatype by
specifying nonMask = 1 in the Milkyway library technology file, as shown in the following
example:
Layer "metal1" {
layerNumber = 16
maskName = "metal1"
color = "cyan"
lineStyle = "solid"
pattern = "dot"
...

LayerDataType "M1BLOCK" {
layerNumber = 16
dataTypeNumber = 9
nonMask = 1
visible = 0
selectable = 0
...



Setting Port Type Properties in Milkyway
Script Documentation
The Milkway data preparation environment provides the dbSetCellPortTypes
command for setting port type properties on a cell (CEL or FRAM view). The
command is typically used as follows:

dbSetCellPortTypes libraryName cellName '(
("VDD" "Power" )
("VSS" "Ground" )
) #t



This command works fine if you need to process a single cell (or even a small
number of cells). However, if you must process a large number of cells, it is
more efficient to use the set_porttypes function on a list of cells (see the
script at the end of this article). To use this function, save it in a file
called set_porttypes.scm, then enter the following command on the Astro command
line:

> load "set_porttypes.scm"

The following example shows a typical use of this function:

> set_porttypes (list "PVDD1DGZ" "PVDD1DGZ_UP") "Power" "VDD"

Sometimes it is easier to first define the list of cells to be processed. This
type of usage is documented in the script header.

;########################################################################
;# FUNCTION: set_porttypes
;#
;# DESCRIPTION
;# Sets port type attributes on a list of cells; typically when
;# adding type=Power or type=Ground attributes to pad P/G pins.
;# Pin direction=Inout is implied.
;#
;# USAGE EXAMPLE
;# set_porttypes (list "PVDD1DGZ" "PVDD1DGZ_UP") "Power" "VDD"
;# --OR--
;# define vss_analog_padList (list "PVSS1A" "PVSS2A")
;# set_porttypes vss_analog_padList "Ground" "VSSA"
;########################################################################
(define set_porttypes (lambda (cellList pinType pinName) (begin
(for-each (lambda (cellName)
(let* (
(args (list))
(pinDir "Inout")
)
(begin
(display
(string-append "INFO (set_porttypes): Setting port type '" pinType "' on
pin '" pinName "' in cell " cellName " (library="libraryName")")
)
(newline)
(set! args (append args (list (string pinName))))
(set! args (append args (list pinDir)))
(set! args (append args (list (string pinType))))
(dbSetCellPortTypes libraryName cellName (list args) #f )
)
)
) cellList)))
)

Creating a Milkyway Library and Technology (.tf) File from
LEF

Question:
How can I create a Milkyway library from LEF and write out a technology file using Milkyway in Tcl
mode?
Answer:


You can create a Milkyway library from LEF and write out a technology file without the Milkyway
GUI by using Tcl mode. Use the following sample script:
Milkyway -galaxy -nogui -tcl -log read_lef.log -file one.tcl
The one.tcl file can contain the following:
read_lef -lib_name TEST -tech_lef_files tech.lef -cell_lef_files "stdcell.lef
macro.lef"
cmDumpTech
setFormField "Dump Technology File" "Library Name" "TEST"
setFormField "Dump Technology File" "Technology File Name" "TEST.tf"
formOK "Dump Technology File"
exit
This creates a Milkyway library called TEST that is created by using technology information from
the tech.lef file and cell information from the stdcell.lef and macro.lef files.
The TEST.tf technology file is written out from the library. The log file for all the messages written
out during the run is located in the read_lef.log file.


Creating Milkyway Libraries (FRAM Views) for a List of
Memories

Question:
Is there any script to create Milkyway libraries automatically for a list of
memories?
Answer:
You can automate creating Milkyway libraries for list of memories.
Usually every design has a number of memories that need to have corresponding
Milkway libraries (FRAM views) for starting any of the physical design
steps such as place & route. If the number of memories used is high, it is
tedious to create Milkway data for each. This task can be simplified by iterating
the steps for each macro using a loop.

The first step is create a list file in Scheme format. For example "lib_list.scm"
is shown below

;------------------------------------------------------------
define library_list '(
"ST_SPREG_1056x33m8"
"ST_SPREG_24x132m2"
)
;------------------------------------------------------------

Then, modify the following "create_mw_libs.scm" Scheme script for the correct
paths, and load the scheme script in Milkyway or Astro.

;==============================================================================
load "lib_list.scm"

define tech_file "/home/projects/design1/tech_files/icc_tech.tf"
define data_path "/home/projects/design1/memories"
define db_path "/home/projects/design1/mem/db_dir""

(for-each (lambda (lib_name)

(cmCreateLib)


(setFormField "Create Library" "Library Name" lib_name)
(setFormField "Create Library" "Technology File Name" tech_file)
(setFormField "Create Library" "Set Case Sensitive" "1")
(formOK "Create Library")

(cmSetBusNameStyle)
(formDefault "Set Bus Naming Style")
(setFormField "Set Bus Naming Style" "Library Name" lib_name)
(setFormField "Set Bus Naming Style" "Bus Naming Style" "[%d]")
(formOK "Set Bus Naming Style")

(read_lef)
(formDefault "Read LEF")
(setFormField "Read LEF" "Library Name" lib_name)
(setFormField "Read LEF" "Manual Library Prep Mode" "1")
(setFormField "Read LEF" "Cell LEF Files" (string-append data_path "/" lib_name
"/LEF/" lib_name ".lef"))
(setFormField "Read LEF" "Manual Library Prep Mode" "0")
(formOK "Read LEF")

;---------------------------------------------------------------------
;Note: Uncomment following to load ANTENNA lef data
;---------------------------------------------------------------------
; (read_lef)
; (formDefault "Read LEF")
; (setFormField "Read LEF" "Library Name" lib_name)
; (setFormField "Read LEF" "Manual Library Prep Mode" "1")
; (setFormField "Read LEF" "Cell LEF Files" (string-append data_path lib_name
"/LEF/" lib_name ".alef"))
; (setFormField "Read LEF" "Manual Library Prep Mode" "1")
; (formOK "Read LEF")

;---------------------------------------------------------------------
;Note: Comment following 9 lines using semi-colon if you don't want to create LM
views.
; LM views are only needed for Astro, IC Compiler doesn't need LM views, timing
information
; is taken from link libraies
;---------------------------------------------------------------------
(gePrepLibs)
(setFormField "Library Preparation" "Library Name" lib_name)
(formButton "Library Preparation" "importLMDB")
(formButton "Library Preparation" "selectDB")
(setFormField "Library Preparation" "Min DB To Import" (string-append db_path "/"
lib_name "_bc.db"))
(setFormField "Library Preparation" "Max DB To Import" (string-append db_path "/"
lib_name "_wc.db"))
(setFormField "Library Preparation" "Typical DB To Import" (string-append db_path
"/" lib_name "_typ.db"))
(setFormField "Library Preparation" "Set Port Direction From DB" "1")
(formOK "Library Preparation")

)
library_list)

exit
;==============================================================================



Command string-append concatenates the argument, and the string-append command is
used to manipulate the path for LEF files and DB files.

If DB files are not available, following Tcl script can be used to create DB
files for list of memories using dc_shell or lc_shell.

#==============================================================================
set data_path "/home/projects/design1/mem/memories"



set library_list "
ST_SPREG_1056x33m8
ST_SPREG_24x132m2
"

foreach lib_name $library_list {
remove_design -all
read_lib ${data_path}/${lib_name}/SYNOPSYS/${lib_name}_wc.lib
set current_lib_name [get_object_name [get_libs ] ]
write_lib -format db -output ./${lib_name}_wc.db $current_lib_name

remove_design -all
read_lib ${data_path}/${lib_name}/SYNOPSYS/${lib_name}_typ.lib
set current_lib_name [get_object_name [get_libs ] ]
write_lib -format db -output ./${lib_name}_typ.db $current_lib_name

remove_design -all
read_lib ${data_path}/${lib_name}/SYNOPSYS/${lib_name}_bc.lib
set current_lib_name [get_object_name [get_libs ] ]
write_lib -format db -output ./${lib_name}_bc.db $current_lib_name
}
#==============================================================================

How to Run Milkyway Environment Scheme Commands in
Tcl Mode
you can run Scheme commands directly in Tcl mode. For example, to run this
Scheme command:

dbReplaceTextChar _lib "<" "["

At the Tcl prompt, use the following syntax:

Milkyway> tcl_scheme {dbReplaceTextChar _lib "< " "[" }

The Tcl command tcl_scheme runs a Scheme command using Tcl arguments, without
brackets.


Script for Getting All Net Names by Pattern in Tcl
The following Tcl script, based on the get_net_names_by_pattern function, retrieves all net
names by pattern. Calling this procedure returns a string of net names that match any pattern you
specify. For example, if you want to get all net names that match *VDD* and *VSS*, you execute
the script and call the get_net_names_by_patternfunction, specifying *VDD* and *VSS* as
the patterns. The returned string will contain all net names that match the input patterns. Then,
you can plug this returned variable into any application features that need this string, such as
the auECOByNetCmp form.
Syntax
get_net_names_by_pattern "pattern"

Enter a space between the get_net_names_by_pattern function and the name of the pattern.
Example


Copy the script into a file named "get_net_names_by_pattern.tcl." The following example shows
what happens when you source the get_net_names_by_pattern.tcl file.
Milkyway> source "get_net_names_by_pattern.tcl"
Milkyway> set tie_net_names [get_net_names_by_pattern "*VDD* *VSS*"]
Milkyway> auECOByNetCmp
Milkyway> formDefault "ECO By Netlist Compare"
Milkyway> setFormField "ECO By Netlist Compare" "Library Name" "mls_mg_top"
Milkyway> setFormField "ECO By Netlist Compare" "Design Cell Name"
"from_V2Cell_with_TIE"
Milkyway> setFormField "ECO By Netlist Compare" "From Verilog File" "From Verilog
File"
Milkyway> setFormField "ECO By Netlist Compare" "Verilog File Name"
"mls_mg_top_after_TIEH_TIEL.Vout"
Milkyway> setFormField "ECO By Netlist Compare" "Top Module Name" "mls_mg_top"
Milkyway> setFormField "ECO By Netlist Compare" "Ignore Tie High/Low Net Name
Pattern" $tie_net_names
Milkyway> formOK "ECO By Netlist Compare"
TCL Script
proc get_net_names_by_pattern {pattern} {
# get collection of all nets that match the pattern name
set all_tie_nets [get_nets -all $pattern]
set total [sizeof_collection $all_tie_nets]
set all_tie_net_names ""
set sep_string ", "
set i 0
foreach_in_collection myNet $all_tie_nets {
if {$i < $total - 1} {
append all_tie_net_names [get_attribute $myNet name] $sep_string
} else {
append all_tie_net_names [get_attribute $myNet name]
}
incr i
}
return $all_tie_net_names
}



Creating a New Milkyway Technology File From LEF
Question:
How do I create a Milkyway technology file from Library Exchange Format
(LEF)?
Answer:
Beginning with version V-2004.06, use the read_lef command to ease
conversion with only one iteration. It might still be useful to check this
flow to determine whether everything has been converted correctly.

A common flow for creating a Milkyway technology file starts from LEF in.
Start with the simplest possible technology file to create a library. The
simplest one that will create a library is as follows:

Technology {
name = ""
unitLengthName = "micron"
lengthPrecision = 1000
}



1) Create a library using the above technology file.

2) Use auNLIApi (with skip techfile deselected).
Beginning with version V-2004.06 , use the read_lef command
instead.

3) Output the technology file.

4) Edit the technology file iteratively several times to get everything
correct. It helps to have the fab process rules.

5) Create a new library with the new and improved technology file.

6) Use the read_lef command with the skip technology file option
selected.

7) Repeat steps 4, 5, and 6 iteratively several times.


How to Load .lib Files in Milkyway by Using Design
Compiler

The new data preparation flow is able to load the Synopsys library format (.lib)
files directly into Milkyway. Astro calls Library Compiler to convert the .lib
files to LM views in Milkyway. If Library Compiler is not available, it is
possible to use Design Compiler. Design Compiler can convert .lib files if
they do not have function attributes and if they can be considered to be black
box cells (such as RAMs, ROMs, or other macros, but not standard cells).

If the cells have functionality and you are using Design Compiler to load
the .lib files, all functionality will be stripped when you create the
LM view.

To use Design compiler, create a symbolic link in your search path. For example,

ln -s /<DCPath>/dc_shell lc_shell

Astro calls lc_shell by default, but when you create this link, Design Compiler
is called.


Script for Getting All Net Names by Pattern in Tcl
The following Tcl script, based on the get_net_names_by_pattern function, retrieves all net
names by pattern. Calling this procedure returns a string of net names that match any pattern you
specify. For example, if you want to get all net names that match *VDD* and *VSS*, you execute
the script and call the get_net_names_by_patternfunction, specifying *VDD* and *VSS* as
the patterns. The returned string will contain all net names that match the input patterns. Then,
you can plug this returned variable into any application features that need this string, such as
the auECOByNetCmp form.
Syntax


get_net_names_by_pattern "pattern"

Enter a space between the get_net_names_by_pattern function and the name of the pattern.
Example
Copy the script into a file named "get_net_names_by_pattern.tcl." The following example shows
what happens when you source the get_net_names_by_pattern.tcl file.
Milkyway> source "get_net_names_by_pattern.tcl"
Milkyway> set tie_net_names [get_net_names_by_pattern "*VDD* *VSS*"]
Milkyway> auECOByNetCmp
Milkyway> formDefault "ECO By Netlist Compare"
Milkyway> setFormField "ECO By Netlist Compare" "Library Name" "mls_mg_top"
Milkyway> setFormField "ECO By Netlist Compare" "Design Cell Name"
"from_V2Cell_with_TIE"
Milkyway> setFormField "ECO By Netlist Compare" "From Verilog File" "From Verilog
File"
Milkyway> setFormField "ECO By Netlist Compare" "Verilog File Name"
"mls_mg_top_after_TIEH_TIEL.Vout"
Milkyway> setFormField "ECO By Netlist Compare" "Top Module Name" "mls_mg_top"
Milkyway> setFormField "ECO By Netlist Compare" "Ignore Tie High/Low Net Name
Pattern" $tie_net_names
Milkyway> formOK "ECO By Netlist Compare"
TCL Script
proc get_net_names_by_pattern {pattern} {
# get collection of all nets that match the pattern name
set all_tie_nets [get_nets -all $pattern]
set total [sizeof_collection $all_tie_nets]
set all_tie_net_names ""
set sep_string ", "
set i 0
foreach_in_collection myNet $all_tie_nets {
if {$i < $total - 1} {
append all_tie_net_names [get_attribute $myNet name] $sep_string
} else {
append all_tie_net_names [get_attribute $myNet name]
}
incr i
}
return $all_tie_net_names
}
</pre>

You might also like