CIRCT 23.0.0git
Loading...
Searching...
No Matches
Passes.h
Go to the documentation of this file.
1//===- Passes.h - FIRRTL pass entry points ----------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This header file defines prototypes that expose pass constructors.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CIRCT_DIALECT_FIRRTL_PASSES_H
14#define CIRCT_DIALECT_FIRRTL_PASSES_H
15
17#include "mlir/Pass/Pass.h"
18#include "mlir/Pass/PassRegistry.h"
19#include "llvm/ADT/ArrayRef.h"
20
21namespace mlir {
22class MLIRContext;
23class Pass;
24} // namespace mlir
25
26namespace circt {
27namespace firrtl {
28class InstanceGraph;
29class InstanceInfo;
30
31/// Configure which aggregate values will be preserved by the LowerTypes pass.
32namespace PreserveAggregate {
34 /// Don't preserve aggregate at all. This has been default behaivor and
35 /// compatible with SFC.
37
38 /// Preserve only 1d vectors of ground type (e.g. UInt<2>[3]).
40
41 /// Preserve only vectors (e.g. UInt<2>[3][3]).
43
44 /// Preserve all aggregate values.
46};
47}
48
49/// Configure which values will be explicitly preserved by the DropNames pass.
50namespace PreserveValues {
52 /// Strip all names. No name on declaration is preserved.
54 /// Don't explicitly preserve any named values. Every named operation could
55 /// be optimized away by the compiler. Unlike `Strip` names could be preserved
56 /// until the end.
58 // Explicitly preserved values with meaningful names. If a name begins with
59 // an "_" it is not considered meaningful.
61 // Explicitly preserve all values. No named operation should be optimized
62 // away by the compiler.
64};
65} // namespace PreserveValues
66
67enum class CompanionMode {
68 // Lower companions to SystemVerilog binds.
69 Bind,
70 // Lower companions to explicit instances. Used when assertions or other
71 // debugging constructs from the companion are to be included in the design.
73 // Drop companion modules, eliminating them from the design.
74 Drop,
75};
76
77/// The mode for the InferDomains pass.
78enum class InferDomainsMode {
79 /// Erase domains from the input circuit.
80 Strip,
81 /// Check domains without inference.
82 Check,
83 /// Check domains with inference for private modules.
84 Infer,
85 /// Check domains with inference for both public and private modules.
87};
88
89void runCombMemsToRegOfVec(FModuleOp mod, bool ignoreReadEnable,
90 unsigned &numConverted);
91LogicalResult runFullReset(CircuitOp circuit, InstanceGraph &ig,
92 InstanceInfo &instanceInfo,
93 bool convertAsyncDomainMems = false);
94
95#define GEN_PASS_DECL
96#include "circt/Dialect/FIRRTL/Passes.h.inc"
97
98/// Generate the code for registering passes.
99#define GEN_PASS_REGISTRATION
100#include "circt/Dialect/FIRRTL/Passes.h.inc"
101
102} // namespace firrtl
103} // namespace circt
104
105#endif // CIRCT_DIALECT_FIRRTL_PASSES_H
HW-specific instance graph with a virtual entry node linking to all publicly visible modules.
@ All
Preserve all aggregate values.
Definition Passes.h:45
@ OneDimVec
Preserve only 1d vectors of ground type (e.g. UInt<2>[3]).
Definition Passes.h:39
@ Vec
Preserve only vectors (e.g. UInt<2>[3][3]).
Definition Passes.h:42
@ None
Don't preserve aggregate at all.
Definition Passes.h:36
@ None
Don't explicitly preserve any named values.
Definition Passes.h:57
@ Strip
Strip all names. No name on declaration is preserved.
Definition Passes.h:53
InferDomainsMode
The mode for the InferDomains pass.
Definition Passes.h:78
@ Strip
Erase domains from the input circuit.
@ Check
Check domains without inference.
@ Infer
Check domains with inference for private modules.
@ InferAll
Check domains with inference for both public and private modules.
void runCombMemsToRegOfVec(FModuleOp mod, bool ignoreReadEnable, unsigned &numConverted)
LogicalResult runFullReset(CircuitOp circuit, InstanceGraph &ig, InstanceInfo &instanceInfo, bool convertAsyncDomainMems=false)
std::map< std::string, std::set< std::string > > InstanceGraph
Iterates over the handshake::FuncOp's in the program to build an instance graph.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.