CIRCT 24.0.0git
Loading...
Searching...
No Matches
FullReset.cpp File Reference
#include "circt/Analysis/FIRRTLInstanceInfo.h"
#include "circt/Dialect/FIRRTL/AnnotationDetails.h"
#include "circt/Dialect/FIRRTL/FIRRTLAnnotations.h"
#include "circt/Dialect/FIRRTL/FIRRTLInstanceGraph.h"
#include "circt/Dialect/FIRRTL/FIRRTLOps.h"
#include "circt/Dialect/FIRRTL/FIRRTLTypes.h"
#include "circt/Dialect/FIRRTL/FIRRTLUtils.h"
#include "circt/Dialect/FIRRTL/Passes.h"
#include "circt/Support/Debug.h"
#include "mlir/IR/Threading.h"
#include "mlir/Pass/Pass.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/LogicalResult.h"
#include <atomic>
#include "circt/Dialect/FIRRTL/Passes.h.inc"
Include dependency graph for FullReset.cpp:

Go to the source code of this file.

Classes

class  InstancePath
 An instance path composed of a series of instances. More...
struct  InstancePathCache
 A data structure that caches and provides paths to module instances in the IR. More...

Namespaces

namespace  circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
namespace  circt::firrtl

Macros

#define DEBUG_TYPE   "firrtl-full-reset"
#define GEN_PASS_DEF_FULLRESET

Functions

static std::pair< StringAttr, FModuleOp > getResetNameAndModule (Value reset)
 Return the name and parent module of a reset.
static StringAttr getResetName (Value reset)
 Return the name of a reset.
bool operator== (const ResetDomain &a, const ResetDomain &b)
bool operator!= (const ResetDomain &a, const ResetDomain &b)
static Value createZeroValue (ImplicitLocOpBuilder &builder, FIRRTLBaseType type, SmallDenseMap< FIRRTLBaseType, Value > &cache)
 Construct a zero value of the given type using the given builder.
static Value createZeroValue (ImplicitLocOpBuilder &builder, FIRRTLBaseType type)
 Construct a null value of the given type using the given builder.
static bool insertResetMux (ImplicitLocOpBuilder &builder, Value target, Value reset, Value resetValue)
 Helper function that inserts reset multiplexer into all ConnectOps with the given target.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "firrtl-full-reset"

Definition at line 29 of file FullReset.cpp.

◆ GEN_PASS_DEF_FULLRESET

#define GEN_PASS_DEF_FULLRESET

Definition at line 33 of file FullReset.cpp.

Function Documentation

◆ createZeroValue() [1/2]

Value createZeroValue ( ImplicitLocOpBuilder & builder,
FIRRTLBaseType type )
static

Construct a null value of the given type using the given builder.

Definition at line 183 of file FullReset.cpp.

References createZeroValue().

◆ createZeroValue() [2/2]

Value createZeroValue ( ImplicitLocOpBuilder & builder,
FIRRTLBaseType type,
SmallDenseMap< FIRRTLBaseType, Value > & cache )
static

Construct a zero value of the given type using the given builder.

Definition at line 110 of file FullReset.cpp.

References circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::Case(), createZeroValue(), circt::firrtl::emitConnect(), and circt::firrtl::FIRRTLBaseType::getConstType().

Referenced by createZeroValue(), and createZeroValue().

◆ getResetName()

StringAttr getResetName ( Value reset)
static

Return the name of a reset.

The reset value must either be a module port or a wire/node operation.

Definition at line 62 of file FullReset.cpp.

References getResetNameAndModule().

◆ getResetNameAndModule()

std::pair< StringAttr, FModuleOp > getResetNameAndModule ( Value reset)
static

Return the name and parent module of a reset.

The reset value must either be a module port or a wire/node operation.

Definition at line 50 of file FullReset.cpp.

Referenced by getResetName().

◆ insertResetMux()

bool insertResetMux ( ImplicitLocOpBuilder & builder,
Value target,
Value reset,
Value resetValue )
static

Helper function that inserts reset multiplexer into all ConnectOps with the given target.

Looks through SubfieldOp, SubindexOp, and SubaccessOp, and inserts multiplexers into connects to these subaccesses as well. Modifies the insertion location of the builder. Returns true if the resetValue was used in any way, false otherwise.

Definition at line 194 of file FullReset.cpp.

References insertResetMux().

Referenced by insertResetMux().

◆ operator!=()

bool operator!= ( const ResetDomain & a,
const ResetDomain & b )
inline

Definition at line 105 of file FullReset.cpp.

◆ operator==()

bool operator== ( const ResetDomain & a,
const ResetDomain & b )
inline

Definition at line 101 of file FullReset.cpp.