Simulator.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package compiler;
  2. /*
  3. Verificar operacao unaria negacao valor em laco
  4. * To change this license header, choose License Headers in Project Properties.
  5. * To change this template file, choose Tools | Templates
  6. * and open the template in the editor.
  7. */
  8. import java.util.logging.Level;
  9. import java.util.logging.Logger;
  10. import tools.mips.MipsSettings;
  11. /**
  12. *
  13. * @author Eugenio
  14. */
  15. public class Simulator {
  16. /**
  17. * @param args the command line arguments
  18. */
  19. public static void main(String[] args) throws Exception {
  20. try {
  21. MipsSettings settings = new tools.mips.MipsSettings() {
  22. {
  23. // Não executar passo a passo
  24. // Set("step.by.step", "true");
  25. Set("step.by.step", "false");
  26. // Necessario para poder usar os breakpoints
  27. // Set("mode", "debug");
  28. // Determina os pontos de para no codigo alvo
  29. Set("breakpoints", "25c,260");
  30. // Set("breakpoints", "f4");
  31. // Set("breakpoints", "94-9c");
  32. // Set("breakpoints", "1d8,214,2e0,28c,2f0,250,330");
  33. // Set("breakpoints", "1d8,214,250,28c,2dc,2e0,2d8,2f0,300,314,324,350,35c");
  34. // Set("breakpoints", "2e8-350,35c");
  35. // Set("breakpoints", "314,35c");
  36. // Set("breakpoints", "350,35c");
  37. // Caminho do arquivo de memoria de instrucoes
  38. Set("memory.instruction", "\\src\\tools\\mips\\memory\\mi.memory");
  39. // Tamanho da memorua de instrucoes 16 kb
  40. Set("memory.instruction.size", 16 * 1024);
  41. // Caminho do arquivo de memoria de dados
  42. Set("memory.data", "\\src\\tools\\mips\\memory\\md.memory");
  43. // Tamanho da memorua de dados 16 kb
  44. Set("memory.data.size", 16 * 1024);
  45. Set("memory.data.reset", "true");
  46. }
  47. };
  48. // Instancia um simulador, executa e salva a memoria
  49. new tools.mips.MipsProcessor(settings)
  50. .Run()
  51. .Persist()
  52. .Report();
  53. } catch (Exception ex) {
  54. Logger.getLogger(Simulator.class.getName()).log(Level.SEVERE, null, ex);
  55. }
  56. }
  57. }