Package avrora.core

Examples of avrora.core.Instr$EOR


    private void printFullState(String head, StateCache.State s) {
        Terminal.print(head + ' ');
        StatePrinter.printStateName(s);
        Terminal.nextln();
        Instr instr = program.readInstr(s.getPC());
        String str = StringUtil.leftJustify(instr.toString(), 14);
        StatePrinter.printState(str, s);
    }
View Full Code Here


            Item i = head;
            head = head.next;

            pc = i.pc;
            state = i.state.dup();
            Instr instr = program.readInstr(i.pc);
            printItem(instr);
            int npc = program.getNextPC(i.pc);
            nextPC = npc;
            instr.accept(this);
            if ( nextPC >= 0 ) {
                String str = npc == nextPC ? "FALLTHROUGH" : "JUMP";
                addToWorkList(str, nextPC, state);

            }
View Full Code Here

    private int stepInstruction() {
        int cycles;
        // global probes?
        if ( globalProbe.isEmpty() ) {
            Instr i = shared_instr[nextPC];

            // visit the actual instruction (or probe)
            i.accept(this);
            // NOTE: commit() might be called twice, but this is ok
            cycles = cyclesConsumed;
            commit();
        } else {
            // get the current instruction
            int curPC = nextPC; // at this point pc == nextPC
            Instr i = shared_instr[nextPC];

            // visit the actual instruction (or probe)
            globalProbe.fireBefore(state, curPC);
            i.accept(this);
            cycles = cyclesConsumed;
            commit();
            globalProbe.fireAfter(state, curPC);
        }
        return cycles;
View Full Code Here

    }

    private void fastLoop() {
        innerLoop = true;
        while (innerLoop) {
            Instr i = shared_instr[nextPC];

            // visit the actual instruction (or probe)
            i.accept(this);
            // NOTE: commit() might be called twice, but this is ok
            commit();
        }
    }
View Full Code Here

    private void instrumentedLoop() {
        innerLoop = true;
        while (innerLoop) {
            // get the current instruction
            int curPC = nextPC; // at this point pc == nextPC
            Instr i = shared_instr[nextPC];

            // visit the actual instruction (or probe)
            globalProbe.fireBefore(state, curPC);
            i.accept(this);
            commit();
            globalProbe.fireAfter(state, curPC);
        }
    }
View Full Code Here

        LinkedList stmts = new LinkedList();
        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",
View Full Code Here

            stack[0] = "";

            Program p = s.getProgram();
            sm = p.getSourceMapping();
            for ( int pc = 0; pc < p.program_end; pc = p.getNextPC(pc)) {
                Instr i = p.readInstr(pc);
                if ( i != null ) {
                    if ( i instanceof Instr.CALL ) {
                        s.insertProbe(new CallProbe("CALL"), pc);
                    }
                    else if ( i instanceof Instr.ICALL ) {
View Full Code Here

        byte[] buf = new byte[fis.available()];
        int len = fis.read(buf);

        Disassembler da = new Disassembler();
        for ( int index = 0; index < len; ) {
            Instr i = da.disassemble(0, buf, index);
            Terminal.println(StringUtil.addrToString(index)+": "+hb(buf, index)+" "+hb(buf, index+1)+"        "+i.toString());
            index += i.getSize();
        }
    }
View Full Code Here

                policy.interrupt(state.copy(), 17 - cntr);
            }
        }

        int pc = state.getPC();
        Instr i = readInstr(pc);
        i.accept(this);

        if (state != null) {
            // if we didn't reach a dead end (e.g. a break instruction, return, etc)
            state.setPC(pc + i.getSize());
            policy.pushState(state);
        }
    }
View Full Code Here

    }

    private Instr readInstr(int pc) {
        if (pc >= program.program_end)
            throw Avrora.failure("PC beyond end of program: " + StringUtil.addrToString(pc));
        Instr i = program.readInstr(pc);
        if (i == null)
            throw Avrora.failure("Misaligned instruction access at PC: " + StringUtil.addrToString(pc));
        return i;
    }
View Full Code Here

TOP

Related Classes of avrora.core.Instr$EOR

Copyright © 2018 www.massapicom. 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.