mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
committed by
Wilson Snyder
parent
248de2be2e
commit
d667b73e8d
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <iomanip>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
@@ -1330,6 +1331,28 @@ void AstNode::dumpTreeDot(std::ostream& os) const {
|
||||
drawChildren(os, this, m_op4p, "op4");
|
||||
}
|
||||
|
||||
void AstNode::dumpTreeJsonFile(const string& filename, bool doDump) {
|
||||
if (!doDump) return;
|
||||
UINFO(2, "Dumping " << filename << endl);
|
||||
const std::unique_ptr<std::ofstream> treejsonp{V3File::new_ofstream(filename)};
|
||||
if (treejsonp->fail()) v3fatal("Can't write " << filename);
|
||||
dumpTreeJson(*treejsonp);
|
||||
*treejsonp << '\n';
|
||||
}
|
||||
|
||||
void AstNode::dumpJsonMetaFile(const string& filename) {
|
||||
UINFO(2, "Dumping " << filename << endl);
|
||||
const std::unique_ptr<std::ofstream> treejsonp{V3File::new_ofstream(filename)};
|
||||
if (treejsonp->fail()) v3fatal("Can't write " << filename);
|
||||
*treejsonp << '{';
|
||||
FileLine::fileNameNumMapDumpJson(*treejsonp);
|
||||
*treejsonp << ',';
|
||||
v3Global.idPtrMapDumpJson(*treejsonp);
|
||||
*treejsonp << ',';
|
||||
v3Global.ptrNamesDumpJson(*treejsonp);
|
||||
*treejsonp << "}\n";
|
||||
}
|
||||
|
||||
void AstNode::dumpTreeDotFile(const string& filename, bool doDump) {
|
||||
if (doDump) {
|
||||
UINFO(2, "Dumping " << filename << endl);
|
||||
|
||||
Reference in New Issue
Block a user