From e2a899ee078baa9c882e760efb69b7c0d5afb39a Mon Sep 17 00:00:00 2001 From: bpervan Date: Sun, 22 Oct 2023 22:47:48 +0200 Subject: [PATCH] 2D Loop transfer codegen (proto, unfinished) --- .../GAP8/Compilation/AcceleratorCodeGenerator.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/scala/shine/GAP8/Compilation/AcceleratorCodeGenerator.scala b/src/main/scala/shine/GAP8/Compilation/AcceleratorCodeGenerator.scala index 389300559..cdecea538 100644 --- a/src/main/scala/shine/GAP8/Compilation/AcceleratorCodeGenerator.scala +++ b/src/main/scala/shine/GAP8/Compilation/AcceleratorCodeGenerator.scala @@ -223,6 +223,18 @@ class AcceleratorCodeGenerator(override val decls: C.Compilation.CodeGenerator.D offsetX: Int, offsetY: Int): Stmt = { val firstVar = freshName("dma2d_") val secondVar = freshName("dma2d_") + + /*C.AST.FunDecl( + name="ex_mapfor", + returnType = C.AST.Type.void, + params = Seq( + C.AST.ParamDecl("output", C.AST.PointerType(C.AST.Type.int)), + C.AST.ParamDecl("n446", C.AST.Type.int), + C.AST.ParamDecl("e447", C.AST.PointerType(C.AST.Type.int)) + ), + body = C.AST.Stmts(C.AST.Code("asdf"), C.AST.ForLoop(???, ???, ???, ???)) + )*/ + C.AST.ForLoop( init = C.AST.DeclStmt(C.AST.VarDecl(firstVar, C.AST.Type.int, None)), cond = C.AST.BinaryExpr(C.AST.Literal(firstVar), C.AST.BinaryOperator.<, C.AST.Literal(width.toString)),