Exemplo n.º 1
0
 public BlackboxIf(int cycleNumber, int programCounter) {
   super(cycleNumber, null);
   this.exMem = null;
   Data.setProgramCounter(programCounter);
   // this.programCounter = programCounter;
   this.nextProgramCounter = 0;
 }
Exemplo n.º 2
0
 public BlackboxIf(int cycleNumber, OpcodeHexBin instruction, int programCounter) {
   super(cycleNumber, instruction);
   this.exMem = null;
   Data.setProgramCounter(programCounter);
   // this.programCounter = programCounter;
   this.nextProgramCounter = 0;
 }
Exemplo n.º 3
0
 @Override
 public void run() {
   // IF/ID.IR <- MEM[PC]
   this.setInstruction(Data.getInstance().getMemoryCodeSegment(Data.getProgramCounter()));
   // IF/ID.NPC, PC <- if ((EX/MEM.opcode == branch) && EX/MEM.cond)
   //  					{ EX/MEM.ALUoutput }
   //				   else { PC + 4 }
   if (exMem != null
       && "BEQ"
           .contains(exMem.getInstruction().getInstruction().getInstruction().split(" ")[0].trim())
       && exMem.isCondition()) {
     this.nextProgramCounter = exMem.getArithmeticLogicUnit().intValue();
     Data.setProgramCounter(exMem.getArithmeticLogicUnit().intValue());
   } else {
     this.nextProgramCounter = Data.getProgramCounter() + 1;
     Data.setProgramCounter(this.nextProgramCounter);
   }
 }
Exemplo n.º 4
0
 public void setProgramCounter(int programCounter) {
   Data.setProgramCounter(programCounter);
 }
Exemplo n.º 5
0
 public BlackboxIf() {
   super();
   this.exMem = null;
   Data.setProgramCounter(0);
   this.nextProgramCounter = 0;
 }