MCPcopy Create free account
hub / github.com/PKU-IDEA/OpenPARF / readBookshelf

Method readBookshelf

openparf/database/database.cpp:817–845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

815}
816
817void Database::readBookshelf(std::string const &aux_file) {
818 BookshelfDatabaseCallbacks cbk(*this);
819 cbk.setAuxFile(aux_file);
820 bookshelfparser::Driver driver(cbk);
821 std::ifstream ifs;
822
823 // Parse bookshelf AUX file
824 openparfPrint(kInfo, "Parsing file %s\n", aux_file.c_str());
825 ifs.open(aux_file);
826 openparfAssertMsg(ifs.good(), "Cannot open file %s", aux_file.c_str());
827 driver.parse_stream(ifs);
828 ifs.close();
829
830 // Parse bookshelf files in order
831 for (auto file :
832 {cbk.libFile(), cbk.sclFile(), cbk.nodeFile(), cbk.plFile(), cbk.netFile(), cbk.shapeFile(), cbk.wtFile()}) {
833 if (!file.empty()) {
834 std::string path = cbk.inputDir() + file;
835 openparfPrint(kInfo, "Parsing file %s\n", path.c_str());
836 ifs.open(path);
837 openparfAssertMsg(ifs.good(), "Cannot open file %s", path.c_str());
838 driver.parse_stream(ifs);
839 ifs.close();
840 }
841 }
842
843 // uniquify the design
844 design_.uniquify(design_.topModuleInstId());
845}
846
847bool Database::writeBookshelfPl(std::string const &pl_file) {
848 openparfPrint(kInfo, "write to %s\n", pl_file.c_str());

Callers 7

load_designFunction · 0.95
testSample1Method · 0.95
testSample2Method · 0.95
testSample1Method · 0.95
placeFunction · 0.95
testSample1Method · 0.80
mainFunction · 0.80

Calls 8

openparfPrintFunction · 0.85
setAuxFileMethod · 0.80
goodMethod · 0.80
closeMethod · 0.80
uniquifyMethod · 0.80
topModuleInstIdMethod · 0.80
parse_streamMethod · 0.45
emptyMethod · 0.45

Tested by 4

load_designFunction · 0.76
testSample1Method · 0.76
testSample2Method · 0.76
testSample1Method · 0.76