-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpu.h
More file actions
39 lines (35 loc) · 846 Bytes
/
cpu.h
File metadata and controls
39 lines (35 loc) · 846 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
#ifndef CPU_H
#define CPU_H
#include <QVector>
#include <functional>
#include "instruction.h"
#include "memory.h"
#include "registerfile.h"
#include "controlunit.h"
class CPU{
Memory mem;
RegisterFile RegFile;
QVector<Instruction> IMem;
ControlUnit CU;
int BranchStallFlag;
int nCycles;
int nStages;
int tempPC;
void Fetch();
void Read();
void Execute();
void Mem();
void WriteBack();
public:
CPU();
CPU(const CPU&);
CPU& operator=(const CPU&);
void SetVector(const QVector<Instruction>&);
void getContext(QVector<int>&, QVector<int>&,
QVector<int>&, QVector<int>&, QVector<int>&, QVector<int>&,
int&, int&, bool&, bool&);
bool isValidPC();
void reset();
bool Step(); //Returns Branch\Stall mask
};
#endif // CPU_H