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

Method createMultiProcessPreProcessor_

src/SourceCompile/Compiler.cpp:632–758  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630}
631
632bool Compiler::createMultiProcessPreProcessor_() {
633 uint32_t nbProcesses = m_commandLineParser->getNbMaxProcesses();
634 if (nbProcesses == 0) return true;
635
636 if (!(m_commandLineParser->writePpOutput() ||
637 m_commandLineParser->writePpOutputFileId())) {
638 return true;
639 }
640
641 FileSystem* const fileSystem = FileSystem::getInstance();
642 SymbolTable* symbolTable = getSymbolTable();
643
644 const bool muted = m_commandLineParser->muteStdout();
645 const fs::path workingDir = fileSystem->getWorkingDir();
646 const fs::path outputDir =
647 fileSystem->toPlatformAbsPath(m_commandLineParser->getOutputDirId());
648 const fs::path programPath =
649 fileSystem->toPlatformAbsPath(m_commandLineParser->getProgramId());
650 const std::string_view profile =
651 m_commandLineParser->profile() ? " -profile " : " ";
652 const std::string_view sverilog =
653 m_commandLineParser->fullSVMode() ? " -sverilog " : " ";
654 const std::string_view fileUnit =
655 m_commandLineParser->fileunit() ? " -fileunit " : " ";
656 std::string synth =
657 m_commandLineParser->reportNonSynthesizable() ? " -synth " : " ";
658 synth += m_commandLineParser->reportNonSynthesizableWithFormal() ? " -formal "
659 : " ";
660 const std::string_view noHash =
661 m_commandLineParser->noCacheHash() ? " -nohash " : " ";
662
663 std::string fileList;
664 // +define+
665 for (const auto& [id, value] : m_commandLineParser->getDefineList()) {
666 const std::string_view defName =
667 m_commandLineParser->getSymbolTable()->getSymbol(id);
668 std::string val = StringUtils::replaceAll(value, "#", "\\#");
669 StrAppend(&fileList, " -D", defName, "=", val);
670 }
671
672 // Source files (.v, .sv on the command line)
673 for (const PathId& id : m_commandLineParser->getSourceFiles()) {
674 std::string_view svFile = m_commandLineParser->isSVFile(id) ? " -sv " : " ";
675 StrAppend(&fileList, svFile, fileSystem->toPath(id));
676 }
677 // Library files (-v <file>)
678 for (const PathId& id : m_commandLineParser->getLibraryFiles()) {
679 StrAppend(&fileList, " -v ", fileSystem->toPath(id));
680 }
681 // (-y <path> +libext+<ext>)
682 for (const PathId& id : m_commandLineParser->getLibraryPaths()) {
683 StrAppend(&fileList, " -y ", fileSystem->toPath(id));
684 }
685 // +libext+
686 for (const SymbolId& id : m_commandLineParser->getLibraryExtensions()) {
687 const std::string_view extName =
688 m_commandLineParser->getSymbolTable()->getSymbol(id);
689 StrAppend(&fileList, " +libext+", extName);

Callers

nothing calls this directly

Calls 15

StrAppendFunction · 0.85
StrCatFunction · 0.85
PathIdPPClass · 0.85
getNbMaxProcessesMethod · 0.80
writePpOutputMethod · 0.80
writePpOutputFileIdMethod · 0.80
muteStdoutMethod · 0.80
toPlatformAbsPathMethod · 0.80
getOutputDirIdMethod · 0.80
getProgramIdMethod · 0.80
profileMethod · 0.80
fullSVModeMethod · 0.80

Tested by

no test coverage detected