Examples of CodeRegion


Examples of avrora.core.isdl.CodeRegion

        Iterator i = b.getInstrIterator();
        int curPC = addr;
        while (i.hasNext()) {
            Instr instr = (Instr)i.next();
            wcet += instr.getCycles();
            CodeRegion r = CodeMap.getCodeForInstr(curPC, instr);
            curPC += instr.getSize();
            if (!i.hasNext()) { // is this the last instruction?
                // inject an assignment to nextPC
                stmts.add(new VarAssignStmt("nextPC", new Literal.IntExpr(curPC)));
                stmts.addAll(r.getCode());
                stmts.add(new VarAssignStmt("cyclesConsumed",
                        new Arith.BinOp.AddExpr(new VarExpr("cyclesConsumed"),
                                new Literal.IntExpr(wcet))));
            } else {
                stmts.addAll(r.getCode());
            }

        }

        // canonicalize the statement lists
View Full Code Here

Examples of avrora.core.isdl.CodeRegion

            list0.addLast(stmt);
            stmt = new DeclStmt("tmp_3", "byte", new CallExpr("low", tolist1(new VarExpr("tmp_2"))));
            list0.addLast(stmt);
            stmt = new MapAssignStmt("regs", new Literal.IntExpr(i.r1.getNumber()), new VarExpr("tmp_3"));
            list0.addLast(stmt);
            result = new CodeRegion(new LinkedList(), list0);
        }
View Full Code Here

Examples of avrora.core.isdl.CodeRegion

            LinkedList list0 = new LinkedList();
            stmt = new CommentStmt("===== " + i.getName() + ' ' + i.getOperands() + " ==========================================");
            list0.addLast(stmt);
            stmt = new MapAssignStmt("ioregs", new Literal.IntExpr(i.imm1), new MapExpr("regs", new Literal.IntExpr(i.r1.getNumber())));
            list0.addLast(stmt);
            result = new CodeRegion(new LinkedList(), list0);
        }
View Full Code Here

Examples of avrora.core.isdl.CodeRegion

            LinkedList list0 = new LinkedList();
            stmt = new CommentStmt("===== " + i.getName() + ' ' + i.getOperands() + " ==========================================");
            list0.addLast(stmt);
            stmt = new MapAssignStmt("regs", new Literal.IntExpr(i.r1.getNumber()), new CallExpr("popByte", new LinkedList()));
            list0.addLast(stmt);
            result = new CodeRegion(new LinkedList(), list0);
        }
View Full Code Here

Examples of avrora.core.isdl.CodeRegion

            LinkedList list0 = new LinkedList();
            stmt = new CommentStmt("===== " + i.getName() + ' ' + i.getOperands() + " ==========================================");
            list0.addLast(stmt);
            stmt = new CallStmt("pushByte", tolist1(new MapExpr("regs", new Literal.IntExpr(i.r1.getNumber()))));
            list0.addLast(stmt);
            result = new CodeRegion(new LinkedList(), list0);
        }
View Full Code Here

Examples of avrora.core.isdl.CodeRegion

            list0.addLast(stmt);
            stmt = new DeclStmt("tmp_2", "int", new Arith.BinOp.AddExpr(new Arith.BinOp.MulExpr(new VarExpr("tmp_1"), new Literal.IntExpr(2)), new Literal.IntExpr(nextPC)));
            list0.addLast(stmt);
            stmt = new VarAssignStmt("nextPC", new VarExpr("tmp_2"));
            list0.addLast(stmt);
            result = new CodeRegion(new LinkedList(), list0);
        }
View Full Code Here

Examples of avrora.core.isdl.CodeRegion

            list0.addLast(stmt);
            stmt = new DeclStmt("tmp_2", "int", new Arith.BinOp.MulExpr(new CallExpr("uword", tolist2(new VarExpr("tmp_1"), new VarExpr("tmp_0"))), new Literal.IntExpr(2)));
            list0.addLast(stmt);
            stmt = new VarAssignStmt("nextPC", new VarExpr("tmp_2"));
            list0.addLast(stmt);
            result = new CodeRegion(new LinkedList(), list0);
        }
View Full Code Here

Examples of avrora.core.isdl.CodeRegion

            list0.addLast(stmt);
            stmt = new CallStmt("enableInterrupts", new LinkedList());
            list0.addLast(stmt);
            stmt = new VarAssignStmt("justReturnedFromInterrupt", new Literal.BoolExpr(true));
            list0.addLast(stmt);
            result = new CodeRegion(new LinkedList(), list0);
        }
View Full Code Here

Examples of avrora.core.isdl.CodeRegion

            list0.addLast(stmt);
            stmt = new DeclStmt("tmp_1", "int", new Arith.BinOp.AddExpr(new Arith.BinOp.MulExpr(new VarExpr("tmp_0"), new Literal.IntExpr(2)), new Literal.IntExpr(nextPC)));
            list0.addLast(stmt);
            stmt = new VarAssignStmt("nextPC", new VarExpr("tmp_1"));
            list0.addLast(stmt);
            result = new CodeRegion(new LinkedList(), list0);
        }
View Full Code Here

Examples of avrora.core.isdl.CodeRegion

            list0.addLast(stmt);
            stmt = new DeclStmt("tmp_3", "byte", new CallExpr("low", tolist1(new VarExpr("tmp_2"))));
            list0.addLast(stmt);
            stmt = new MapAssignStmt("regs", new Literal.IntExpr(i.r1.getNumber()), new VarExpr("tmp_3"));
            list0.addLast(stmt);
            result = new CodeRegion(new LinkedList(), list0);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.