mirror of
https://github.com/verilator/verilator.git
synced 2026-10-07 02:23:19 +02:00
Add JSON AST dumps (#5020)
This commit is contained in:
+19
-1
@@ -16,6 +16,10 @@
|
||||
|
||||
#include "V3PchAstMT.h"
|
||||
|
||||
#include "V3Global.h"
|
||||
|
||||
#include "V3EmitV.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3File.h"
|
||||
#include "V3HierBlock.h"
|
||||
#include "V3LinkCells.h"
|
||||
@@ -23,6 +27,8 @@
|
||||
#include "V3ParseSym.h"
|
||||
#include "V3Stats.h"
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
//######################################################################
|
||||
// V3Global
|
||||
|
||||
@@ -106,11 +112,23 @@ string V3Global::digitsFilename(int number) {
|
||||
|
||||
void V3Global::dumpCheckGlobalTree(const string& stagename, int newNumber, bool doDump) {
|
||||
const string treeFilename = v3Global.debugFilename(stagename + ".tree", newNumber);
|
||||
v3Global.rootp()->dumpTreeFile(treeFilename, doDump);
|
||||
if (dumpTreeLevel()) v3Global.rootp()->dumpTreeFile(treeFilename, doDump);
|
||||
if (dumpTreeJsonLevel()) {
|
||||
v3Global.rootp()->dumpTreeJsonFile(treeFilename + ".json", doDump);
|
||||
}
|
||||
if (v3Global.opt.dumpTreeDot()) {
|
||||
v3Global.rootp()->dumpTreeDotFile(treeFilename + ".dot", doDump);
|
||||
}
|
||||
if (v3Global.opt.stats()) V3Stats::statsStage(stagename);
|
||||
|
||||
if (doDump && v3Global.opt.debugEmitV()) V3EmitV::debugEmitV(treeFilename + ".v");
|
||||
if (v3Global.opt.debugCheck() || dumpTreeEitherLevel()) {
|
||||
// Error check
|
||||
v3Global.rootp()->checkTree();
|
||||
// Broken isn't part of check tree because it can munge iterp's
|
||||
// set by other steps if it is called in the middle of other operations
|
||||
V3Broken::brokenAll(v3Global.rootp());
|
||||
}
|
||||
}
|
||||
|
||||
void V3Global::idPtrMapDumpJson(std::ostream& os) {
|
||||
|
||||
Reference in New Issue
Block a user