2014-11-24 03:06:10 +01:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
// DESCRIPTION: verilator_coverage: Top global container
|
|
|
|
|
//
|
2019-11-08 04:33:59 +01:00
|
|
|
// Code available from: https://verilator.org
|
2014-11-24 03:06:10 +01:00
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2025-01-01 14:30:25 +01:00
|
|
|
// Copyright 2003-2025 by Wilson Snyder. This program is free software; you
|
2020-03-21 16:24:24 +01:00
|
|
|
// can redistribute it and/or modify it under the terms of either the GNU
|
2014-11-24 03:06:10 +01:00
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
|
// Version 2.0.
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2014-11-24 03:06:10 +01:00
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
2019-10-05 02:17:11 +02:00
|
|
|
|
2021-03-04 03:57:07 +01:00
|
|
|
#ifndef VERILATOR_VLCTOP_H_
|
|
|
|
|
#define VERILATOR_VLCTOP_H_
|
2014-11-24 03:06:10 +01:00
|
|
|
|
|
|
|
|
#include "config_build.h"
|
|
|
|
|
#include "verilatedos.h"
|
2018-10-14 19:43:24 +02:00
|
|
|
|
2014-11-24 03:06:10 +01:00
|
|
|
#include "VlcOptions.h"
|
|
|
|
|
#include "VlcPoint.h"
|
|
|
|
|
#include "VlcSource.h"
|
2022-08-05 11:56:57 +02:00
|
|
|
#include "VlcTest.h"
|
2014-11-24 03:06:10 +01:00
|
|
|
|
|
|
|
|
//######################################################################
|
|
|
|
|
// VlcTop - Top level options container
|
|
|
|
|
|
2020-11-19 03:32:16 +01:00
|
|
|
class VlcTop final {
|
2014-11-24 03:06:10 +01:00
|
|
|
public:
|
|
|
|
|
// PUBLIC MEMBERS
|
2018-10-27 16:03:28 +02:00
|
|
|
VlcOptions opt; //< Runtime options
|
2014-11-24 03:06:10 +01:00
|
|
|
private:
|
|
|
|
|
// MEMBERS
|
2018-10-27 16:03:28 +02:00
|
|
|
VlcTests m_tests; //< List of all tests (all coverage files)
|
|
|
|
|
VlcPoints m_points; //< List of all points
|
|
|
|
|
VlcSources m_sources; //< List of all source files to annotate
|
2014-11-24 03:06:10 +01:00
|
|
|
|
|
|
|
|
// METHODS
|
|
|
|
|
void annotateCalc();
|
|
|
|
|
void annotateCalcNeeded();
|
|
|
|
|
void annotateOutputFiles(const string& dirname);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// CONSTRUCTORS
|
2020-11-17 01:56:16 +01:00
|
|
|
VlcTop() = default;
|
|
|
|
|
~VlcTop() = default;
|
2014-11-24 03:06:10 +01:00
|
|
|
|
|
|
|
|
// ACCESSORS
|
|
|
|
|
VlcTests& tests() { return m_tests; }
|
|
|
|
|
VlcPoints& points() { return m_points; }
|
|
|
|
|
VlcSources& sources() { return m_sources; }
|
|
|
|
|
|
|
|
|
|
// METHODS
|
|
|
|
|
void annotate(const string& dirname);
|
2020-03-16 04:20:33 +01:00
|
|
|
void readCoverage(const string& filename, bool nonfatal = false);
|
2014-11-24 03:06:10 +01:00
|
|
|
void writeCoverage(const string& filename);
|
2020-05-16 15:18:35 +02:00
|
|
|
void writeInfo(const string& filename);
|
2014-11-24 03:06:10 +01:00
|
|
|
|
|
|
|
|
void rank();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//######################################################################
|
|
|
|
|
|
2018-10-27 16:03:28 +02:00
|
|
|
#endif // guard
|