2012-04-13 01:08:20 +00:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2010-03-17 12:22:49 +00:00
|
|
|
//*************************************************************************
|
|
|
|
//
|
2019-01-04 00:17:22 +00:00
|
|
|
// Copyright 2003-2019 by Wilson Snyder. This program is free software; you can
|
2010-03-17 12:22:49 +00:00
|
|
|
// redistribute it and/or modify it under the terms of either the GNU
|
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License.
|
|
|
|
// Version 2.0.
|
|
|
|
//
|
|
|
|
// Verilator is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
//*************************************************************************
|
|
|
|
///
|
|
|
|
/// \file
|
|
|
|
/// \brief Verilator: Include to allow symbol inspection
|
|
|
|
///
|
2017-12-16 15:52:43 +00:00
|
|
|
/// This file is for inclusion by files that need to inspect the symbol
|
|
|
|
/// table. It is not included in verilated.h (instead see
|
|
|
|
/// verilated_sym_props.h) as it requires some heavyweight C++ classes.
|
2010-03-17 12:22:49 +00:00
|
|
|
///
|
2017-12-16 15:52:43 +00:00
|
|
|
/// These classes are thread safe and read only. It is constructed only
|
|
|
|
/// when a model is built (from the main thread).
|
2017-10-27 00:05:42 +00:00
|
|
|
///
|
2019-11-08 03:33:59 +00:00
|
|
|
/// Code available from: https://verilator.org
|
2010-03-17 12:22:49 +00:00
|
|
|
///
|
|
|
|
//*************************************************************************
|
2019-10-05 00:17:11 +00:00
|
|
|
|
2010-03-17 12:22:49 +00:00
|
|
|
#ifndef _VERILATED_SYMS_H_
|
2018-11-29 00:59:10 +00:00
|
|
|
#define _VERILATED_SYMS_H_ 1 ///< Header Guard
|
2010-03-17 12:22:49 +00:00
|
|
|
|
2018-10-14 17:43:24 +00:00
|
|
|
#include "verilatedos.h"
|
|
|
|
#include "verilated_heavy.h"
|
2017-12-16 15:52:43 +00:00
|
|
|
#include "verilated_sym_props.h"
|
2010-03-17 12:22:49 +00:00
|
|
|
|
|
|
|
#include <map>
|
2019-10-02 01:57:45 +00:00
|
|
|
#include <vector>
|
2010-03-17 12:22:49 +00:00
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
/// Types
|
|
|
|
|
2017-12-16 15:52:43 +00:00
|
|
|
/// Class to sort maps keyed by const char*'s
|
2015-09-25 01:08:58 +00:00
|
|
|
struct VerilatedCStrCmp {
|
2019-11-10 01:35:12 +00:00
|
|
|
bool operator() (const char* a, const char* b) const {
|
2017-12-16 15:52:43 +00:00
|
|
|
return std::strcmp(a, b) < 0;
|
2015-09-25 01:08:58 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-12-16 15:52:43 +00:00
|
|
|
/// Map of sorted scope names to find associated scope class
|
2015-09-25 01:08:58 +00:00
|
|
|
class VerilatedScopeNameMap
|
2017-09-23 11:32:37 +00:00
|
|
|
: public std::map<const char*, const VerilatedScope*, VerilatedCStrCmp> {
|
2015-09-25 01:08:58 +00:00
|
|
|
public:
|
|
|
|
VerilatedScopeNameMap() {}
|
|
|
|
~VerilatedScopeNameMap() {}
|
|
|
|
};
|
|
|
|
|
2017-12-16 15:52:43 +00:00
|
|
|
/// Map of sorted variable names to find associated variable class
|
2017-09-23 11:32:37 +00:00
|
|
|
class VerilatedVarNameMap
|
|
|
|
: public std::map<const char*, VerilatedVar, VerilatedCStrCmp> {
|
2013-08-08 23:39:39 +00:00
|
|
|
public:
|
2010-03-17 12:22:49 +00:00
|
|
|
VerilatedVarNameMap() {}
|
|
|
|
~VerilatedVarNameMap() {}
|
|
|
|
};
|
|
|
|
|
2019-10-02 01:57:45 +00:00
|
|
|
typedef std::vector<const VerilatedScope*> VerilatedScopeVector;
|
|
|
|
|
|
|
|
class VerilatedHierarchyMap
|
|
|
|
: public std::map<const VerilatedScope*, VerilatedScopeVector> {
|
|
|
|
public:
|
|
|
|
VerilatedHierarchyMap() {}
|
|
|
|
~VerilatedHierarchyMap() {}
|
|
|
|
};
|
|
|
|
|
2018-11-29 00:59:10 +00:00
|
|
|
#endif // Guard
|