Skip to content

Commit b31d4ef

Browse files
committed
[Experimental][SQ] Added "Straight to the queue" pass implementation
1 parent 175e7ed commit b31d4ef

7 files changed

Lines changed: 616 additions & 9 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//===- HandshakeStraightToQueue.h - Implement S2Q algorithm --*- C++ -*----===//
2+
//
3+
// Dynamatic is under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file declares the pass which allows to implement straight to the queue,
10+
// a different way of allocating basic blocks in the LSQ, based on an ASAP
11+
// approach rather than relying on the network of cmerges.
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#ifndef DYNAMATIC_TRANSFORMS_HANDSHAKESTRAIGHTTOQUEUE_H
16+
#define DYNAMATIC_TRANSFORMS_HANDSHAKESTRAIGHTTOQUEUE_H
17+
#include "dynamatic/Support/DynamaticPass.h"
18+
#include "mlir/Dialect/ControlFlow/IR/ControlFlow.h"
19+
#include "mlir/Dialect/Func/IR/FuncOps.h"
20+
21+
namespace dynamatic {
22+
namespace experimental {
23+
namespace ftd {
24+
25+
std::unique_ptr<dynamatic::DynamaticPass> createStraightToQueue();
26+
27+
#define GEN_PASS_DECL_HANDSHAKESTRAIGHTTOQUEUE
28+
#define GEN_PASS_DEF_HANDSHAKESTRAIGHTTOQUEUE
29+
#include "experimental/Transforms/Passes.h.inc"
30+
31+
} // namespace ftd
32+
} // namespace experimental
33+
} // namespace dynamatic
34+
#endif // DYNAMATIC_TRANSFORMS_HANDSHAKESTRAIGHTTOQUEUE_H

experimental/include/experimental/Transforms/Passes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "dynamatic/Support/LLVM.h"
1818
#include "experimental/Transforms/HandshakeCombineSteeringLogic.h"
1919
#include "experimental/Transforms/HandshakePlaceBuffersCustom.h"
20+
#include "experimental/Transforms/HandshakeStraightToQueue.h"
2021
#include "experimental/Transforms/LSQSizing/HandshakeSizeLSQs.h"
2122
#include "experimental/Transforms/ResourceSharing/Crush.h"
2223
#include "experimental/Transforms/Rigidification/HandshakeRigidification.h"

experimental/include/experimental/Transforms/Passes.td

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ def HandshakeCombineSteeringLogic : DynamaticPass< "handshake-combine-steering-l
2626
}];
2727
let constructor = "dynamatic::experimental::ftd::combineSteeringLogic()";
2828
}
29+
def HandshakeStraightToQueue : DynamaticPass< "handshake-straight-to-queue"> {
30+
let summary = "Use the FPGA'23 technique to allocate the basic blocks in the LSQs";
31+
let description = [{
32+
"Straight to the queue" allows to allocate the basic blocks in the LSQ
33+
according to an ASAP approach rather than by following the control flow
34+
relationships coming from the network of cmerges.
35+
}];
36+
let constructor = "dynamatic::experimental::ftd::createStraightToQueue()";
37+
let dependentDialects = ["mlir::cf::ControlFlowDialect", "mlir::func::FuncDialect"];
38+
}
2939

3040
def HandshakeSpeculation : DynamaticPass<"handshake-speculation"> {
3141
let summary = "Place Speculation operations";

experimental/lib/Transforms/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
add_dynamatic_library(DynamaticExperimentalTransforms
22
HandshakePlaceBuffersCustom.cpp
33
HandshakeCombineSteeringLogic.cpp
4+
HandshakeStraightToQueue.cpp
45

56
DEPENDS
67
DynamaticExperimentalTransformsPassIncGen

0 commit comments

Comments
 (0)