Skip to content

Commit 0b6a819

Browse files
committed
More debug prints
1 parent 5329882 commit 0b6a819

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

lib/Conversion/ImportVerilog/Statements.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
#include "ImportVerilogInternals.h"
1010
#include "slang/ast/Compilation.h"
1111
#include "slang/ast/SystemSubroutine.h"
12-
#include "llvm/ADT/ScopeExit.h"
1312
#include "slang/syntax/AllSyntax.h"
13+
#include "llvm/ADT/ScopeExit.h"
14+
#include <slang/ast/SFormat.h>
1415

1516
using namespace mlir;
1617
using namespace circt;
@@ -140,7 +141,8 @@ struct StmtVisitor {
140141
break;
141142
}
142143
if (failed(context.convertStatement(*stmt))) {
143-
context.dbgs(stmt->syntax->sourceRange().start()) << "Failed to convert statement " << stmt->syntax->toString();
144+
context.dbgs(stmt->syntax->sourceRange().start())
145+
<< "Failed to convert statement " << stmt->syntax->toString();
144146
return failure();
145147
}
146148
}
@@ -160,17 +162,25 @@ struct StmtVisitor {
160162
std::get_if<slang::ast::CallExpression::SystemCallInfo>(
161163
&call->subroutine)) {
162164
auto handled = visitSystemCall(stmt, *call, *info);
163-
if (failed(handled))
165+
if (failed(handled)) {
166+
context.dbgs(stmt.sourceRange.start())
167+
<< "Failed to convert system call " << stmt.syntax->toString();
164168
return failure();
169+
}
165170
if (handled == true)
166171
return success();
167172
}
173+
context.dbgs(stmt.sourceRange.start())
174+
<< "Assuming statement "
175+
<< stmt.syntax->toString() << " is not a system task";
168176
}
169177

170178
auto value = context.convertRvalueExpression(stmt.expr);
171-
if (!value)
179+
if (!value) {
180+
context.dbgs(stmt.sourceRange.start())
181+
<< "Failed to convert expression statement as RValue " << stmt.expr.syntax->toString();
172182
return failure();
173-
183+
}
174184
// Expressions like calls to void functions return a dummy value that has no
175185
// uses. If the returned value is trivially dead, remove it.
176186
if (auto *defOp = value.getDefiningOp())

0 commit comments

Comments
 (0)