CIRCT 23.0.0git
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
circt::firrtl::InstanceInfo Class Reference

#include <FIRRTLInstanceInfo.h>

Collaboration diagram for circt::firrtl::InstanceInfo:
Collaboration graph
[legend]

Classes

struct  CircuitAttributes
 Information about a circuit. More...
 
class  LatticeValue
 A lattice value to record the value of a property. More...
 
class  ModuleAttributes
 Information about a module. More...
 

Public Member Functions

 InstanceInfo (Operation *op, mlir::AnalysisManager &am)
 
bool hasDut ()
 Return true if this circuit has a design-under-test.
 
igraph::ModuleOpInterface getDut ()
 Return the design-under-test if one is defined for the circuit, otherwise return null.
 
igraph::ModuleOpInterface getEffectiveDut ()
 Return the "effective" design-under-test.
 
bool isDut (igraph::ModuleOpInterface op)
 Return true if this module is the design-under-test.
 
bool isEffectiveDut (igraph::ModuleOpInterface op)
 Return true if this module is the design-under-test and the circuit has a design-under-test.
 
bool anyInstanceUnderDut (igraph::ModuleOpInterface op)
 Return true if at least one instance of this module is under (or transitively under) the design-under-test.
 
bool allInstancesUnderDut (igraph::ModuleOpInterface op)
 Return true if all instances of this module are under (or transitively under) the design-under-test.
 
bool anyInstanceUnderEffectiveDut (igraph::ModuleOpInterface op)
 Return true if at least one instance is under (or transitively under) the effective design-under-test.
 
bool allInstancesUnderEffectiveDut (igraph::ModuleOpInterface op)
 Return true if all instances are under (or transitively under) the effective design-under-test.
 
bool anyInstanceUnderLayer (igraph::ModuleOpInterface op)
 Return true if at least one instance of this module is under (or transitively under) a layer.
 
bool allInstancesUnderLayer (igraph::ModuleOpInterface op)
 Return true if all instances of this module are under (or transitively under) layer blocks.
 
bool anyInstanceInDesign (igraph::ModuleOpInterface op)
 Return true if any instance of this module is within (or transitively within) the design.
 
bool allInstancesInDesign (igraph::ModuleOpInterface op)
 Return true if all instances of this module are within (or transitively within) the design.
 
bool anyInstanceInEffectiveDesign (igraph::ModuleOpInterface op)
 Return true if any instance of this module is within (or transitively within) the effective design.
 
bool allInstancesInEffectiveDesign (igraph::ModuleOpInterface op)
 Return true if all instances of this module are within (or transitively within) the effective design.
 
bool anyInstanceInInstanceChoice (igraph::ModuleOpInterface op)
 Return true if any instance of this module is within (or transitively within) an instance choice.
 
bool moduleContainsProperties (igraph::ModuleOpInterface op)
 Return true if this module contains (or its children transitively contain) any property operations, i.e., operations whose operands or results have a PropertyType, if any port of the module has a PropertyType, if the module is a class, or if the module is public or contains any public modules.
 

Static Public Member Functions

static bool isInstanceUnderLayer (InstanceOp inst)
 Return true if an instance op should be considered "under a layer" for the purposes of metadata emission and other analyses.
 
static bool isInstanceUnderLayer (InstanceChoiceOp inst)
 Return true if an instance choice op should be considered "under a layer" for the purposes of metadata emission and other analyses.
 

Private Member Functions

const ModuleAttributesgetModuleAttributes (igraph::ModuleOpInterface op)
 Return the module attributes associated with a module.
 

Private Attributes

CircuitAttributes circuitAttributes
 Stores circuit-level attributes.
 
DenseMap< Operation *, ModuleAttributesmoduleAttributes
 Internal mapping of operations to module attributes.
 

Detailed Description

Definition at line 26 of file FIRRTLInstanceInfo.h.

Constructor & Destructor Documentation

◆ InstanceInfo()

InstanceInfo::InstanceInfo ( Operation *  op,
mlir::AnalysisManager &  am 
)
explicit

Member Function Documentation

◆ allInstancesInDesign()

bool InstanceInfo::allInstancesInDesign ( igraph::ModuleOpInterface  op)

Return true if all instances of this module are within (or transitively within) the design.

Definition at line 341 of file FIRRTLInstanceInfo.cpp.

References getModuleAttributes(), circt::firrtl::InstanceInfo::ModuleAttributes::inDesign, and circt::firrtl::InstanceInfo::LatticeValue::isConstant().

Referenced by anyInstanceInDesign(), and printModuleInfo().

◆ allInstancesInEffectiveDesign()

bool InstanceInfo::allInstancesInEffectiveDesign ( igraph::ModuleOpInterface  op)

Return true if all instances of this module are within (or transitively within) the effective design.

Definition at line 351 of file FIRRTLInstanceInfo.cpp.

References getModuleAttributes(), circt::firrtl::InstanceInfo::ModuleAttributes::inEffectiveDesign, and circt::firrtl::InstanceInfo::LatticeValue::isConstant().

Referenced by anyInstanceInEffectiveDesign(), and printModuleInfo().

◆ allInstancesUnderDut()

bool InstanceInfo::allInstancesUnderDut ( igraph::ModuleOpInterface  op)

Return true if all instances of this module are under (or transitively under) the design-under-test.

This is true if the module is the design-under-test.

Definition at line 313 of file FIRRTLInstanceInfo.cpp.

References getModuleAttributes(), circt::firrtl::InstanceInfo::LatticeValue::isConstant(), and circt::firrtl::InstanceInfo::ModuleAttributes::underDut.

Referenced by allInstancesUnderEffectiveDut(), anyInstanceUnderDut(), and printModuleInfo().

◆ allInstancesUnderEffectiveDut()

bool InstanceInfo::allInstancesUnderEffectiveDut ( igraph::ModuleOpInterface  op)

Return true if all instances are under (or transitively under) the effective design-under-test.

This is true if the module is the effective design-under-test.

Definition at line 322 of file FIRRTLInstanceInfo.cpp.

References allInstancesUnderDut(), and hasDut().

Referenced by printModuleInfo().

◆ allInstancesUnderLayer()

bool InstanceInfo::allInstancesUnderLayer ( igraph::ModuleOpInterface  op)

Return true if all instances of this module are under (or transitively under) layer blocks.

Definition at line 331 of file FIRRTLInstanceInfo.cpp.

References getModuleAttributes(), circt::firrtl::InstanceInfo::LatticeValue::isConstant(), and circt::firrtl::InstanceInfo::ModuleAttributes::underLayer.

Referenced by anyInstanceUnderLayer(), and printModuleInfo().

◆ anyInstanceInDesign()

bool InstanceInfo::anyInstanceInDesign ( igraph::ModuleOpInterface  op)

Return true if any instance of this module is within (or transitively within) the design.

Definition at line 336 of file FIRRTLInstanceInfo.cpp.

References allInstancesInDesign(), getModuleAttributes(), circt::firrtl::InstanceInfo::ModuleAttributes::inDesign, and circt::firrtl::InstanceInfo::LatticeValue::isMixed().

Referenced by printModuleInfo().

◆ anyInstanceInEffectiveDesign()

bool InstanceInfo::anyInstanceInEffectiveDesign ( igraph::ModuleOpInterface  op)

Return true if any instance of this module is within (or transitively within) the effective design.

Definition at line 346 of file FIRRTLInstanceInfo.cpp.

References allInstancesInEffectiveDesign(), getModuleAttributes(), circt::firrtl::InstanceInfo::ModuleAttributes::inEffectiveDesign, and circt::firrtl::InstanceInfo::LatticeValue::isMixed().

Referenced by printModuleInfo().

◆ anyInstanceInInstanceChoice()

bool InstanceInfo::anyInstanceInInstanceChoice ( igraph::ModuleOpInterface  op)

Return true if any instance of this module is within (or transitively within) an instance choice.

Note: allInstancesInInstanceChoice is intentionally not provided because that property is relative to the public module.

Definition at line 356 of file FIRRTLInstanceInfo.cpp.

References getModuleAttributes(), circt::firrtl::InstanceInfo::ModuleAttributes::inInstanceChoice, and circt::firrtl::InstanceInfo::LatticeValue::isMixed().

Referenced by printModuleInfo().

◆ anyInstanceUnderDut()

bool InstanceInfo::anyInstanceUnderDut ( igraph::ModuleOpInterface  op)

Return true if at least one instance of this module is under (or transitively under) the design-under-test.

This is true if the module is the design-under-test.

Definition at line 308 of file FIRRTLInstanceInfo.cpp.

References allInstancesUnderDut(), getModuleAttributes(), circt::firrtl::InstanceInfo::LatticeValue::isMixed(), and circt::firrtl::InstanceInfo::ModuleAttributes::underDut.

Referenced by anyInstanceUnderEffectiveDut(), and printModuleInfo().

◆ anyInstanceUnderEffectiveDut()

bool InstanceInfo::anyInstanceUnderEffectiveDut ( igraph::ModuleOpInterface  op)

Return true if at least one instance is under (or transitively under) the effective design-under-test.

This is true if the module is the effective design-under-test.

Definition at line 318 of file FIRRTLInstanceInfo.cpp.

References anyInstanceUnderDut(), and hasDut().

Referenced by printModuleInfo().

◆ anyInstanceUnderLayer()

bool InstanceInfo::anyInstanceUnderLayer ( igraph::ModuleOpInterface  op)

Return true if at least one instance of this module is under (or transitively under) a layer.

Definition at line 326 of file FIRRTLInstanceInfo.cpp.

References allInstancesUnderLayer(), getModuleAttributes(), circt::firrtl::InstanceInfo::LatticeValue::isMixed(), and circt::firrtl::InstanceInfo::ModuleAttributes::underLayer.

Referenced by printModuleInfo().

◆ getDut()

igraph::ModuleOpInterface InstanceInfo::getDut ( )

Return the design-under-test if one is defined for the circuit, otherwise return null.

Definition at line 300 of file FIRRTLInstanceInfo.cpp.

References circuitAttributes, and circt::firrtl::InstanceInfo::CircuitAttributes::dut.

Referenced by printCircuitInfo().

◆ getEffectiveDut()

igraph::ModuleOpInterface InstanceInfo::getEffectiveDut ( )

Return the "effective" design-under-test.

This will be the design-under-test if one is defined. Otherwise, this will be the root node of the instance graph.

Definition at line 304 of file FIRRTLInstanceInfo.cpp.

References circuitAttributes, and circt::firrtl::InstanceInfo::CircuitAttributes::effectiveDut.

Referenced by printCircuitInfo().

◆ getModuleAttributes()

const InstanceInfo::ModuleAttributes & InstanceInfo::getModuleAttributes ( igraph::ModuleOpInterface  op)
private

◆ hasDut()

bool InstanceInfo::hasDut ( )

◆ isDut()

bool InstanceInfo::isDut ( igraph::ModuleOpInterface  op)

Return true if this module is the design-under-test.

Definition at line 288 of file FIRRTLInstanceInfo.cpp.

References circuitAttributes, circt::firrtl::InstanceInfo::CircuitAttributes::dut, and hasDut().

Referenced by InstanceInfo(), isEffectiveDut(), and printModuleInfo().

◆ isEffectiveDut()

bool InstanceInfo::isEffectiveDut ( igraph::ModuleOpInterface  op)

Return true if this module is the design-under-test and the circuit has a design-under-test.

If the circuit has no design-under-test, then return true if this is the top module.

Definition at line 294 of file FIRRTLInstanceInfo.cpp.

References circuitAttributes, circt::firrtl::InstanceInfo::CircuitAttributes::effectiveDut, hasDut(), and isDut().

Referenced by InstanceInfo().

◆ isInstanceUnderLayer() [1/2]

bool InstanceInfo::isInstanceUnderLayer ( InstanceChoiceOp  inst)
static

Return true if an instance choice op should be considered "under a layer" for the purposes of metadata emission and other analyses.

This includes instances that are:

Definition at line 40 of file FIRRTLInstanceInfo.cpp.

◆ isInstanceUnderLayer() [2/2]

bool InstanceInfo::isInstanceUnderLayer ( InstanceOp  inst)
static

Return true if an instance op should be considered "under a layer" for the purposes of metadata emission and other analyses.

This includes instances that are:

  • Under a LayerBlockOp
  • Under an sv::IfDefOp
  • Marked with getLowerToBind()
  • Marked with getDoNotPrint()

Definition at line 34 of file FIRRTLInstanceInfo.cpp.

Referenced by InstanceInfo().

◆ moduleContainsProperties()

bool InstanceInfo::moduleContainsProperties ( igraph::ModuleOpInterface  op)

Return true if this module contains (or its children transitively contain) any property operations, i.e., operations whose operands or results have a PropertyType, if any port of the module has a PropertyType, if the module is a class, or if the module is public or contains any public modules.

Definition at line 362 of file FIRRTLInstanceInfo.cpp.

References getModuleAttributes(), and circt::firrtl::InstanceInfo::ModuleAttributes::hasProperties.

Referenced by printModuleInfo().

Member Data Documentation

◆ circuitAttributes

CircuitAttributes circt::firrtl::InstanceInfo::circuitAttributes
private
Initial value:
= {nullptr,
nullptr}

Stores circuit-level attributes.

Definition at line 241 of file FIRRTLInstanceInfo.h.

Referenced by getDut(), getEffectiveDut(), hasDut(), InstanceInfo(), isDut(), and isEffectiveDut().

◆ moduleAttributes

DenseMap<Operation *, ModuleAttributes> circt::firrtl::InstanceInfo::moduleAttributes
private

Internal mapping of operations to module attributes.

Definition at line 245 of file FIRRTLInstanceInfo.h.

Referenced by getModuleAttributes(), and InstanceInfo().


The documentation for this class was generated from the following files: