coriolis/vlsisapd/examples/liberty/cplusplus/parseLiberty.cpp

27 lines
921 B
C++
Raw Normal View History

#include <iostream>
#include <string>
using namespace std;
#include "vlsisapd/liberty/Name.h"
#include "vlsisapd/liberty/Library.h"
#include "vlsisapd/liberty/Cell.h"
#include "vlsisapd/liberty/Pin.h"
#include "vlsisapd/liberty/Timing.h"
int main ( int argc, char * argv[] ) {
LIB::Library* library = LIB::Library::readFromFile("./testParse.lib");
if ( library ) {
2010-10-11 06:45:38 -05:00
// print of the library
library->print();
2010-10-11 06:45:38 -05:00
// print of one attribute in particular
cout << "| area of inv_x1= " << library->getCell(LIB::Name("inv_x1"))->getAttribute(LIB::Name("area"))->valueAsString() << endl;
cout << "| timing intrinsic_rise of nq of inv_x1= " << library->getCell(LIB::Name("inv_x1"))->getPin(LIB::Name("nq"))->getTiming(LIB::Name("i"))->getAttribute(LIB::Name("intrinsic_rise"))->valueAsString() << endl;
} else {
cerr << "library is NULL" << endl;
}
return 0;
}