CIRCT 22.0.0git
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
HWParameterizeConstantPorts.cpp File Reference
#include "circt/Dialect/HW/HWInstanceGraph.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/HW/HWPasses.h"
#include "circt/Dialect/HW/PortImplementation.h"
#include "circt/Support/InstanceGraph.h"
#include "circt/Support/Namespace.h"
#include "mlir/IR/Builders.h"
#include "llvm/Support/Debug.h"
#include "circt/Dialect/HW/Passes.h.inc"
Include dependency graph for HWParameterizeConstantPorts.cpp:

Go to the source code of this file.

Namespaces

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

Macros

#define DEBUG_TYPE   "hw-parameterize-constant-ports"
 
#define GEN_PASS_DEF_HWPARAMETERIZECONSTANTPORTS
 

Functions

static std::pair< Attribute, Operation * > getAttributeAndDefiningOp (InstanceOp inst, unsigned portIndex)
 Helper to extract the attribute value and defining operation from a constant or param.value op.
 
static bool allInstancesHaveConstantForPort (igraph::InstanceGraphNode *node, unsigned portIndex)
 Check if all instances have constant values for a given port.
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "hw-parameterize-constant-ports"

Definition at line 24 of file HWParameterizeConstantPorts.cpp.

◆ GEN_PASS_DEF_HWPARAMETERIZECONSTANTPORTS

#define GEN_PASS_DEF_HWPARAMETERIZECONSTANTPORTS

Definition at line 28 of file HWParameterizeConstantPorts.cpp.

Function Documentation

◆ allInstancesHaveConstantForPort()

static bool allInstancesHaveConstantForPort ( igraph::InstanceGraphNode node,
unsigned  portIndex 
)
static

Check if all instances have constant values for a given port.

Definition at line 52 of file HWParameterizeConstantPorts.cpp.

References getAttributeAndDefiningOp(), circt::igraph::InstanceGraphNode::noUses(), and circt::igraph::InstanceGraphNode::uses().

◆ getAttributeAndDefiningOp()

static std::pair< Attribute, Operation * > getAttributeAndDefiningOp ( InstanceOp  inst,
unsigned  portIndex 
)
static

Helper to extract the attribute value and defining operation from a constant or param.value op.

Definition at line 39 of file HWParameterizeConstantPorts.cpp.

Referenced by allInstancesHaveConstantForPort().