Skip to content

Conversation

@uenoku
Copy link
Member

@uenoku uenoku commented Jan 9, 2026

Change match() to return std::optional instead of bool, computing area and delays during matching rather than via separate getArea()/getDelay() queries.

The main motivation is to enable AIG/MIG-level rewriting patterns to compute delays dynamically per cut (e.g., SOP-based delays), while tech/LUT mapping patterns can still use cached constant delays efficiently.

MatchResult supports both borrowed delays (zero-cost references for constant delays) and owned delays (for dynamically computed values).

Non functional change for existing code

Change match() to return std::optional<MatchResult> instead of bool,
computing area and delays during matching rather than via separate
getArea()/getDelay() queries.

Main motivation: Enable AIG/MIG-level rewriting patterns to compute
delays dynamically per cut (e.g., SOP-based delays), while tech/LUT
mapping patterns can still use cached constant delays efficiently.

MatchResult supports both borrowed delays (zero-cost references for
constant delays) and owned delays (for dynamically computed values).

All existing patterns updated to use cached delays. CutEnumerator
now passed to match() and rewrite() for accessing cut information.

Non functional change for existing code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant