forked from Evensgn/MIPS-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
25 lines (23 loc) · 640 Bytes
/
main.cpp
File metadata and controls
25 lines (23 loc) · 640 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "mips_simulator.hpp"
#include "include_define.hpp"
using namespace std;
int main(int argc, char *argv[])
{
MIPS_Simulator::instance().SimulatorInit();
// read mips text from file *.s
ifstream sFile(argv[1]);
//ifstream sFile("function_test-huyuncong.s");
stringstream buffer;
buffer << sFile.rdbuf();
sFile.close();
string mipsSourceText = buffer.str();
#ifdef DEBUG_READ_TEXT
cout << mipsSourceText << endl;
#endif
MIPS_Simulator::instance().ProcessMIPSText(mipsSourceText);
MIPS_Simulator::instance().RunPipeline();
#ifdef DEBUG
cout << "\nDone." << endl;
#endif
return 0;
}