Skip to content

Commit

Permalink
Support OR-Tools-based schedulers.
Browse files Browse the repository at this point in the history
  • Loading branch information
jopperm committed Jan 23, 2023
1 parent ab9f5df commit 7ae8287
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 182 deletions.
9 changes: 9 additions & 0 deletions test/Scheduling/cyclic-problems.mlir
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// RUN: circt-opt %s -ssp-roundtrip=verify
// RUN: circt-opt %s -ssp-schedule=scheduler=simplex | FileCheck %s -check-prefixes=CHECK,SIMPLEX
// RUN: %if or-tools %{ circt-opt %s -ssp-schedule=scheduler=lp | FileCheck %s -check-prefixes=CHECK,LP %}

// CHECK-LABEL: cyclic
// SIMPLEX-SAME: [II<2>]
// LP-SAME: [II<2>]
ssp.instance @cyclic of "CyclicProblem" [II<2>] {
library {
operator_type @_0 [latency<0>]
Expand All @@ -16,12 +18,14 @@ ssp.instance @cyclic of "CyclicProblem" [II<2>] {
%3 = operation<@_1>(%1, %2) [t<2>]
%4 = operation<@_1> @op4(%2, %0) [t<3>]
// SIMPLEX: @last(%{{.*}}) [t<3>]
// LP: @last(%{{.*}}) [t<3>]
operation<@_1> @last(%4) [t<4>]
}
}

// CHECK-LABEL: mobility
// SIMPLEX-SAME: [II<3>]
// LP-SAME: [II<3>]
ssp.instance @mobility of "CyclicProblem" [II<3>] {
library {
operator_type @_1 [latency<1>]
Expand All @@ -35,12 +39,14 @@ ssp.instance @mobility of "CyclicProblem" [II<3>] {
%4 = operation<@_4>(%3) [t<6>]
%5 = operation<@_1> @op5(%3) [t<6>]
// SIMPLEX: @last(%{{.*}}, %{{.*}}) [t<10>]
// LP: @last(%{{.*}}, %{{.*}}) [t<10>]
operation<@_1> @last(%4, %5) [t<10>]
}
}

// CHECK-LABEL: interleaved_cycles
// SIMPLEX-SAME: [II<4>]
// LP-SAME: [II<4>]
ssp.instance @interleaved_cycles of "CyclicProblem" [II<4>] {
library {
operator_type @_1 [latency<1>]
Expand All @@ -58,12 +64,14 @@ ssp.instance @interleaved_cycles of "CyclicProblem" [II<4>] {
%8 = operation<@_10>(%7) [t<23>]
%9 = operation<@_1> @op9(%7) [t<23>]
// SIMPLEX: @last(%{{.*}}, %{{.*}}) [t<33>]
// LP: @last(%{{.*}}, %{{.*}}) [t<33>]
operation<@_1> @last(%8, %9) [t<33>]
}
}

// CHECK-LABEL: self_arc
// SIMPLEX-SAME: [II<3>]
// LP-SAME: [II<3>]
ssp.instance @self_arc of "CyclicProblem" [II<3>] {
library {
operator_type @_1 [latency<1>]
Expand All @@ -73,6 +81,7 @@ ssp.instance @self_arc of "CyclicProblem" [II<3>] {
%0 = operation<@_1>() [t<0>]
%1 = operation<@_3> @op1(%0, @op1 [dist<1>]) [t<1>]
// SIMPLEX: operation<@_1> @last(%{{.*}}) [t<4>]
// LP: operation<@_1> @last(%{{.*}}) [t<4>]
%2 = operation<@_1> @last(%1) [t<4>]
}
}
78 changes: 0 additions & 78 deletions test/Scheduling/or-tools/cyclic-problems.mlir

This file was deleted.

50 changes: 0 additions & 50 deletions test/Scheduling/or-tools/problems.mlir

This file was deleted.

54 changes: 0 additions & 54 deletions test/Scheduling/or-tools/shared-operators-problems.mlir

This file was deleted.

4 changes: 4 additions & 0 deletions test/Scheduling/problems.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// RUN: circt-opt %s -ssp-roundtrip=verify
// RUN: circt-opt %s -ssp-schedule=scheduler=asap | FileCheck %s -check-prefixes=CHECK,ASAP
// RUN: circt-opt %s -ssp-schedule=scheduler=simplex | FileCheck %s -check-prefixes=CHECK,SIMPLEX
// RUN: %if or-tools %{ circt-opt %s -ssp-schedule=scheduler=lp | FileCheck %s -check-prefixes=CHECK,LP %}

// CHECK-LABEL: unit_latencies
ssp.instance @unit_latencies of "Problem" {
Expand All @@ -25,6 +26,7 @@ ssp.instance @unit_latencies of "Problem" {
%6 = operation<@_1>(%3, %4, %5) [t<5>]
// ASAP-NEXT: [t<6>]
// SIMPLEX: @last(%{{.*}}) [t<6>]
// LP: @last(%{{.*}}) [t<6>]
operation<@_1> @last(%6) [t<6>]
}
}
Expand Down Expand Up @@ -54,6 +56,7 @@ ssp.instance @arbitrary_latencies of "Problem" {
%5 = operation<@_10>(%4) [t<50>]
// ASAP-NEXT: [t<19>]
// SIMPLEX: @last(%{{.*}}) [t<19>]
// LP: @last(%{{.*}}) [t<19>]
operation<@_1> @last(%5) [t<60>]
}
}
Expand All @@ -79,6 +82,7 @@ ssp.instance @auxiliary_dependences of "Problem" {
operation<@_1> @op5(@op4) [t<4>]
// ASAP-NEXT: [t<5>]
// SIMPLEX: @last(@op3, @op5) [t<5>]
// LP: @last(@op3, @op5) [t<5>]
operation<@_1> @last(@op3, @op5) [t<5>]
}
}
4 changes: 4 additions & 0 deletions test/Scheduling/shared-operators-problems.mlir
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: circt-opt %s -ssp-roundtrip=verify
// RUN: circt-opt %s -ssp-schedule=scheduler=simplex | FileCheck %s -check-prefixes=CHECK,SIMPLEX
// RUN: %if or-tools %{ circt-opt %s -ssp-schedule=scheduler=cpsat | FileCheck %s -check-prefixes=CHECK,CPSAT %}

// CHECK-LABEL: full_load
ssp.instance @full_load of "SharedOperatorsProblem" {
Expand All @@ -15,6 +16,7 @@ ssp.instance @full_load of "SharedOperatorsProblem" {
%4 = operation<@L1_3>() [t<4>]
%5 = operation<@_1>(%0, %1, %2, %3, %4) [t<7>]
// SIMPLEX: @last(%{{.*}}) [t<8>]
// CPSAT: @last(%{{.*}}) [t<8>]
operation<@_1> @last(%5) [t<8>]
}
}
Expand All @@ -33,6 +35,7 @@ ssp.instance @partial_load of "SharedOperatorsProblem" {
%4 = operation<@L3_3>() [t<1>]
%5 = operation<@_1>(%0, %1, %2, %3, %4) [t<10>]
// SIMPLEX: @last(%{{.*}}) [t<5>]
// CPSAT: @last(%{{.*}}) [t<5>]
operation<@_1> @last(%5) [t<11>]
}
}
Expand All @@ -52,6 +55,7 @@ ssp.instance @multiple of "SharedOperatorsProblem" {
%4 = operation<@L1_1>() [t<1>]
%5 = operation<@_1>(%0, %1, %2, %3, %4) [t<10>]
// SIMPLEX: @last(%{{.*}}) [t<5>]
// CPSAT: @last(%{{.*}}) [t<5>]
operation<@_1> @last(%5) [t<11>]
}
}

0 comments on commit 7ae8287

Please sign in to comment.