CIRCT  19.0.0git
Classes | Namespaces | Macros | Typedefs | Functions
LowerLayers.cpp File Reference
#include "circt/Dialect/FIRRTL/AnnotationDetails.h"
#include "circt/Dialect/FIRRTL/FIRRTLOps.h"
#include "circt/Dialect/FIRRTL/FIRRTLUtils.h"
#include "circt/Dialect/FIRRTL/Namespace.h"
#include "circt/Dialect/FIRRTL/Passes.h"
#include "circt/Dialect/HW/InnerSymbolNamespace.h"
#include "circt/Dialect/SV/SVOps.h"
#include "mlir/Pass/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/RWMutex.h"
#include "circt/Dialect/FIRRTL/Passes.h.inc"
Include dependency graph for LowerLayers.cpp:

Go to the source code of this file.

Classes

class  LowerLayersPass
 

Namespaces

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

Macros

#define DEBUG_TYPE   "firrtl-lower-layers"
 
#define GEN_PASS_DEF_LOWERLAYERS
 

Typedefs

using InnerRefMap = DenseMap< hw::InnerRefAttr, std::pair< hw::InnerSymAttr, StringAttr > >
 

Functions

static bool isAncestor (Operation *op, Value value)
 
static void appendName (StringRef name, SmallString< 32 > &output, bool toLower=false)
 
static void appendName (SymbolRefAttr name, SmallString< 32 > &output, bool toLower=false)
 
static SmallString< 32 > moduleNameForLayer (StringRef moduleName, SymbolRefAttr layerName)
 For a layer @A::@B::@C in module Module, the generated module is called Module_A_B_C. More...
 
static SmallString< 32 > instanceNameForLayer (SymbolRefAttr layerName)
 For a layerblock @A::@B::@C, the generated instance is called a_b_c. More...
 
static SmallString< 32 > fileNameForLayer (StringRef circuitName, SymbolRefAttr layerName)
 For all layerblocks @A::@B::@C in a circuit called Circuit, the output filename is layers_Circuit_A_B_C.sv. More...
 
static SmallString< 32 > macroNameForLayer (ArrayRef< StringAttr > layerName)
 For a layerblock @A::@B::@C, the verilog macro is A_B_C. More...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "firrtl-lower-layers"

Definition at line 24 of file LowerLayers.cpp.

◆ GEN_PASS_DEF_LOWERLAYERS

#define GEN_PASS_DEF_LOWERLAYERS

Definition at line 28 of file LowerLayers.cpp.

Typedef Documentation

◆ InnerRefMap

using InnerRefMap = DenseMap<hw::InnerRefAttr, std::pair<hw::InnerSymAttr, StringAttr> >

Definition at line 68 of file LowerLayers.cpp.

Function Documentation

◆ appendName() [1/2]

static void appendName ( StringRef  name,
SmallString< 32 > &  output,
bool  toLower = false 
)
static

◆ appendName() [2/2]

static void appendName ( SymbolRefAttr  name,
SmallString< 32 > &  output,
bool  toLower = false 
)
static

Definition at line 88 of file LowerLayers.cpp.

References appendName().

◆ fileNameForLayer()

static SmallString<32> fileNameForLayer ( StringRef  circuitName,
SymbolRefAttr  layerName 
)
static

For all layerblocks @A::@B::@C in a circuit called Circuit, the output filename is layers_Circuit_A_B_C.sv.

Definition at line 115 of file LowerLayers.cpp.

References appendName().

Referenced by LowerLayersPass::outputFileForLayer().

◆ instanceNameForLayer()

static SmallString<32> instanceNameForLayer ( SymbolRefAttr  layerName)
static

For a layerblock @A::@B::@C, the generated instance is called a_b_c.

Definition at line 107 of file LowerLayers.cpp.

References appendName().

Referenced by LowerLayersPass::runOnModuleBody().

◆ isAncestor()

static bool isAncestor ( Operation *  op,
Value  value 
)
static

Definition at line 40 of file LowerLayers.cpp.

Referenced by LowerLayersPass::runOnModuleBody().

◆ macroNameForLayer()

static SmallString<32> macroNameForLayer ( ArrayRef< StringAttr >  layerName)
static

For a layerblock @A::@B::@C, the verilog macro is A_B_C.

Definition at line 126 of file LowerLayers.cpp.

References appendName().

Referenced by LowerLayersPass::createMacroDecls().

◆ moduleNameForLayer()

static SmallString<32> moduleNameForLayer ( StringRef  moduleName,
SymbolRefAttr  layerName 
)
static

For a layer @A::@B::@C in module Module, the generated module is called Module_A_B_C.

Definition at line 97 of file LowerLayers.cpp.

References appendName().

Referenced by LowerLayersPass::runOnOperation().