// // This file is part of Nolimips, a MIPS simulator with unlimited registers // Copyright (C) 2003, 2004 Benoit Perrot // // Nolimips is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // Nolimips is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #include "common.hh" #include "vm/virtual_machine.hh" #include "parse-tasks.hh" #include "vm-tasks.hh" // Vm module related tasks' implementation. namespace vm { namespace tasks { void execute () { vm::VirtualMachine vm(check_callee_save_p, trace_exec_p); vm.load_program(* parse::tasks::program); if (exit_status != exit_success) exit(exit_status); vm.execute(); if (profile_p) { std::cerr << "Number of cycles: " << vm.get_cp0().get_count() << std::endl << "Number of executed R-type CPU instructions: " << vm.get_cpu().get_instruction_counter(inst::Inst::r_type) << std::endl << "Number of executed I-type CPU instructions: " << vm.get_cpu().get_instruction_counter(inst::Inst::i_type) << std::endl << "Number of executed J-type CPU instructions: " << vm.get_cpu().get_instruction_counter(inst::Inst::j_type) << std::endl; } // FIXME: Quick and dirty, this should not be done here delete parse::tasks::program; parse::tasks::program = 0; } } // namespace tasks } // namespace vm