2012-04-13 01:08:20 +00:00
|
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2010-03-17 12:22:49 +00:00
|
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2018-01-02 23:05:06 +00:00
|
|
|
|
// Copyright 2003-2018 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
|
|
|
|
///
|
2010-03-17 12:22:49 +00:00
|
|
|
|
/// Code available from: http://www.veripool.org/verilator
|
|
|
|
|
///
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _VERILATED_SYMS_H_
|
|
|
|
|
#define _VERILATED_SYMS_H_ 1 ///< Header Guard
|
|
|
|
|
|
2017-12-16 15:52:43 +00:00
|
|
|
|
#include "verilated_sym_props.h"
|
2010-03-17 12:22:49 +00:00
|
|
|
|
|
2017-12-16 15:52:43 +00:00
|
|
|
|
#include "verilated_heavy.h"
|
2010-03-17 12:22:49 +00:00
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
|
/// 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 {
|
|
|
|
|
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() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // Guard
|