mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
This commit is contained in:
+14
-1
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "V3Task.h"
|
||||
|
||||
#include "V3Config.h"
|
||||
#include "V3Const.h"
|
||||
#include "V3EmitCBase.h"
|
||||
#include "V3Graph.h"
|
||||
@@ -372,6 +373,7 @@ class TaskVisitor final : public VNVisitor {
|
||||
// STATE - across all visitors
|
||||
DpiCFuncs m_dpiNames; // Map of all created DPI functions
|
||||
VDouble0 m_statInlines; // Statistic tracking
|
||||
VDouble0 m_statHierDpisWithCosts; // Statistic tracking
|
||||
|
||||
// METHODS
|
||||
|
||||
@@ -980,6 +982,11 @@ class TaskVisitor final : public VNVisitor {
|
||||
funcp->isMethod(false);
|
||||
funcp->protect(false);
|
||||
funcp->dpiPure(nodep->dpiPure());
|
||||
|
||||
const int cost = static_cast<int>(V3Config::getProfileData(funcp->name()));
|
||||
m_statHierDpisWithCosts += (cost != 0);
|
||||
funcp->cost(cost);
|
||||
|
||||
// Add DPI Import to top, since it's a global function
|
||||
m_topScopep->scopep()->addBlocksp(funcp);
|
||||
makePortList(nodep, funcp);
|
||||
@@ -1259,6 +1266,8 @@ class TaskVisitor final : public VNVisitor {
|
||||
if (nodep->name() == "new") cfuncp->isConstructor(true);
|
||||
if (cfuncp->dpiExportImpl()) cfuncp->cname(nodep->cname());
|
||||
|
||||
if (cfuncp->dpiImportWrapper()) cfuncp->cname(nodep->cname());
|
||||
|
||||
if (!nodep->dpiImport() && !nodep->taskPublic()) {
|
||||
// Need symbol table
|
||||
cfuncp->argTypes(EmitCBase::symClassVar());
|
||||
@@ -1613,7 +1622,11 @@ public:
|
||||
: m_statep{statep} {
|
||||
iterate(nodep);
|
||||
}
|
||||
~TaskVisitor() { V3Stats::addStat("Optimizations, Functions inlined", m_statInlines); }
|
||||
~TaskVisitor() {
|
||||
V3Stats::addStat("Optimizations, Functions inlined", m_statInlines);
|
||||
V3Stats::addStat("Optimizations, Hierarchical DPI wrappers with costs",
|
||||
m_statHierDpisWithCosts);
|
||||
}
|
||||
};
|
||||
|
||||
//######################################################################
|
||||
|
||||
Reference in New Issue
Block a user