CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::firrtl::InstanceInfo::LatticeValue Class Reference

A lattice value to record the value of a property. More...

#include <FIRRTLInstanceInfo.h>

Collaboration diagram for circt::firrtl::InstanceInfo::LatticeValue:

Public Types

enum  Kind { Unknown = 0 , Constant , Mixed }

Public Member Functions

bool isUnknown () const
 Return true if the kind is Unknown.
bool isConstant () const
 Return true if the kind is Constant.
bool isMixed () const
 Return true if the kind is Mixed.
bool getConstant () const
 Return the value. This should only be used if the kind is Constant.
void markConstant (bool constant)
 Set this LatticeValue to a constant.
void markMixed ()
 Set this LatticeValue to mixed.
void mergeIn (LatticeValue that)
 Merge attributes from another LatticeValue into this one.
void mergeIn (bool value)
 Merge a constant value into this one.
LatticeValue operator! ()
 Invert the lattice value.

Private Attributes

Kind kind = Kind::Unknown
 Whether or not the property holds.
bool value = false
 The value of the property if kind is Constant.

Detailed Description

A lattice value to record the value of a property.

Definition at line 48 of file FIRRTLInstanceInfo.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Unknown 
Constant 
Mixed 

Definition at line 51 of file FIRRTLInstanceInfo.h.

Member Function Documentation

◆ getConstant()

bool InstanceInfo::LatticeValue::getConstant ( ) const

Return the value. This should only be used if the kind is Constant.

Definition at line 51 of file FIRRTLInstanceInfo.cpp.

References assert(), circt::firrtl::isConstant(), and value.

Referenced by circt::firrtl::operator<<().

◆ isConstant()

◆ isMixed()

◆ isUnknown()

bool InstanceInfo::LatticeValue::isUnknown ( ) const

Return true if the kind is Unknown.

Definition at line 45 of file FIRRTLInstanceInfo.cpp.

References kind, and Unknown.

Referenced by operator!(), and circt::firrtl::operator<<().

◆ markConstant()

void InstanceInfo::LatticeValue::markConstant ( bool constant)

Set this LatticeValue to a constant.

Definition at line 56 of file FIRRTLInstanceInfo.cpp.

References Constant, kind, and value.

Referenced by circt::firrtl::InstanceInfo::InstanceInfo(), and mergeIn().

◆ markMixed()

void InstanceInfo::LatticeValue::markMixed ( )

Set this LatticeValue to mixed.

Definition at line 61 of file FIRRTLInstanceInfo.cpp.

References kind, and Mixed.

◆ mergeIn() [1/2]

void InstanceInfo::LatticeValue::mergeIn ( bool value)

Merge a constant value into this one.

Definition at line 77 of file FIRRTLInstanceInfo.cpp.

References markConstant(), mergeIn(), and value.

◆ mergeIn() [2/2]

void InstanceInfo::LatticeValue::mergeIn ( LatticeValue that)

Merge attributes from another LatticeValue into this one.

Definition at line 63 of file FIRRTLInstanceInfo.cpp.

References getConstant(), circt::firrtl::isConstant(), kind, Mixed, and value.

Referenced by circt::firrtl::InstanceInfo::InstanceInfo(), and mergeIn().

◆ operator!()

InstanceInfo::LatticeValue InstanceInfo::LatticeValue::operator! ( )

Invert the lattice value.

Definition at line 83 of file FIRRTLInstanceInfo.cpp.

References getConstant(), isMixed(), and isUnknown().

Member Data Documentation

◆ kind

Kind circt::firrtl::InstanceInfo::LatticeValue::kind = Kind::Unknown
private

Whether or not the property holds.

Definition at line 65 of file FIRRTLInstanceInfo.h.

Referenced by isConstant(), isMixed(), isUnknown(), markConstant(), markMixed(), and mergeIn().

◆ value

bool circt::firrtl::InstanceInfo::LatticeValue::value = false
private

The value of the property if kind is Constant.

Definition at line 68 of file FIRRTLInstanceInfo.h.

Referenced by getConstant(), synth.Object::is_output_port(), markConstant(), mergeIn(), mergeIn(), and Python.support.OpOperand::type().


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