MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / parseLibrariesDefinition

Method parseLibrariesDefinition

src/Library/ParseLibraryDef.cpp:66–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 m_fileContent(nullptr) {}
65
66bool ParseLibraryDef::parseLibrariesDefinition() {
67 FileSystem* const fileSystem = FileSystem::getInstance();
68 // Get .map files from command line
69 std::vector<PathId> libraryMapFiles =
70 m_commandLineParser->getLibraryMapFiles();
71 if (libraryMapFiles.empty()) {
72 // or scan local dir
73 for (const PathId& wdId : m_commandLineParser->getWorkingDirs()) {
74 fileSystem->collect(wdId, ".map", m_symbolTable, libraryMapFiles);
75 }
76 }
77
78 // If "work" library is not yet declared from command line, create it
79 constexpr std::string_view workN = "work";
80 m_librarySet->addLibrary(workN, m_symbolTable);
81
82 // Config files are parsed using the library top rule
83 const PathIdVector& cfgFiles = m_commandLineParser->getConfigFiles();
84 libraryMapFiles.insert(libraryMapFiles.end(), cfgFiles.begin(),
85 cfgFiles.end());
86
87 for (const PathId& fileId : libraryMapFiles) {
88 parseLibraryDefinition(fileId);
89 }
90
91 for (const PathId& fileId : cfgFiles) {
92 // Register configuration files in "work" library
93 m_librarySet->getLibrary(fileId);
94 }
95
96 for (const PathId& fileId : m_commandLineParser->getSourceFiles()) {
97 // Register files in "work" library
98 m_librarySet->getLibrary(fileId);
99 }
100
101 m_librarySet->checkErrors(m_symbolTable, m_errors);
102
103 if (m_commandLineParser->getDebugLibraryDef()) {
104 m_librarySet->report(std::cout) << std::endl;
105 }
106 return true;
107}
108
109bool ParseLibraryDef::parseLibraryDefinition(PathId fileId, Library* lib) {
110 FileSystem* const fileSystem = FileSystem::getInstance();

Callers 1

parseLibrariesDef_Method · 0.80

Calls 6

getWorkingDirsMethod · 0.80
addLibraryMethod · 0.80
insertMethod · 0.80
checkErrorsMethod · 0.80
getDebugLibraryDefMethod · 0.80
getLibraryMethod · 0.45

Tested by

no test coverage detected