-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathline.cpp
More file actions
34 lines (26 loc) · 1.3 KB
/
Copy pathline.cpp
File metadata and controls
34 lines (26 loc) · 1.3 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
/**********************************************************************
*
* PA CWK2
* Ewan Leaver s0800696
* Line Class File
*
**********************************************************************/
#include "line.h"
using namespace std;
Line::Line (int lineSize) {
// Initialisation of line
size = lineSize; // Initialise line size
accesses.resize(size); // Array to record which processors have accessed each mem address within the line
// Available states: -2 = unused, -1 = invalid, 0 = shared, 1 = modified
state = -2;
// Values for 'modified': -1 = invalid, 0 = P0, 1 = P1, 2 = P2, 3 = P3
modified = -1;
accState = -1; // 0 = private, 1 = shared read-only, 2 = shared read-write
noAccesses = 0; // Number of times line has been accessed
}
void Line::setState(int s) {
state = s;
}
int Line::getState() {
return state;
}