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

Method compilation_

src/DesignCompile/CompileDesign.cpp:296–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296bool CompileDesign::compilation_() {
297 Design* design = m_compiler->getDesign();
298
299 auto& all_files = design->getAllFileContents();
300
301#if 0
302 int32_t maxThreadCount = m_compiler->getCommandLineParser()->getNbMaxTreads();
303#else
304 // The Actual Module... Compilation is not Multithread safe anymore due to
305 // the UHDM model creation
306 int32_t maxThreadCount = 0;
307#endif
308
309 int32_t index = 0;
310 do {
311 SymbolTable* symbols =
312 m_compiler->getCommandLineParser()->getSymbolTable()->CreateSnapshot();
313 m_symbolTables.push_back(symbols);
314 ErrorContainer* errors = new ErrorContainer(
315 symbols, m_compiler->getErrorContainer()->getLogListener());
316 errors->registerCmdLine(m_compiler->getCommandLineParser());
317 m_errorContainers.push_back(errors);
318 index++;
319 } while (index < maxThreadCount);
320
321 for (auto file : all_files) {
322 if (m_compiler->isLibraryFile(file.first)) {
323 file.second->setLibraryCellFile();
324 }
325 }
326
327 compileMT_<FileContent, Design::FileIdDesignContentMap, FunctorCreateLookup>(
328 all_files, maxThreadCount);
329
330 compileMT_<FileContent, Design::FileIdDesignContentMap, FunctorResolve>(
331 all_files, maxThreadCount);
332
333 compileMT_<FileContent, Design::FileIdDesignContentMap,
334 FunctorCompileFileContentDecl>(all_files, maxThreadCount);
335
336 collectObjects_(all_files, design, false);
337 m_compiler->getDesign()->orderPackages();
338
339 // Compile packages in strict order
340 for (auto itr : m_compiler->getDesign()->getOrderedPackageDefinitions()) {
341 FunctorCompilePackage funct(this, itr, m_compiler->getDesign(),
342 m_symbolTables[0], m_errorContainers[0]);
343 funct.operator()();
344 }
345
346 compileMT_<FileContent, Design::FileIdDesignContentMap,
347 FunctorCompileFileContent>(all_files, maxThreadCount);
348
349 // Compile modules
350 compileMT_<ModuleDefinition, ModuleNameModuleDefinitionMap,
351 FunctorCompileModule>(
352 m_compiler->getDesign()->getModuleDefinitions(), maxThreadCount);
353

Callers

nothing calls this directly

Calls 15

getDesignMethod · 0.80
getNbMaxTreadsMethod · 0.80
CreateSnapshotMethod · 0.80
getLogListenerMethod · 0.80
registerCmdLineMethod · 0.80
isLibraryFileMethod · 0.80
setLibraryCellFileMethod · 0.80
orderPackagesMethod · 0.80
parseBuiltInMethod · 0.80
addBuiltinClassesMethod · 0.80
getPreprocessorMethod · 0.80
toPathMethod · 0.80

Tested by

no test coverage detected