CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::firrtl::GatedClockConversion::MatRef Class Reference

A reference to a clock/enable value that can also name values which do not exist yet (a planned port, a planned wire). More...

Collaboration diagram for circt::firrtl::GatedClockConversion::MatRef:

Public Types

enum class  Kind {
  None , Direct , InstResult , ModuleArg ,
  PlannedWire , GateEnable
}

Public Member Functions

 MatRef ()=default
Kind getKind () const
Value getValue () const
unsigned getIndex () const
Operation * getOp () const
ClockGateIntrinsicOp gate () const
void print (llvm::raw_ostream &os) const

Static Public Member Functions

static MatRef direct (Value v)
static MatRef instResult (FInstanceLike inst, unsigned index)
static MatRef moduleArg (FModuleOp mod, unsigned index)
static MatRef plannedWire (unsigned index)
static MatRef gateEnable (ClockGateIntrinsicOp gate)
static MatRef of (Value v)
 Instance results become symbolic refs, every other value is stable.

Static Private Member Functions

static MatRef opRef (Kind kind, Operation *op, unsigned index)

Private Attributes

Kind kind = Kind::None
Value value
 Direct only.
Operation * op = nullptr
 Instance / module / gate, by kind.
unsigned index = 0
 Result, argument or wire index.

Detailed Description

A reference to a clock/enable value that can also name values which do not exist yet (a planned port, a planned wire).

Inserting a port re-creates every instance of a module, so instance results are the only values applyPlan() invalidates. Hence the rule this class enforces: name them symbolically as (instance, resultIndex), never raw.

Definition at line 73 of file GatedClockConversion.h.

Member Enumeration Documentation

◆ Kind

Enumerator
None 

Null reference, e.g. "no enable".

Direct 

A Value that applyPlan() never invalidates.

InstResult 

Result index of an instance (existing or planned port).

ModuleArg 

Block argument index of a module (existing or planned).

PlannedWire 

Entry index of plannedWireValues.

GateEnable 

gate.enable | gate.test_enable, lowered on demand.

Definition at line 75 of file GatedClockConversion.h.

Constructor & Destructor Documentation

◆ MatRef()

circt::firrtl::GatedClockConversion::MatRef::MatRef ( )
default

Member Function Documentation

◆ direct()

MatRef circt::firrtl::GatedClockConversion::MatRef::direct ( Value v)
inlinestatic

Definition at line 86 of file GatedClockConversion.h.

References assert(), Direct, kind, MatRef(), and value.

Referenced by of().

◆ gate()

ClockGateIntrinsicOp circt::firrtl::GatedClockConversion::MatRef::gate ( ) const
inline

Definition at line 121 of file GatedClockConversion.h.

References op.

Referenced by gateEnable(), and circt::firrtl::GatedClockConversion::resolve().

◆ gateEnable()

MatRef circt::firrtl::GatedClockConversion::MatRef::gateEnable ( ClockGateIntrinsicOp gate)
inlinestatic

Definition at line 104 of file GatedClockConversion.h.

References gate(), GateEnable, MatRef(), and opRef().

Referenced by circt::firrtl::GatedClockConversion::planGate().

◆ getIndex()

unsigned circt::firrtl::GatedClockConversion::MatRef::getIndex ( ) const
inline

Definition at line 119 of file GatedClockConversion.h.

References index.

Referenced by circt::firrtl::GatedClockConversion::resolve().

◆ getKind()

Kind circt::firrtl::GatedClockConversion::MatRef::getKind ( ) const
inline

Definition at line 117 of file GatedClockConversion.h.

References kind.

Referenced by circt::firrtl::GatedClockConversion::resolve().

◆ getOp()

Operation * circt::firrtl::GatedClockConversion::MatRef::getOp ( ) const
inline

Definition at line 120 of file GatedClockConversion.h.

References op.

Referenced by circt::firrtl::GatedClockConversion::resolve().

◆ getValue()

Value circt::firrtl::GatedClockConversion::MatRef::getValue ( ) const
inline

Definition at line 118 of file GatedClockConversion.h.

References value.

Referenced by circt::firrtl::GatedClockConversion::resolve().

◆ instResult()

MatRef circt::firrtl::GatedClockConversion::MatRef::instResult ( FInstanceLike inst,
unsigned index )
inlinestatic

Definition at line 95 of file GatedClockConversion.h.

References index, InstResult, MatRef(), and opRef().

Referenced by of(), and circt::firrtl::GatedClockConversion::planInstancePort().

◆ moduleArg()

MatRef circt::firrtl::GatedClockConversion::MatRef::moduleArg ( FModuleOp mod,
unsigned index )
inlinestatic

◆ of()

MatRef circt::firrtl::GatedClockConversion::MatRef::of ( Value v)
inlinestatic

Instance results become symbolic refs, every other value is stable.

Definition at line 109 of file GatedClockConversion.h.

References direct(), instResult(), and MatRef().

Referenced by circt::firrtl::GatedClockConversion::plan(), circt::firrtl::GatedClockConversion::planGate(), and circt::firrtl::GatedClockConversion::planInstancePort().

◆ opRef()

MatRef circt::firrtl::GatedClockConversion::MatRef::opRef ( Kind kind,
Operation * op,
unsigned index )
inlinestaticprivate

Definition at line 126 of file GatedClockConversion.h.

References index, kind, MatRef(), and op.

Referenced by gateEnable(), instResult(), moduleArg(), and plannedWire().

◆ plannedWire()

MatRef circt::firrtl::GatedClockConversion::MatRef::plannedWire ( unsigned index)
inlinestatic

Definition at line 101 of file GatedClockConversion.h.

References index, MatRef(), opRef(), and PlannedWire.

Referenced by circt::firrtl::GatedClockConversion::planAlias().

◆ print()

void GatedClockConversion::MatRef::print ( llvm::raw_ostream & os) const

Definition at line 96 of file GatedClockConversion.cpp.

References Direct, GateEnable, index, InstResult, kind, ModuleArg, None, op, PlannedWire, and value.

Member Data Documentation

◆ index

unsigned circt::firrtl::GatedClockConversion::MatRef::index = 0
private

Result, argument or wire index.

Definition at line 137 of file GatedClockConversion.h.

Referenced by getIndex(), instResult(), moduleArg(), opRef(), plannedWire(), and print().

◆ kind

Kind circt::firrtl::GatedClockConversion::MatRef::kind = Kind::None
private

Definition at line 134 of file GatedClockConversion.h.

Referenced by direct(), getKind(), opRef(), and print().

◆ op

Operation* circt::firrtl::GatedClockConversion::MatRef::op = nullptr
private

Instance / module / gate, by kind.

Definition at line 136 of file GatedClockConversion.h.

Referenced by gate(), getOp(), opRef(), and print().

◆ value

Value circt::firrtl::GatedClockConversion::MatRef::value
private

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