-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathW.C
More file actions
77 lines (68 loc) · 1.53 KB
/
W.C
File metadata and controls
77 lines (68 loc) · 1.53 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <iostream>
#include <iomanip>
#include <cstdint>
#include <cstddef>
#include "RegisterFile.h"
#include "Instructions.h"
#include "PipeRegField.h"
#include "PipeReg.h"
#include "W.h"
#include "Status.h"
/*
* W constructor
*
* initialize the W pipeline register
*/
W::W()
{
stat = new PipeRegField(SAOK);
icode = new PipeRegField(INOP);
valE = new PipeRegField();
valM = new PipeRegField();
dstE = new PipeRegField(RNONE);
dstM = new PipeRegField(RNONE);
}
/* return the stat pipeline register field */
PipeRegField * W::getstat()
{
return stat;
}
/* return the icode pipeline register field */
PipeRegField * W::geticode()
{
return icode;
}
/* return the valE pipeline register field */
PipeRegField * W::getvalE()
{
return valE;
}
/* return the valM pipeline register field */
PipeRegField * W::getvalM()
{
return valM;
}
/* return the dstE pipeline register field */
PipeRegField * W::getdstE()
{
return dstE;
}
/* return the dstM pipeline register field */
PipeRegField * W::getdstM()
{
return dstM;
}
/*
* dump
*
* outputs the current values of the W pipeline register
*/
void W:: dump()
{
dumpField("W: stat: ", 1, stat->getOutput(), false);
dumpField(" icode: ", 1, icode->getOutput(), false);
dumpField(" valE: ", 16, valE->getOutput(), false);
dumpField(" valM: ", 16, valM->getOutput(), false);
dumpField(" dstE: ", 1, dstE->getOutput(), false);
dumpField(" dstM: ", 1, dstM->getOutput(), true);
}