forked from github/verilator
Improve Verilation performance on trace duplicates, msg2017.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
parent
999f278971
commit
15495bb200
5
Changes
5
Changes
@ -1,7 +1,6 @@
|
|||||||
Revision history for Verilator
|
Revision history for Verilator
|
||||||
|
|
||||||
The contributors that suggested a given feature are shown in []. [by ...]
|
The contributors that suggested a given feature are shown in []. Thanks!
|
||||||
indicates the contributor was also the author of the fix; Thanks!
|
|
||||||
|
|
||||||
|
|
||||||
* Verilator 3.887 devel
|
* Verilator 3.887 devel
|
||||||
@ -16,6 +15,8 @@ indicates the contributor was also the author of the fix; Thanks!
|
|||||||
|
|
||||||
**** Improve Verilation performance on internal strings, msg1975. [Johan Bjork]
|
**** Improve Verilation performance on internal strings, msg1975. [Johan Bjork]
|
||||||
|
|
||||||
|
**** Improve Verilation performance on trace duplicates, msg2017. [Johan Bjork]
|
||||||
|
|
||||||
|
|
||||||
* Verilator 3.886 2016-07-30
|
* Verilator 3.886 2016-07-30
|
||||||
|
|
||||||
|
@ -206,8 +206,13 @@ private:
|
|||||||
AstTraceInc* nodep = vvertexp->nodep();
|
AstTraceInc* nodep = vvertexp->nodep();
|
||||||
if (nodep->valuep()) {
|
if (nodep->valuep()) {
|
||||||
if (nodep->valuep()->backp() != nodep) nodep->v3fatalSrc("Trace duplicate back needs consistency, so we can map duplicates back to TRACEINCs");
|
if (nodep->valuep()->backp() != nodep) nodep->v3fatalSrc("Trace duplicate back needs consistency, so we can map duplicates back to TRACEINCs");
|
||||||
hashed.hashAndInsert(nodep->valuep());
|
hashed.hash(nodep->valuep());
|
||||||
UINFO(8, " Hashed "<<hex<<hashed.nodeHash(nodep->valuep())<<" "<<nodep<<endl);
|
UINFO(8, " Hashed "<<hex<<hashed.nodeHash(nodep->valuep())<<" "<<nodep<<endl);
|
||||||
|
|
||||||
|
// Just keep one node in the map and point all duplicates to this node
|
||||||
|
if (hashed.findDuplicate(nodep->valuep()) == hashed.end()) {
|
||||||
|
hashed.hashAndInsert(nodep->valuep());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,11 +228,8 @@ private:
|
|||||||
TraceTraceVertex* dupvertexp = dynamic_cast<TraceTraceVertex*>(dupincp->user1p()->castGraphVertex());
|
TraceTraceVertex* dupvertexp = dynamic_cast<TraceTraceVertex*>(dupincp->user1p()->castGraphVertex());
|
||||||
UINFO(8," Orig "<<nodep<<endl);
|
UINFO(8," Orig "<<nodep<<endl);
|
||||||
UINFO(8," dup "<<dupincp<<endl);
|
UINFO(8," dup "<<dupincp<<endl);
|
||||||
// Mark the found node as a duplicate of the first node
|
// Mark the hashed node as the original and our iterating node as duplicated
|
||||||
// (Not vice-versa as we get the iterator for the found node)
|
vvertexp->duplicatep(dupvertexp);
|
||||||
dupvertexp->duplicatep(vvertexp);
|
|
||||||
// Remove node from comparison so don't hit it again
|
|
||||||
hashed.erase(dupit);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -493,11 +495,13 @@ private:
|
|||||||
//if (debug()>=9) nodep->dumpTree(cout,"- assnnode: ");
|
//if (debug()>=9) nodep->dumpTree(cout,"- assnnode: ");
|
||||||
// Find non-duplicated node; note some nodep's maybe null, as they were deleted below
|
// Find non-duplicated node; note some nodep's maybe null, as they were deleted below
|
||||||
TraceTraceVertex* dupvertexp = vvertexp;
|
TraceTraceVertex* dupvertexp = vvertexp;
|
||||||
while (dupvertexp->duplicatep()) {
|
if (dupvertexp->duplicatep()) {
|
||||||
dupvertexp = dupvertexp->duplicatep();
|
dupvertexp = dupvertexp->duplicatep();
|
||||||
UINFO(9," dupOf "<<((void*)dupvertexp)<<" "<<((void*)dupvertexp->nodep())
|
UINFO(9," dupOf "<<((void*)dupvertexp)<<" "<<((void*)dupvertexp->nodep())
|
||||||
<<" "<<dupvertexp<<endl);
|
<<" "<<dupvertexp<<endl);
|
||||||
|
if (dupvertexp->duplicatep()) dupvertexp->nodep()->v3fatalSrc("Original node was marked as a duplicate");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dupvertexp != vvertexp) {
|
if (dupvertexp != vvertexp) {
|
||||||
// It's an exact copy. We'll assign the code to the master on
|
// It's an exact copy. We'll assign the code to the master on
|
||||||
// the first one we hit; the later ones will share the code.
|
// the first one we hit; the later ones will share the code.
|
||||||
|
Loading…
Reference in New Issue
Block a user