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