85 |
friend class processor; |
friend class processor; |
86 |
}; |
}; |
87 |
|
|
88 |
class processor { |
class vmachine { |
89 |
private: |
private: |
90 |
PSR psr; |
PSR psr; |
91 |
|
|
93 |
internal_reg nPC; |
internal_reg nPC; |
94 |
cache ICache; |
cache ICache; |
95 |
|
|
96 |
|
sum Add1; |
97 |
|
|
98 |
// phase 2. ID (instruction decode) |
// phase 2. ID (instruction decode) |
99 |
internal_reg PC, IR; |
internal_reg PC, IR; |
100 |
// Registers |
// Registers |
101 |
// const |
// const |
102 |
mplexer Mpx3; |
mplexer Mpx3; |
103 |
|
|
104 |
|
sum Add2; |
105 |
|
mplexer Mpx1; |
106 |
|
|
107 |
// phase 3. EX/AC (execution/address calculation) |
// phase 3. EX/AC (execution/address calculation) |
108 |
unsigned char OP; |
unsigned char OP; |
109 |
internal_reg pPC, A1, A2, R; |
internal_reg pPC, A1, A2, R; |
113 |
// shifter |
// shifter |
114 |
// ALU |
// ALU |
115 |
|
|
116 |
|
mplexer Mpx2; |
117 |
|
|
118 |
// phase 4. MA (memory access) |
// phase 4. MA (memory access) |
119 |
unsigned char pOP; |
unsigned char pOP; |
120 |
internal_reg T, pR; |
internal_reg T, pR; |
127 |
internal_reg pT, D; |
internal_reg pT, D; |
128 |
internal_reg ppDR; |
internal_reg ppDR; |
129 |
mplexer Mpx9; |
mplexer Mpx9; |
130 |
|
|
131 |
public: |
public: |
132 |
|
vmachine::vmachine( void ); |
133 |
}; |
}; |
134 |
|
|
135 |
|
|