-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathD.C
More file actions
84 lines (75 loc) · 1.65 KB
/
D.C
File metadata and controls
84 lines (75 loc) · 1.65 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
78
79
80
81
82
83
84
#include <iostream>
#include <iomanip>
#include <cstdint>
#include <cstddef>
#include "Instructions.h"
#include "RegisterFile.h"
#include "PipeReg.h"
#include "PipeRegField.h"
#include "D.h"
#include "Status.h"
/*
* D constructor
*
* initialize the D pipeline register
*/
D::D()
{
stat = new PipeRegField(SAOK);
icode = new PipeRegField(INOP);
ifun = new PipeRegField(FNONE);
rA = new PipeRegField(RNONE);
rB = new PipeRegField(RNONE);
valC = new PipeRegField();
valP = new PipeRegField();
}
/* return the stat pipeline register */
PipeRegField * D::getstat()
{
return stat;
}
/* return the icode pipeline register */
PipeRegField * D::geticode()
{
return icode;
}
/* return the ifun pipeline register */
PipeRegField * D::getifun()
{
return ifun;
}
/* return the rA pipeline register */
PipeRegField * D::getrA()
{
return rA;
}
/* return the rB pipeline register */
PipeRegField * D::getrB()
{
return rB;
}
/* return the valC pipeline register */
PipeRegField * D::getvalC()
{
return valC;
}
/* return the valP pipeline register */
PipeRegField * D::getvalP()
{
return valP;
}
/*
* dump
*
* outputs the current values of the D pipeline register
*/
void D::dump()
{
dumpField("D: stat: ", 1, stat->getOutput(), false);
dumpField(" icode: ", 1, icode->getOutput(), false);
dumpField(" ifun: ", 1, ifun->getOutput(), false);
dumpField(" rA: ", 1, rA->getOutput(), false);
dumpField(" rB: ", 1, rB->getOutput(), false);
dumpField(" valC: ", 16, valC->getOutput(), false);
dumpField(" valP: ", 3, valP->getOutput(), true);
}