2010-10-14 06:06:22 -05:00
|
|
|
from LIBERTY import *
|
|
|
|
|
|
|
|
library = Library.readFromFile("./testParse.lib")
|
|
|
|
|
|
|
|
if ( library ) :
|
|
|
|
# print of the library
|
2010-10-15 06:13:53 -05:00
|
|
|
print library
|
|
|
|
# print of one attribute in particular of a cell
|
|
|
|
print "Area of inv_x1 :", library.getCell("inv_x1").getAttribute("area").valueAsString()
|
|
|
|
print "Timing intrinsic_rise of nq of inv_x1 :", library.getCell("inv_x1").getPin("nq").getTiming("i").getAttribute("intrinsic_rise").valueAsString()
|
|
|
|
# print of all the attributes of a cell
|
|
|
|
print "Attributes of no2_x1 :"
|
|
|
|
for attr in library.getCell("no2_x1").getAttributes() :
|
|
|
|
print " name=", attr.key, \
|
|
|
|
", type=", attr.value.typeToString(), \
|
|
|
|
", value=", attr.value.valueAsString()
|
|
|
|
# print of all the timings of a pin
|
|
|
|
print "Timing's attributes of pin nq of no2_x1 :"
|
|
|
|
for timing in library.getCell("no2_x1").getPin("nq").getTimings() :
|
|
|
|
print timing
|
2010-10-14 06:06:22 -05:00
|
|
|
else :
|
|
|
|
raise ( "library is NULL" )
|
|
|
|
|