update func_pragma definition; update readme

This commit is contained in:
Hanchen Ye 2020-10-01 20:10:51 -05:00
parent e2c21ca9ab
commit 4838b15b0f
5 changed files with 28 additions and 37 deletions

View File

@ -20,18 +20,24 @@ scalehls-opt -convert-to-hlscpp test/EmitHLSCpp/test_*.mlir | scalehls-translate
## TODOs List
### HLSCpp Dialect
1. TODOs in HLSCpp/PragmaOps.td.
1. Enhance array_pragma operation.
2. Update attributes definition.
3. TODOs in HLSCpp/PragmaOps.td.
### QoREstimation Pass
1. **Performance estimator implementation.**
1. Implement comprehensive partition-aware II analysis.
2. Consider the case of flattened inner loop under a pipelined region.
3. Support read latency from profiling data.
4. Support operation chainning.
### PragmaDSE Pass
### EmitHLSCpp
1. Support AffineFor iter_args feature;
2. TODOs in EmitHLSCpp.cpp;
3. Support memref/tensor cast/view/subview operations;
4. Support atomic/complex/extention -related operations.
1. Emitting array_pragma operation.
2. Support AffineFor iter_args feature.
3. TODOs in EmitHLSCpp.cpp.
4. Support memref/tensor cast/view/subview operations.
5. Support atomic/complex/extention -related operations.
## References
1. [MLIR Documents](https://mlir.llvm.org)

View File

@ -42,12 +42,6 @@ def FuncPragmaOp : HLSCppOp<"func_pragma", [
}];
let arguments = (ins
// Pipeline pragma-related attributes.
Confined<UI32Attr, [IntPositive]> : $II,
BoolAttr : $enable_flush,
BoolAttr : $rewind,
BoolAttr : $off,
// Dataflow pragma-related attributes.
BoolAttr : $dataflow
);

View File

@ -189,7 +189,7 @@ unsigned QoREstimator::getBlockII(Block &block, ScheduleMap &opScheduleMap,
for (auto &op : block) {
// Handle load operations.
if (auto loadOp = dyn_cast<LoadOp>(op)) {
if (auto loadOp = dyn_cast<AffineLoadOp>(op)) {
for (auto memStore : memStoreList) {
if (loadOp.getMemRef() == memStore.first) {
// TODO: For now, we simply assume the distance between dependency
@ -204,7 +204,7 @@ unsigned QoREstimator::getBlockII(Block &block, ScheduleMap &opScheduleMap,
}
// Handle Store operations.
else if (auto storeOp = dyn_cast<StoreOp>(op)) {
else if (auto storeOp = dyn_cast<AffineStoreOp>(op)) {
for (auto memStore : memStoreList) {
if (loadOp.getMemRef() == memStore.first) {
unsigned WAWLatency =

View File

@ -1047,17 +1047,9 @@ void ModuleEmitter::emitLoopPragma(LoopPragmaOp *op) {
}
void ModuleEmitter::emitFuncPragma(FuncPragmaOp *op) {
indent();
os << "#pragma HLS pipeline";
if (op->off())
os << " off\n";
else {
os << " II=" << op->II();
if (op->rewind())
os << " rewind";
if (op->enable_flush())
os << " enable_flush";
os << "\n";
if (op->dataflow()) {
indent();
os << "#pragma HLS dataflow\n";
}
}

View File

@ -1,18 +1,17 @@
// RUN: scalehls-opt -qor-estimation %s | FileCheck %s
// CHECK-LABEL: func @test_for
func @test_for(%arg0: memref<16xindex>, %arg1: index) {
%c11 = constant 11 : index
affine.for %i = 0 to 16 step 2 {
"hlscpp.loop_pragma" () {II = 1 : ui32, enable_flush = false, rewind = false, off = true, factor = 4 : ui32, region = false, skip_exit_check = true} : () -> ()
affine.for %j = 0 to 8 {
"hlscpp.loop_pragma" () {II = 1 : ui32, enable_flush = false, rewind = false, off = false, factor = 1 : ui32, region = false, skip_exit_check = true} : () -> ()
affine.for %k = 0 to 8 step 2 {
"hlscpp.loop_pragma" () {II = 1 : ui32, enable_flush = false, rewind = false, off = true, factor = 4 : ui32, region = false, skip_exit_check = true} : () -> ()
%0 = load %arg0[%i] : memref<16xindex>
%1 = addi %0, %j : index
store %1, %arg0[%k] : memref<16xindex>
func @test_for(%arg0: memref<16x4x4xindex>, %arg1: memref<16x4x4xindex>) {
affine.for %i = 0 to 16 {
"hlscpp.loop_pragma" () {II = 1 : ui32, off = true, enable_flush = false, rewind = false, factor = 4 : ui32, region = false, skip_exit_check = false} : () -> ()
affine.for %j = 0 to 4 {
"hlscpp.loop_pragma" () {II = 1 : ui32, off = false, enable_flush = false, rewind = false, factor = 1 : ui32, region = false, skip_exit_check = false} : () -> ()
affine.for %k = 0 to 4 {
"hlscpp.loop_pragma" () {II = 1 : ui32, off = true, enable_flush = false, rewind = false, factor = 4 : ui32, region = false, skip_exit_check = false} : () -> ()
%0 = affine.load %arg0[%i, %j, %k] : memref<16x4x4xindex>
%1 = affine.load %arg1[%i, %j, %k] : memref<16x4x4xindex>
%2 = muli %0, %1 : index
affine.store %2, %arg0[%i, %j, %k] : memref<16x4x4xindex>
}
}
}