mirror of
https://github.com/verilator/verilator.git
synced 2026-09-05 08:42:46 +02:00
Introduce new pass that converts impure expressions, or those with function and method calls into simple assignment statements. Please see the blurb at the top of the file why this is useful and how it works. In particular currently it enables more Dfg optimization as functions will be inlined without AstExprStmt. Ideally we should enforce this lowering is applied to every procedural statement (there are still a handful of exceptions). With that, long term with this pass + #6820, there should be no need to ever use an AstExprStmt past this new lowering pass, which should enable more easier optimization down the line. Also ideally this should be run earlier. Currently it's after V3Tristate as that calls pinReconnectSimple so we don't have to touch Cell ports. Currently disabled when code coverage is enabled due to #7119.
33 lines
1.0 KiB
C++
33 lines
1.0 KiB
C++
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
|
//*************************************************************************
|
|
// DESCRIPTION: Verilator: Lift expressions out of statements
|
|
//
|
|
// Code available from: https://verilator.org
|
|
//
|
|
//*************************************************************************
|
|
//
|
|
// 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-FileCopyrightText: 2003-2026 Wilson Snyder
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
|
//
|
|
//*************************************************************************
|
|
|
|
#ifndef VERILATOR_V3LIFTEXPR_H_
|
|
#define VERILATOR_V3LIFTEXPR_H_
|
|
|
|
#include "config_build.h"
|
|
#include "verilatedos.h"
|
|
|
|
class AstNetlist;
|
|
|
|
//============================================================================
|
|
|
|
class V3LiftExpr final {
|
|
public:
|
|
static void liftExprAll(AstNetlist* nodep) VL_MT_DISABLED;
|
|
};
|
|
|
|
#endif // Guard
|