CIRCT  20.0.0git
Public Types | Public Member Functions | Private Attributes | List of all members
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:
Collaboration graph
[legend]

Public Types

enum  Kind { Unknown = 0 , Constant , Mixed }
 

Public Member Functions

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

Private Attributes

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

Detailed Description

A lattice value to record the value of a property.

Definition at line 32 of file FIRRTLInstanceInfo.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Unknown 
Constant 
Mixed 

Definition at line 35 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 39 of file FIRRTLInstanceInfo.cpp.

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

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

◆ isConstant()

bool InstanceInfo::LatticeValue::isConstant ( ) const

◆ isMixed()

bool InstanceInfo::LatticeValue::isMixed ( ) const

◆ isUnknown()

bool InstanceInfo::LatticeValue::isUnknown ( ) const

Return true if the kind is Unknown.

Definition at line 33 of file FIRRTLInstanceInfo.cpp.

References kind, and Unknown.

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

◆ markConstant()

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

Set this LatticeValue to a constant.

Definition at line 44 of file FIRRTLInstanceInfo.cpp.

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

◆ markMixed()

void InstanceInfo::LatticeValue::markMixed ( )

Set this LatticeValue to mixed.

Definition at line 49 of file FIRRTLInstanceInfo.cpp.

◆ mergeIn() [1/2]

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

Merge a constant value into this one.

Definition at line 65 of file FIRRTLInstanceInfo.cpp.

References markConstant().

◆ mergeIn() [2/2]

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

Merge attributes from another LatticeValue into this one.

Definition at line 51 of file FIRRTLInstanceInfo.cpp.

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

Referenced by circt::firrtl::InstanceInfo::InstanceInfo().

◆ operator!()

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

Invert the lattice value.

Definition at line 71 of file FIRRTLInstanceInfo.cpp.

References getConstant().

Member Data Documentation

◆ kind

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

Whether or not the property holds.

Definition at line 49 of file FIRRTLInstanceInfo.h.

Referenced by isUnknown(), and mergeIn().

◆ value

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

The value of the property if kind is Constant.

Definition at line 52 of file FIRRTLInstanceInfo.h.

Referenced by mergeIn(), and Python.support.OpOperand::type().


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