CIRCT 22.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
circt::synth::MatchResult Struct Reference

Result of matching a cut against a pattern. More...

#include <CutRewriter.h>

Collaboration diagram for circt::synth::MatchResult:
Collaboration graph
[legend]

Public Member Functions

 MatchResult ()=default
 Default constructor.
 
 MatchResult (double area, ArrayRef< DelayType > delays)
 Constructor with area and delays (by reference).
 
void setDelayRef (ArrayRef< DelayType > delays)
 Set delays by reference (zero-cost for static/cached delays).
 
void setOwnedDelays (SmallVector< DelayType, 6 > delays)
 Set delays by transferring ownership (for dynamically computed delays).
 
ArrayRef< DelayTypegetDelays () const
 Get all delays as an ArrayRef.
 

Public Attributes

double area = 0.0
 Area cost of implementing this cut with the pattern.
 

Private Attributes

ArrayRef< DelayTypeborrowedDelays
 Borrowed delays (used when ownedDelays is empty).
 
std::optional< SmallVector< DelayType, 6 > > ownedDelays
 Owned delays (used when present).
 

Detailed Description

Result of matching a cut against a pattern.

This structure contains the area and per-input delay information computed during pattern matching.

The delays can be stored in two ways:

  1. As a reference to static/cached data (e.g., tech library delays)
  2. As owned dynamic data (e.g., computed SOP delays)

Definition at line 74 of file CutRewriter.h.

Constructor & Destructor Documentation

◆ MatchResult() [1/2]

circt::synth::MatchResult::MatchResult ( )
default

Default constructor.

◆ MatchResult() [2/2]

circt::synth::MatchResult::MatchResult ( double  area,
ArrayRef< DelayType delays 
)
inline

Constructor with area and delays (by reference).

Definition at line 82 of file CutRewriter.h.

Member Function Documentation

◆ getDelays()

ArrayRef< DelayType > circt::synth::MatchResult::getDelays ( ) const
inline

Get all delays as an ArrayRef.

Definition at line 97 of file CutRewriter.h.

References borrowedDelays, and ownedDelays.

◆ setDelayRef()

void circt::synth::MatchResult::setDelayRef ( ArrayRef< DelayType delays)
inline

Set delays by reference (zero-cost for static/cached delays).

The caller must ensure the referenced data remains valid.

Definition at line 87 of file CutRewriter.h.

References borrowedDelays.

◆ setOwnedDelays()

void circt::synth::MatchResult::setOwnedDelays ( SmallVector< DelayType, 6 >  delays)
inline

Set delays by transferring ownership (for dynamically computed delays).

This moves the data into internal storage.

Definition at line 91 of file CutRewriter.h.

References borrowedDelays, and ownedDelays.

Member Data Documentation

◆ area

double circt::synth::MatchResult::area = 0.0

Area cost of implementing this cut with the pattern.

Definition at line 76 of file CutRewriter.h.

◆ borrowedDelays

ArrayRef<DelayType> circt::synth::MatchResult::borrowedDelays
private

Borrowed delays (used when ownedDelays is empty).

Points to external data provided via setDelayRef().

Definition at line 105 of file CutRewriter.h.

Referenced by getDelays(), setDelayRef(), and setOwnedDelays().

◆ ownedDelays

std::optional<SmallVector<DelayType, 6> > circt::synth::MatchResult::ownedDelays
private

Owned delays (used when present).

Only allocated when setOwnedDelays() is called. When empty (std::nullopt), moving this MatchResult avoids constructing/moving the SmallVector, achieving zero-cost abstraction for the common case (borrowed delays).

Definition at line 111 of file CutRewriter.h.

Referenced by getDelays(), and setOwnedDelays().


The documentation for this struct was generated from the following file: