[ClavaHls] Partition arrays using 2 different strategies based on size
@@ -83,10 +83,17 @@ public class CodeRegionPipelining extends RestructuringStrategy {
ClavaNode firstStmt = dfg.getFirstStmt();
for (DataFlowParam param : dfg.getParams()) {
if (param.isArray() && !param.isStream()) {
+ int n = param.getMaxSize();
+ if (n > 1024) {
int factor = (param.getMaxSize() != 0) ? param.getMaxSize() / 4 : 2;
HLSArrayPartition directive = new HLSArrayPartition(PartitionType.CYCLIC, param.getName(), factor);
directive.setDim(param.getDim());
this.insertDirective(firstStmt, directive);
+ } else {
+ HLSArrayPartition directive = new HLSArrayPartition(PartitionType.COMPLETE, param.getName(), n);
+ directive.setDim(param.getDim());
+ this.insertDirective(firstStmt, directive);
+ }
}
}
