//Repeat this for each convolution layer
Accel = Accelerator( X, Y, Fx, Fy, C, K, N)
//load in hardware configure data
Accel.LoadAccConfig(path_to_config_file)
//The auto mapper of Accel determines the default folding/ replication/ flattening factors for X, Y, Fx, Fy, C, K, N
Param = Accel.getParameter()
Param.add_param({"X","Y"}:"F", 5)//take F out of X*Y. X and Y are both not fully flattened in PE level, so we can perform more flattening in PE Array level
PEMapping = PE(Step:(Param["Fx"], Param["Fx"]), Logic:("Fx","F"), tight=false, implementation = some function pointer) //tight=false allow perform multiplexing inside PE
Accel.SetPEArrayMapping(H:"Fy", W:"Y", PE: PEMapping)
//User can also set the factor by them self, but Accel has embeded checker to determine whether the factors are valid or not, i.e. following the hardware configuration and folding/ replication/ flattening rules.
Accel.Height.SetFactors("X":{"t":2, "r":2}, "C":{"f":3})
Accel.PE.SetFactors("Y":{"t":5,"r":2})
//Show the unrolling/tiling/flatten strategy with nested loops.
//one can image eventually something like this is displayed
InPELogic(weight, input){
output[1:X-Fx+1] = accumulate( SeqConv1D(w([1:Fx], input[1:X]) )
//we an also do ParConv1D, which creates multiple PEs.
//generate some mapping strategy as shown in Eyeriss paper.
Accel.visualize("out.png")