Vous êtes sur la page 1sur 3

#!

/usr/bin/tclsh -f
#===========================================================================
# File Name
: report_area_xls_conversion.tcl
# Date Created : 05/07/2013
# Version
: @Revision 1.0 @
# Summary
: Convert RC area report to xls format
# Keywords : convert conversion xls
#
# Description:
#
To convert the report area from RC in xls format
#
# Notes : For any query, pls write to mgupta@cadence.com
#===========================================================================
proc report_area_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 {===} $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*Instance\s*Cells\s*Cell} $line])} {
set count [llength $line]
for {set i 0} {$i < $count} {incr i} {
set head_col($i) "[lindex $line $i]"
}
if {$count == 8} {
puts $wid "$head_col(0)\t$head_col(1)\t$head_col
(2) $head_col(3)\t$head_col(4) $head_col(5)\t$head_col(6) $head_col(7)"
} else {}
set line [gets $rid]
if {[regexp {\-\-\-\-\-} $line]} {
puts $wid $line
set line [gets $rid]
}
}

for {set i 0} {$i < [llength $line]} {incr i} {


set col($i) "[lindex $line $i]"
}
set line_temp [split $line " "]
set length [llength $line_temp]
set i 0
set space_char ""
foreach el $line_temp {
if {[string match $el ""]} {
incr i
lappend space_char "."
} else {
break
}
}
if {[llength $line] == 5} {
puts $wid "$space_char$col(0)\t$col(1)\t$col(2)\t$col(3)
\t$col(4)"
} else {}
} else {
puts $wid $line
}
}
close $wid
close $rid
}
#===========================================================================
#
# Copyright 1997-2013 Cadence Design Systems, Inc. All rights reserved worldwid
e.
#
# The Tcl computer program and related information (collectively "Licensed Mater
ial")
# contained herein are protected by copyright law and international treaties.
#
# Cadence grants Recipient of the Licensed Material a nonexclusive right
# to use, copy, and modify the Licensed Material. Should Recipient
# desire to distribute any portion of the Licensed Material, Recipient
# must obtain Cadence's permission. In no event shall Recipient use the
# Licensed Material for benchmarking purposes against Cadence's products.
#
# The Licensed Material is provided to Recipient to use at Recipient's
# own risk. The Licensed Material may not be compatible with current or
# future versions of Cadence products, and Cadence will not provide any
# technical support for the Licensed Material, whether modified or not
# by the Recipient. THE LICENSED MATERIAL IS PROVIDED "AS IS" AND WITH
# NO WARRANTIES, INCLUDING WITHOUT LIMITATION ANY EXPRESS WARRANTIES OR
# IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
#
# IN NO EVENT SHALL CADENCE BE LIABLE TO RECIPIENT OR ANY THIRD PARTY
# FOR ANY INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES, OR ANY
# OTHER DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
# LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
# INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OR
# INABILITY TO USE LICENSED MATERIAL, WHETHER OR NOT THE POSSIBILITY OR
# CAUSE OF SUCH DAMAGES WAS KNOWN TO CADENCE.
#

# Cadence Design Systems, Inc.


# 2655 Seely Avenue
# San Jose, CA 95134
#
#===========================================================================

Vous aimerez peut-être aussi