Skip to content

Commit

Permalink
Verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
gezalore committed Mar 24, 2024
1 parent 1d3b3f8 commit 5104018
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 64 deletions.
4 changes: 2 additions & 2 deletions ci/ci-win-compile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if (-Not (Test-Path $PWD/../.ccache/win_bison.exe)) {
mkdir build
cd build
cmake .. --install-prefix $PWD/../install
cmake --build . --config Release -j 3
cmake --install . --prefix $PWD/../install
cmake --build . --config Debug -j 3
cmake --install . --config Debug --prefix $PWD/../install
2 changes: 1 addition & 1 deletion examples/cmake_tracing_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ target_compile_features(example PUBLIC cxx_std_14)
# Add the Verilated circuit to the target
verilate(example COVERAGE TRACE
INCLUDE_DIRS "../make_tracing_c"
VERILATOR_ARGS -f ../make_tracing_c/input.vc -x-assign fast
VERILATOR_ARGS -f ../make_tracing_c/input.vc -x-assign fast --debug --debugi 9
SOURCES ../make_tracing_c/top.v)
2 changes: 1 addition & 1 deletion examples/cmake_tracing_c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ run:

@echo
@echo "-- BUILD -------------------"
cmake --build build -j
cmake --build build -j -v

@echo
@echo "-- RUN ---------------------"
Expand Down
36 changes: 4 additions & 32 deletions src/V3Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -582,15 +582,9 @@ void v3errorEndFatal(std::ostringstream& sstr)
V3Error::v3errorPrep(V3ErrorCode::EC_FATAL, VL_MT_DISABLED_CODE_UNIT_DEFINED), msg))

#define UINFO(level, stmsg) \
do { \
if (VL_UNCOVERABLE(debug() >= (level))) { \
std::cout << "- " << V3Error::lineStr(__FILE__, __LINE__) << stmsg; \
} \
} while (false)
do { std::cout << "- " << V3Error::lineStr(__FILE__, __LINE__) << stmsg; } while (false)
#define UINFONL(level, stmsg) \
do { \
if (VL_UNCOVERABLE(debug() >= (level))) { std::cout << stmsg; } \
} while (false)
do { std::cout << stmsg; } while (false)

#ifdef VL_DEBUG
#define UDEBUGONLY(stmts) \
Expand Down Expand Up @@ -647,34 +641,12 @@ void v3errorEndFatal(std::ostringstream& sstr)
// Helper macros for VL_DEFINE_DEBUG_FUNCTIONS
// Takes an optional "name" (as __VA_ARGS__)
#define VL_DEFINE_DEBUG(...) \
VL_ATTR_UNUSED static int debug##__VA_ARGS__() VL_MT_SAFE { \
static int level = -1; \
if (VL_UNLIKELY(level < 0)) { \
std::string tag{VL_STRINGIFY(__VA_ARGS__)}; \
tag[0] = std::tolower(tag[0]); \
const unsigned debugTag = v3Global.opt.debugLevel(tag); \
const unsigned debugSrc = v3Global.opt.debugSrcLevel(__FILE__); \
const unsigned debugLevel = debugTag >= debugSrc ? debugTag : debugSrc; \
if (!v3Global.opt.available()) return static_cast<int>(debugLevel); \
level = static_cast<int>(debugLevel); \
} \
return level; \
} \
VL_ATTR_UNUSED static int debug##__VA_ARGS__() VL_MT_SAFE { return 9; } \
static_assert(true, "")

// Takes an optional "name" (as __VA_ARGS__)
#define VL_DEFINE_DUMP(func, tag) \
VL_ATTR_UNUSED static int dump##func() { \
static int level = -1; \
if (VL_UNLIKELY(level < 0)) { \
const unsigned dumpTag = v3Global.opt.dumpLevel(tag); \
const unsigned dumpSrc = v3Global.opt.dumpSrcLevel(__FILE__); \
const unsigned dumpLevel = dumpTag >= dumpSrc ? dumpTag : dumpSrc; \
if (!v3Global.opt.available()) return static_cast<int>(dumpLevel); \
level = static_cast<int>(dumpLevel); \
} \
return level; \
} \
VL_ATTR_UNUSED static int dump##func() { return 9; } \
static_assert(true, "")

// Define debug*() and dump*() routines. This needs to be added to every compilation unit so that
Expand Down
7 changes: 7 additions & 0 deletions src/V3Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,19 @@ V3GraphVertex::V3GraphVertex(V3Graph* graphp, const V3GraphVertex& old)
, m_color{old.m_color}
, m_rank{old.m_rank} {
m_userp = nullptr;
UINFO(0, "A" << std::endl);
graphp->vertices().linkBack(this);
UINFO(0, "B" << std::endl);
}

V3GraphVertex::V3GraphVertex(V3Graph* graphp)
: m_fanout{0}
, m_color{0}
, m_rank{0} {
UINFO(0, "C" << std::endl);
m_userp = nullptr;
graphp->vertices().linkBack(this);
UINFO(0, "D" << std::endl);
}

void V3GraphVertex::unlinkEdges(V3Graph*) {
Expand Down Expand Up @@ -147,8 +151,11 @@ void V3GraphEdge::init(V3Graph* /*graphp*/, V3GraphVertex* fromp, V3GraphVertex*
m_cutable = cutable;
m_userp = nullptr;
// Link vertices to this edge
UINFO(0, "E" << std::endl);
m_fromp->outEdges().linkBack(this);
UINFO(0, "F" << std::endl);
m_top->inEdges().linkBack(this);
UINFO(0, "G" << std::endl);
}

void V3GraphEdge::relinkFromp(V3GraphVertex* newFromp) {
Expand Down
2 changes: 2 additions & 0 deletions src/V3LinkCells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,15 @@ class LinkCellsVisitor final : public VNVisitor {
m_graph.removeRedundantEdgesMax(&V3GraphEdge::followAlwaysTrue);
if (dumpGraphLevel()) m_graph.dumpDotFilePrefixed("linkcells");
m_graph.rank();
UINFO(0, "EEEEEEEEEEEEE??????????????????????" << std::endl);
for (V3GraphVertex& vtx : m_graph.vertices()) {
if (const LinkCellsVertex* const vvertexp = vtx.cast<LinkCellsVertex>()) {
// +1 so we leave level 1 for the new wrapper we'll make in a moment
AstNodeModule* const modp = vvertexp->modp();
modp->level(vvertexp->rank() + 1);
}
}
UINFO(0, "!!!!!!!!!!!!!!!EEEEEEEEEEEEE??????????????????????" << std::endl);
if (v3Global.opt.topModule() != "" && !m_topVertexp) {
v3error("Specified --top-module '" << v3Global.opt.topModule()
<< "' was not found in design.");
Expand Down
Loading

0 comments on commit 5104018

Please sign in to comment.