-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyess.C
More file actions
44 lines (37 loc) · 981 Bytes
/
yess.C
File metadata and controls
44 lines (37 loc) · 981 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Driver for the yess simulator
* Usage: yess <file>.yo [-D]
*
* <file>.yo contains assembled y86-64 code.
* If the -D option is provided then debug is set to 1.
* The -D option can be used to turn on and turn off debugging print
* statements.
*/
#include <iostream>
#include <fstream>
#include <string.h>
#include "Debug.h"
#include "Memory.h"
#include "Loader.h"
#include "RegisterFile.h"
#include "ConditionCodes.h"
#include "PipeReg.h"
#include "Stage.h"
#include "Simulate.h"
int debug = 0;
int main(int argc, char * argv[])
{
//check to see if the -D option was provided
if (argc >= 3 && (strcmp(argv[2], "-D") == 0)) debug = 1;
Memory * mem = Memory::getInstance();
Loader load(argc, argv);
if (!load.isLoaded())
{
std::cout << "Load error.\nUsage: yess <file.yo>\n";
if (mem != NULL) mem->dump();
return 0;
}
Simulate simulate;
simulate.run();
return 0;
}