llvm / llvm/circt

[Synth] Add an operation for declarative Cut rewrite pattern

Open
#10,485 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

Conceptually similar to PDL, but it operates on truth table.
For PDL we can use native constraint to match specific truth table but
still not suitable for dynamic programming based cut rewriting.
The operations serves as a database for cut rewriting pattern.
```
synth.cut_rewrite_pattern (%0:i1, %1:i1, %2:i1) -> (i1) attributes {cost = ...} {
%0 = synth.aig.and_inv %n0, not %1, %2: i1
synth.yield %0: i1
}

hw.module @XOR3() {...}
synth.cut_rewrite_pattern (%0:i1, %1:i1, %2:i1) -> (i1) attributes {cost = ...} {
%0 = hw.instance @XOR3 (...)
synth.yield %0: i1
}
```

TechMapper (and also database based Cut rewriting, c.f. abc `rewrite` command) could use this operations to declare patterns.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by surveying the existing Synth dialect operations and the TechMapper entry point; the issue names PDL and ABC's rewrite command as related approaches. Done means a declarative synth.cut_rewrite_pattern operation can represent the shown AIG and hw.module patterns and can serve TechMapper or database-based cut rewriting.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.