2021-03-28 15:50:05 +00:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode"
|
|
|
|
//-*- *************************************************************************
|
2010-03-17 12:22:49 +00:00
|
|
|
//
|
2021-03-20 21:46:00 +00:00
|
|
|
// Code available from: https://verilator.org
|
|
|
|
//
|
2024-01-01 08:19:59 +00:00
|
|
|
// Copyright 2003-2024 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
|
2020-03-21 15:24:24 +00:00
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
2010-03-17 12:22:49 +00:00
|
|
|
// Version 2.0.
|
2020-03-21 15:24:24 +00:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2010-03-17 12:22:49 +00:00
|
|
|
//
|
|
|
|
//*************************************************************************
|
|
|
|
///
|
|
|
|
/// \file
|
2021-03-20 21:46:00 +00:00
|
|
|
/// \brief Verilated symbol inspection header
|
2010-03-17 12:22:49 +00:00
|
|
|
///
|
2021-03-20 21:46:00 +00:00
|
|
|
/// This file is for inclusion by user wrapper code that needs 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.
|
2017-10-27 00:05:42 +00:00
|
|
|
///
|
2021-03-28 15:50:05 +00:00
|
|
|
/// These classes are rarely used by user code; typical user code will
|
|
|
|
/// instead use the VPI to access this information.
|
|
|
|
///
|
2021-03-20 21:46:00 +00:00
|
|
|
/// These classes are thread safe and read only. It is constructed only
|
|
|
|
/// when a model is built (from the main thread).
|
2010-03-17 12:22:49 +00:00
|
|
|
///
|
|
|
|
//*************************************************************************
|
2019-10-05 00:17:11 +00:00
|
|
|
|
2021-03-04 02:57:07 +00:00
|
|
|
#ifndef VERILATOR_VERILATED_SYMS_H_
|
2021-03-20 21:46:00 +00:00
|
|
|
#define VERILATOR_VERILATED_SYMS_H_
|
2010-03-17 12:22:49 +00:00
|
|
|
|
2018-10-14 17:43:24 +00:00
|
|
|
#include "verilatedos.h"
|
2022-08-05 09:56:57 +00:00
|
|
|
|
2021-07-24 14:00:33 +00:00
|
|
|
#include "verilated.h"
|
2017-12-16 15:52:43 +00:00
|
|
|
#include "verilated_sym_props.h"
|
2010-03-17 12:22:49 +00:00
|
|
|
|
|
|
|
#include <map>
|
2020-11-26 01:57:30 +00:00
|
|
|
#include <unordered_map>
|
2019-10-02 01:57:45 +00:00
|
|
|
#include <vector>
|
2010-03-17 12:22:49 +00:00
|
|
|
|
|
|
|
//======================================================================
|
2021-03-28 15:50:05 +00:00
|
|
|
// Types
|
2010-03-17 12:22:49 +00:00
|
|
|
|
2021-03-28 15:50:05 +00:00
|
|
|
// Class to sort maps keyed by const char*'s
|
2024-01-20 20:06:46 +00:00
|
|
|
struct VerilatedCStrCmp final {
|
2019-12-22 23:09:46 +00:00
|
|
|
bool operator()(const char* a, const char* b) const { return std::strcmp(a, b) < 0; }
|
2015-09-25 01:08:58 +00:00
|
|
|
};
|
|
|
|
|
2021-03-28 15:50:05 +00:00
|
|
|
// Map of sorted scope names to find associated scope class
|
2021-02-25 00:21:02 +00:00
|
|
|
// This is a class instead of typedef/using to allow forward declaration in verilated.h
|
2020-11-19 02:32:16 +00:00
|
|
|
class VerilatedScopeNameMap final
|
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:
|
2020-11-17 00:56:16 +00:00
|
|
|
VerilatedScopeNameMap() = default;
|
|
|
|
~VerilatedScopeNameMap() = default;
|
2015-09-25 01:08:58 +00:00
|
|
|
};
|
|
|
|
|
2021-03-28 15:50:05 +00:00
|
|
|
// Map of sorted variable names to find associated variable class
|
2021-02-25 00:21:02 +00:00
|
|
|
// This is a class instead of typedef/using to allow forward declaration in verilated.h
|
2020-11-19 02:32:16 +00:00
|
|
|
class VerilatedVarNameMap final : public std::map<const char*, VerilatedVar, VerilatedCStrCmp> {
|
2013-08-08 23:39:39 +00:00
|
|
|
public:
|
2020-11-17 00:56:16 +00:00
|
|
|
VerilatedVarNameMap() = default;
|
|
|
|
~VerilatedVarNameMap() = default;
|
2010-03-17 12:22:49 +00:00
|
|
|
};
|
|
|
|
|
2021-03-28 15:50:05 +00:00
|
|
|
// Map of parent scope to vector of children scopes
|
2021-02-25 00:21:02 +00:00
|
|
|
// This is a class instead of typedef/using to allow forward declaration in verilated.h
|
2020-11-26 01:57:30 +00:00
|
|
|
class VerilatedHierarchyMap final
|
2021-02-25 00:21:02 +00:00
|
|
|
: public std::unordered_map<const VerilatedScope*, std::vector<const VerilatedScope*>> {
|
2019-10-02 01:57:45 +00:00
|
|
|
public:
|
2020-11-17 00:56:16 +00:00
|
|
|
VerilatedHierarchyMap() = default;
|
|
|
|
~VerilatedHierarchyMap() = default;
|
2019-10-02 01:57:45 +00:00
|
|
|
};
|
|
|
|
|
2018-11-29 00:59:10 +00:00
|
|
|
#endif // Guard
|