2012-04-13 01:08:20 +00:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2006-08-26 11:35:28 +00:00
|
|
|
//*************************************************************************
|
|
|
|
// DESCRIPTION: Verilator: Link XREF signals/functions together
|
|
|
|
//
|
2019-11-08 03:33:59 +00:00
|
|
|
// Code available from: https://verilator.org
|
2006-08-26 11:35:28 +00:00
|
|
|
//
|
|
|
|
//*************************************************************************
|
|
|
|
//
|
2020-03-21 15:24:24 +00:00
|
|
|
// Copyright 2003-2020 by Wilson Snyder. This program is free software; you
|
|
|
|
// can redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 21:07:57 +00:00
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
// Version 2.0.
|
2020-03-21 15:24:24 +00:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2006-08-26 11:35:28 +00:00
|
|
|
//
|
|
|
|
//*************************************************************************
|
2019-10-05 00:17:11 +00:00
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
#ifndef _V3LINKDOT_H_
|
|
|
|
#define _V3LINKDOT_H_ 1
|
2018-10-14 17:43:24 +00:00
|
|
|
|
2006-12-18 19:20:45 +00:00
|
|
|
#include "config_build.h"
|
|
|
|
#include "verilatedos.h"
|
2018-10-14 17:43:24 +00:00
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
#include "V3Error.h"
|
|
|
|
#include "V3Ast.h"
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
2020-08-16 16:05:35 +00:00
|
|
|
enum VLinkDotStep : uint8_t { LDS_PRIMARY, LDS_PARAMED, LDS_ARRAYED, LDS_SCOPED };
|
2012-07-21 13:27:57 +00:00
|
|
|
|
2020-11-19 02:32:16 +00:00
|
|
|
class V3LinkDot final {
|
2006-09-06 17:48:41 +00:00
|
|
|
private:
|
2012-07-21 13:27:57 +00:00
|
|
|
static int debug();
|
2018-10-14 22:39:33 +00:00
|
|
|
static void linkDotGuts(AstNetlist* rootp, VLinkDotStep step);
|
2020-04-14 02:51:35 +00:00
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
public:
|
2012-07-21 13:27:57 +00:00
|
|
|
static void linkDotPrimary(AstNetlist* nodep) {
|
2020-04-14 02:51:35 +00:00
|
|
|
UINFO(2, __FUNCTION__ << ": " << endl);
|
|
|
|
linkDotGuts(nodep, LDS_PRIMARY);
|
2018-10-14 22:39:33 +00:00
|
|
|
V3Global::dumpCheckGlobalTree("linkdot", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
2015-03-12 23:47:54 +00:00
|
|
|
}
|
2012-07-21 13:27:57 +00:00
|
|
|
static void linkDotParamed(AstNetlist* nodep) {
|
2020-04-14 02:51:35 +00:00
|
|
|
UINFO(2, __FUNCTION__ << ": " << endl);
|
|
|
|
linkDotGuts(nodep, LDS_PARAMED);
|
2018-10-14 22:39:33 +00:00
|
|
|
V3Global::dumpCheckGlobalTree("paramlink", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
2015-03-12 23:47:54 +00:00
|
|
|
}
|
2012-07-21 13:27:57 +00:00
|
|
|
static void linkDotArrayed(AstNetlist* nodep) {
|
2020-04-14 02:51:35 +00:00
|
|
|
UINFO(2, __FUNCTION__ << ": " << endl);
|
|
|
|
linkDotGuts(nodep, LDS_ARRAYED);
|
2018-10-14 22:39:33 +00:00
|
|
|
V3Global::dumpCheckGlobalTree("linkdot", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 6);
|
2015-03-12 23:47:54 +00:00
|
|
|
}
|
2012-07-21 13:27:57 +00:00
|
|
|
static void linkDotScope(AstNetlist* nodep) {
|
2020-04-14 02:51:35 +00:00
|
|
|
UINFO(2, __FUNCTION__ << ": " << endl);
|
|
|
|
linkDotGuts(nodep, LDS_SCOPED);
|
2018-10-14 22:39:33 +00:00
|
|
|
V3Global::dumpCheckGlobalTree("linkdot", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3);
|
2015-03-12 23:47:54 +00:00
|
|
|
}
|
2006-08-26 11:35:28 +00:00
|
|
|
};
|
|
|
|
|
2019-05-19 20:13:13 +00:00
|
|
|
#endif // Guard
|