-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimulator.h
More file actions
45 lines (38 loc) · 1.02 KB
/
Copy pathSimulator.h
File metadata and controls
45 lines (38 loc) · 1.02 KB
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
45
#ifndef __SIMULATOR_H__
#define __SIMULATOR_H__
/*===================================
| INCLUDES |
====================================*/
#include "Global.h"
#include "Monitor.h"
#include "Memory.h"
/*===================================
| STRUCTS |
====================================*/
typedef struct {
int unsigned rt : 4;
int unsigned rs : 4;
int unsigned rd : 4;
int unsigned opcode : 8;
int unsigned imm : 20;
} CommandFormat;
typedef struct {
// Memories.
SimulatorFiles files;
SimulatorMemory mem;
SimulatorMonitor monitor;
SimulatorHardDisk hdsk;
Register regs [NUM_OF_REGISTERS];
IORegister io_regs[NUM_OF_IO_REGISTERS];
// Global variables.
int unsigned cycles;
ErrorCode status;
// Fetch-Decode-Execute variables.
MemoryWord lines[2];
CommandFormat command;
bool irq0;
bool irq1;
bool irq2;
bool isr_mode;
} Simulator;
#endif // __SIMULATOR_H__