protected void pauseMIPS() { if (mips != null) mips.stop(); }
public void updateInfos() { List<Reg> regs = mips.getRegs(); for (int i = 0; i < 32 && regs.get(i) != null; i++) { this.regs[i].setText(regs.get(i).getValue().toString()); } Integer pc = mips.getIFCircuit().getPC(); this.pc.setText(pc.toString()); Integer numcycles = mips.getCycles(); clkfield.setText(numcycles.toString()); Integer done = mips.getWBCircuit().countCompleteInstructions(); this.instcomp.setText(done.toString()); Float ratio = new Float(done) / new Float(numcycles); String ratiostr = ratio.toString(); if (ratiostr.length() > 4) ratiostr = ratiostr.substring(0, 4); this.prod.setText(ratiostr); List<Integer> mems = mips.getMEMCircuit().getLastPositions(); List<Integer> values = mips.getMEMCircuit().getLastValues(); for (int i = 0; i < mems.size(); i++) { memory[4 - i].setText("address: " + mems.get(i) + " value: " + values.get(i)); } instructions[0].setText(mips.getIFCircuit().getCurrentInstruction().getInstrucaoMIPS()); instructions[1].setText( ((Instrucao) mips.getIDCircuit().getFromInputBus("instrucao")).getInstrucaoMIPS()); instructions[2].setText( ((Instrucao) mips.getEXCircuit().getFromInputBus("instrucao")).getInstrucaoMIPS()); instructions[3].setText( ((Instrucao) mips.getMEMCircuit().getFromInputBus("instrucao")).getInstrucaoMIPS()); instructions[4].setText( ((Instrucao) mips.getWBCircuit().getFromInputBus("instrucao")).getInstrucaoMIPS()); }
protected void runMIPS() { runner.setRun(true); if (mips.isStopped()) mips.resume(); }