Internals: Remove duplication in verilated.cpp file lists. No functional change intended.
This commit is contained in:
parent
7c2b1971a4
commit
a094fd954b
|
|
@ -146,36 +146,9 @@ class CMakeEmitter final {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/verilated.cpp");
|
for (const string& cpp : v3Global.verilatedCppFiles())
|
||||||
if (v3Global.dpi()) { //
|
global.emplace_back("${VERILATOR_ROOT}/include/"s + cpp);
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/verilated_dpi.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.opt.vpi()) {
|
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/verilated_vpi.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.opt.savable()) {
|
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/verilated_save.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.opt.coverage()) {
|
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/verilated_cov.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.opt.trace()) {
|
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/" + v3Global.opt.traceSourceBase()
|
|
||||||
+ "_c.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.usesProbDist()) {
|
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/verilated_probdist.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.usesTiming()) {
|
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/verilated_timing.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.useRandomizeMethods()) {
|
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/verilated_random.cpp");
|
|
||||||
}
|
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/verilated_threads.cpp");
|
|
||||||
if (v3Global.opt.usesProfiler()) {
|
|
||||||
global.emplace_back("${VERILATOR_ROOT}/include/verilated_profiler.cpp");
|
|
||||||
}
|
|
||||||
if (!v3Global.opt.libCreate().empty()) {
|
if (!v3Global.opt.libCreate().empty()) {
|
||||||
global.emplace_back(v3Global.opt.makeDir() + "/" + v3Global.opt.libCreate() + ".cpp");
|
global.emplace_back(v3Global.opt.makeDir() + "/" + v3Global.opt.libCreate() + ".cpp");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -593,22 +593,8 @@ public:
|
||||||
// Do nothing because VM_GLOBAL is necessary per executable. Top module will
|
// Do nothing because VM_GLOBAL is necessary per executable. Top module will
|
||||||
// have them.
|
// have them.
|
||||||
} else if (support == 2 && !slow) {
|
} else if (support == 2 && !slow) {
|
||||||
putMakeClassEntry(of, "verilated.cpp");
|
for (const string& cpp : v3Global.verilatedCppFiles())
|
||||||
if (v3Global.dpi()) putMakeClassEntry(of, "verilated_dpi.cpp");
|
putMakeClassEntry(of, cpp);
|
||||||
if (v3Global.opt.vpi()) putMakeClassEntry(of, "verilated_vpi.cpp");
|
|
||||||
if (v3Global.opt.savable()) putMakeClassEntry(of, "verilated_save.cpp");
|
|
||||||
if (v3Global.opt.coverage()) putMakeClassEntry(of, "verilated_cov.cpp");
|
|
||||||
if (v3Global.opt.trace()) {
|
|
||||||
putMakeClassEntry(of, v3Global.opt.traceSourceBase() + "_c.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.usesProbDist()) putMakeClassEntry(of, "verilated_probdist.cpp");
|
|
||||||
if (v3Global.usesTiming()) putMakeClassEntry(of, "verilated_timing.cpp");
|
|
||||||
if (v3Global.useRandomizeMethods())
|
|
||||||
putMakeClassEntry(of, "verilated_random.cpp");
|
|
||||||
putMakeClassEntry(of, "verilated_threads.cpp");
|
|
||||||
if (v3Global.opt.usesProfiler()) {
|
|
||||||
putMakeClassEntry(of, "verilated_profiler.cpp");
|
|
||||||
}
|
|
||||||
} else if (support == 2 && slow) {
|
} else if (support == 2 && slow) {
|
||||||
} else if (support == 0 && v3Global.opt.outputGroups() > 0) {
|
} else if (support == 0 && v3Global.opt.outputGroups() > 0) {
|
||||||
const std::vector<FileOrConcatenatedFilesList>& list
|
const std::vector<FileOrConcatenatedFilesList>& list
|
||||||
|
|
|
||||||
|
|
@ -180,36 +180,8 @@ class V3EmitMkJsonEmitter final {
|
||||||
|
|
||||||
const std::string verilatorRoot
|
const std::string verilatorRoot
|
||||||
= V3Os::filenameSlashPath(V3Os::filenameRealPath(V3Options::getenvVERILATOR_ROOT()));
|
= V3Os::filenameSlashPath(V3Os::filenameRealPath(V3Options::getenvVERILATOR_ROOT()));
|
||||||
global.emplace_back(verilatorRoot + "/include/verilated.cpp");
|
for (const string& cpp : v3Global.verilatedCppFiles())
|
||||||
if (v3Global.dpi()) { //
|
global.emplace_back(verilatorRoot + "/include/" + cpp);
|
||||||
global.emplace_back(verilatorRoot + "/include/verilated_dpi.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.opt.vpi()) {
|
|
||||||
global.emplace_back(verilatorRoot + "/include/verilated_vpi.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.opt.savable()) {
|
|
||||||
global.emplace_back(verilatorRoot + "/include/verilated_save.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.opt.coverage()) {
|
|
||||||
global.emplace_back(verilatorRoot + "/include/verilated_cov.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.opt.trace()) {
|
|
||||||
global.emplace_back(verilatorRoot + "/include/" + v3Global.opt.traceSourceBase()
|
|
||||||
+ "_c.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.usesProbDist()) {
|
|
||||||
global.emplace_back(verilatorRoot + "/include/verilated_probdist.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.usesTiming()) {
|
|
||||||
global.emplace_back(verilatorRoot + "/include/verilated_timing.cpp");
|
|
||||||
}
|
|
||||||
if (v3Global.useRandomizeMethods()) {
|
|
||||||
global.emplace_back(verilatorRoot + "/include/verilated_random.cpp");
|
|
||||||
}
|
|
||||||
global.emplace_back(verilatorRoot + "/include/verilated_threads.cpp");
|
|
||||||
if (v3Global.opt.usesProfiler()) {
|
|
||||||
global.emplace_back(verilatorRoot + "/include/verilated_profiler.cpp");
|
|
||||||
}
|
|
||||||
if (!v3Global.opt.libCreate().empty()) {
|
if (!v3Global.opt.libCreate().empty()) {
|
||||||
global.emplace_back(makeDir + "/" + v3Global.opt.libCreate() + ".cpp");
|
global.emplace_back(makeDir + "/" + v3Global.opt.libCreate() + ".cpp");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -195,3 +195,19 @@ const std::string& V3Global::ptrToId(const void* p) {
|
||||||
}
|
}
|
||||||
return pair.first->second;
|
return pair.first->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> V3Global::verilatedCppFiles() {
|
||||||
|
std::vector<std::string> result;
|
||||||
|
result.emplace_back("verilated.cpp");
|
||||||
|
if (v3Global.dpi()) result.emplace_back("verilated_dpi.cpp");
|
||||||
|
if (v3Global.opt.vpi()) result.emplace_back("verilated_vpi.cpp");
|
||||||
|
if (v3Global.opt.savable()) result.emplace_back("verilated_save.cpp");
|
||||||
|
if (v3Global.opt.coverage()) result.emplace_back("verilated_cov.cpp");
|
||||||
|
if (v3Global.opt.trace()) result.emplace_back(v3Global.opt.traceSourceBase() + "_c.cpp");
|
||||||
|
if (v3Global.usesProbDist()) result.emplace_back("verilated_probdist.cpp");
|
||||||
|
if (v3Global.usesTiming()) result.emplace_back("verilated_timing.cpp");
|
||||||
|
if (v3Global.useRandomizeMethods()) result.emplace_back("verilated_random.cpp");
|
||||||
|
result.emplace_back("verilated_threads.cpp");
|
||||||
|
if (v3Global.opt.usesProfiler()) result.emplace_back("verilated_profiler.cpp");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -208,6 +208,7 @@ public:
|
||||||
void idPtrMapDumpJson(std::ostream& os);
|
void idPtrMapDumpJson(std::ostream& os);
|
||||||
const std::string& ptrToId(const void* p);
|
const std::string& ptrToId(const void* p);
|
||||||
std::thread::id mainThreadId() const { return m_mainThreadId; }
|
std::thread::id mainThreadId() const { return m_mainThreadId; }
|
||||||
|
static std::vector<std::string> verilatedCppFiles();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern V3Global v3Global;
|
extern V3Global v3Global;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue