Add FSM arc coverage to verilator_coverage .info output

Signed-off-by: Igor Zaworski <[email protected]>
This commit is contained in:
Igor Zaworski
2026-07-22 12:26:14 -04:00
committed by GitHub
parent 0a855fce47
commit f511f6c34d
3 changed files with 39 additions and 3 deletions
+6 -3
View File
@@ -262,7 +262,6 @@ void VlcTop::writeInfo(const string& filename) {
uint64_t daCount = 0;
std::vector<const VlcPoint*> infoPoints;
for (const auto& point : sc.points()) {
if (point->isFsmArc()) continue;
daCount = std::max(daCount, point->count());
infoPoints.push_back(point);
}
@@ -272,10 +271,14 @@ void VlcTop::writeInfo(const string& filename) {
int point_num = 0;
for (const VlcPoint* point : infoPoints) {
os << "BRDA:" << sc.lineno() << ",";
os << "0,";
if (point->comment().empty()) {
if (point->isFsmArc()) {
os << "2,";
os << point->fsmFromState() << "->" << point->fsmToState();
} else if (point->comment().empty()) {
os << "0,";
os << point_num;
} else {
os << (point->isFsmState() ? '1' : '0') << ',';
std::string comment(point->comment());
std::replace(comment.begin(), comment.end(), ',', '_');
os << comment;