-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[circt-synth] Populate pipelines until AIG lowering (#7741)
This commit populates circt-synth pipeline from CombToAIG to LowerWordToBits with optimizations.
- Loading branch information
Showing
3 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
// RUN: circt-synth %s | FileCheck %s | ||
// RUN: circt-synth %s --until-before aig-lowering | FileCheck %s --check-prefix=AIG | ||
|
||
// AIG-LABEL: @and | ||
// CHECK-LABEL: @and | ||
hw.module @and(in %a: i1, in %b: i1, out and: i1) { | ||
%0 = comb.and %a, %b : i1 | ||
hw.output %0 : i1 | ||
hw.module @and(in %a: i2, in %b: i2, in %c: i2, out and: i2) { | ||
%0 = comb.and %a, %b, %c : i2 | ||
// AIG-NEXT: %[[AND_INV:.+]] = aig.and_inv %a, %b, %c : i2 | ||
// AIG-NEXT: hw.output %[[AND_INV]] : i2 | ||
// CHECK-DAG: %[[B_1:.+]] = comb.extract %b from 1 : (i2) -> i1 | ||
// CHECK-DAG: %[[C_1:.+]] = comb.extract %c from 1 : (i2) -> i1 | ||
// CHECK-DAG: %[[AND_INV_0:.+]] = aig.and_inv %0, %[[C_1]] : i1 | ||
// CHECK-DAG: %[[B_0:.+]] = comb.extract %b from 0 : (i2) -> i1 | ||
// CHECK-DAG: %[[C_0:.+]] = comb.extract %c from 0 : (i2) -> i1 | ||
// CHECK-DAG: %[[AND_INV_1:.+]] = aig.and_inv %[[B_0]], %[[C_0]] : i1 | ||
// CHECK-DAG: %[[A_1:.+]] = comb.extract %a from 1 : (i2) -> i1 | ||
// CHECK-DAG: %[[AND_INV_2:.+]] = aig.and_inv %[[A_1]], %[[AND_INV_0]] : i1 | ||
// CHECK-DAG: %[[A_0:.+]] = comb.extract %a from 0 : (i2) -> i1 | ||
// CHECK-DAG: %[[AND_INV_3:.+]] = aig.and_inv %[[A_0]], %[[AND_INV_1]] : i1 | ||
// CHECK-DAG: %[[CONCAT:.+]] = comb.concat %[[AND_INV_2]], %[[AND_INV_3]] : i1, i1 | ||
// CHECK-NEXT: hw.output %[[CONCAT]] : i2 | ||
hw.output %0 : i2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters