forked from github/verilator
This patch makes OpenTitan verilation with --debug-check 22% faster, and the same with --debug --no-dump-tree 91% faster. Functionality is the same (including when VL_LEAK_CHECKS is defined), except V3Broken can now always find duplicate references via child/next pointers if the target node is not `maybePointedTo()` (previously this only happened when compiled with VL_LEAK_CHECKS). The main change relates to storing the v3Broken traversal state in the AstNode by stealing a byte from what used to be unused flags. We retain an unordered_set only for marking pointers as valid to be referenced via a non-child/non-next member pointer.
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
|
//*************************************************************************
|
|
// DESCRIPTION: Verilator: Find broken links in tree
|
|
//
|
|
// Code available from: https://verilator.org
|
|
//
|
|
//*************************************************************************
|
|
//
|
|
// Copyright 2003-2021 by Wilson Snyder. This program is free software; you
|
|
// can 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.
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
|
//
|
|
//*************************************************************************
|
|
|
|
#ifndef VERILATOR_V3BROKEN_H_
|
|
#define VERILATOR_V3BROKEN_H_
|
|
|
|
#include "config_build.h"
|
|
#include "verilatedos.h"
|
|
|
|
//============================================================================
|
|
|
|
// Forward declare so we can include this in V3Ast.h
|
|
class AstNode;
|
|
class AstNetlist;
|
|
|
|
class V3Broken final {
|
|
public:
|
|
static void brokenAll(AstNetlist* nodep);
|
|
static bool isLinkable(const AstNode* nodep);
|
|
static void addNewed(const AstNode* nodep);
|
|
static void deleted(const AstNode* nodep);
|
|
static void selfTest();
|
|
};
|
|
|
|
#endif // Guard
|