0% found this document useful (0 votes)
13 views2 pages

How To Get The Output of - Report Gates - in XLS Format

genus rm script

Uploaded by

thsim85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

How To Get The Output of - Report Gates - in XLS Format

genus rm script

Uploaded by

thsim85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

How to get the output of "report gates" in XLS format?

Explanation of Script

The script in the Code section converts the text output of the report gates command into an XLS file format for MS Excel.

Usage

After sourcing the script in Genus, you need to provide a gates report file dumped from the report gates command and an output file name in which the XLS format
content will be stored in the current directory.

For example, source the script in Genus as follows:

legacy_genus:/> source report_gates_xls_conversion.tcl

Use Model

report gates > gates.rpt


report_gates_xls_conversion –report_file gates.rpt –output_file report_gates

The XLS file report_gates.xls is generated in the current directory.

Code

proc report_gates_xls_conversion { args } {

switch -- [parse_option "[calling_proc]" {} $args \


"-report_file srs Report file name " input_file \
"-output_file srs Output Report file name " output_file] {
-1 { return }
0 {return -code error }
}

set rid [open $input_file r]


set wid [open $output_file.xls w+]
set count 0
set flag 0
while {![eof $rid]} {
set line [gets $rid]
if {[regexp {\s*Leakage\s*Leakage\s*Internal\s*Internal} $line]} {
set line [gets $rid]
}

if {[regexp {===} $line]} {


incr flag
puts $wid $line
}

if {[regexp {\-\-\-\-\-} $line]} {


puts $wid $line
}

if {[string match $line ""]} {


puts $wid $line
}

if {[expr $flag%2] == 0} {
if {([regexp {\s*Gate\s*Instances} $line])} {
set count [llength $line]
for {set i 0} {$i < $count} {incr i} {
set head_col($i) "[lindex $line $i]"
}
if {$count == 4} {
puts $wid "$head_col(0)\t$head_col(1)\t$head_col(2)\t$head_col(3)"
} elseif {$count == 8} {
puts $wid "-\t-\t-\tLeakage\tInternal"
puts $wid "$head_col(0)\t$head_col(1)\t$head_col(2)\t$head_col(3)(nW)\t$head_col(5)(nW)\t$head_col(7)"
} elseif {$count == 10} {
puts $wid "-\t-\t-\t-\t-\tLeakage\tInternal"
puts $wid "$head_col(0)\t$head_col(1)\t$head_col(2)\t$head_col(3)\t$head_col(4)\t$head_col(5)(nW)\t$head_col(7)
(nW)\t$head_col(9)"
} else {}
set line [gets $rid]
if {[regexp {\-\-\-\-\-} $line]} {
puts $wid $line
set line [gets $rid]
}
}

if {([regexp {\s*Library\s*Instances} $line])} {


set count [llength $line]
for {set i 0} {$i < $count} {incr i} {
set head_col($i) "[lindex $line $i]"
}
if {$count == 5} {
puts $wid "$head_col(0)\t$head_col(1)\t$head_col(2)\t$head_col(3)%"
} elseif {$count == 13} {
puts $wid "-\t-\t-\t-\tLeakage\tLeakage\tInternal\tInternal"
puts $wid "$head_col(0)\t$head_col(1)\t$head_col(2)%\t$head_col(4)\t$head_col(5)(nW)\t$head_col(7)%\t$head_col(9)
(nW)\t$head_col(11)%"
} else {}
set line [gets $rid]
if {[regexp {\-\-\-\-\-} $line]} {
puts $wid $line
set line [gets $rid]
}

if {([regexp {\s*Type\s*Instances} $line])} {


set count [llength $line]
for {set i 0} {$i < $count} {incr i} {
set head_col($i) "[lindex $line $i]"
}
if {$count == 5} {
puts $wid "$head_col(0)\t$head_col(1)\t$head_col(2)\t$head_col(3)%"
} elseif {$count == 13} {
puts $wid "-\t-\t-\t-\tLeakage\tLeakage\tInternal\tInternal"
puts $wid "$head_col(0)\t$head_col(1)\t$head_col(2)\t$head_col(3)%\t$head_col(5)(nW)\t$head_col(7)%\t$head_col(9)
(nW)\t$head_col(11)%"
} else {}
set line [gets $rid]
if {[regexp {\-\-\-\-\-} $line]} {
puts $wid $line
set line [gets $rid]
}

#puts $count
for {set i 0} {$i < [llength $line]} {incr i} {
set col($i) "[lindex $line $i]"
}
if {[llength $line] == 4} {
puts $wid "$col(0)\t$col(1)\t$col(2)\t$col(3)"
} elseif {[llength $line] == 6} {
puts $wid "$col(0)\t$col(1)\t$col(2)\t$col(3)\t$col(4)\t$col(5)"
} elseif {[llength $line] == 7} {
puts $wid "$col(0)\t$col(1)\t$col(2)\t$col(3)\t$col(4)\t$col(5)\t$col(6)"
} elseif {[llength $line] == 8} {
puts $wid "$col(0)\t$col(1)\t$col(2)\t$col(3)\t$col(4)\t$col(5)\t$col(6)\t$col(7)"
} else {}
} else {
puts $wid $line
}
}
close $wid
close $rid

Internal Notes
None
Return to the top of the page

You might also like