40 |
c4.link(0, Add1, 0 ); |
c4.link(0, Add1, 0 ); |
41 |
Add1.link(0, Mpx1, 0 ); |
Add1.link(0, Mpx1, 0 ); |
42 |
|
|
43 |
ICache.link(1, IR, 0 ); |
ICache.link(0, IR, 0 ); |
44 |
|
|
45 |
|
|
46 |
// 2. phase ID |
// 2. phase ID |
94 |
T.link( 0 , Mpx4, 0 ); |
T.link( 0 , Mpx4, 0 ); |
95 |
T.link( 1 , Mpx5, 0 ); |
T.link( 1 , Mpx5, 0 ); |
96 |
T.link( 2, pT, 0 ); |
T.link( 2, pT, 0 ); |
97 |
T.link( 3 , DCache, 1 ); |
T.link( 3 , DCache, 0 ); |
98 |
|
|
99 |
pR.link( 0, Mpx8, 0 ); |
pR.link( 0, Mpx8, 0 ); |
100 |
|
|
101 |
pDR.link( 0, ppDR, 0 ); |
pDR.link( 0, ppDR, 0 ); |
102 |
|
|
103 |
Mpx8.link(0, DCache, 0 ); |
Mpx8.link(0, DCache, 1 ); |
104 |
|
|
105 |
DCache.link(0, ppDR, 0 ); |
DCache.link(0, ppDR, 0 ); |
106 |
|
|
114 |
Mpx9.link( 0, Registers, 1 ); |
Mpx9.link( 0, Registers, 1 ); |
115 |
Mpx9.link( 1, Mpx4, 2 ); |
Mpx9.link( 1, Mpx4, 2 ); |
116 |
Mpx9.link( 2, Mpx5, 2 ); |
Mpx9.link( 2, Mpx5, 2 ); |
117 |
Mpx7.link( 3, Mpx7, 1 ); |
Mpx9.link( 3, Mpx7, 1 ); |
118 |
Mpx9.link( 4, Mpx8, 1 ); |
Mpx9.link( 4, Mpx8, 1 ); |
119 |
|
|
120 |
} |
} |
155 |
void vmachine::do_IF( void ) |
void vmachine::do_IF( void ) |
156 |
{ |
{ |
157 |
nPC.pass_through(); |
nPC.pass_through(); |
158 |
ICache.process(); |
ICache.process(cache::rd, cache::word); |
159 |
|
|
160 |
PC.remember(); |
PC.remember(); |
161 |
IR.remember(); |
IR.remember(); |
277 |
|
|
278 |
if (OP.instr == instr_word::jmpl){ |
if (OP.instr == instr_word::jmpl){ |
279 |
Mpx2.set(2); |
Mpx2.set(2); |
280 |
/* FIXME: here should be stall!!! */ |
/* FIXME: stall */ |
281 |
} |
} |
282 |
|
|
283 |
if (OP.instr == instr_word::save) |
if (OP.instr == instr_word::save) |
306 |
else |
else |
307 |
Mpx8.process( 1 ); |
Mpx8.process( 1 ); |
308 |
|
|
309 |
if ( pOP.group == instr_word::load || pOP.group == instr_word::store ) |
if ( pOP.instr == instr_word::ld ) |
310 |
DCache.process(); |
DCache.process(cache::rd, cache::word); |
311 |
|
else if ( pOP.instr == instr_word::lduh ) |
312 |
|
DCache.process(cache::rd, cache::uhalf); |
313 |
|
else if ( pOP.instr == instr_word::ldsh ) |
314 |
|
DCache.process(cache::rd, cache::half); |
315 |
|
else if ( pOP.instr == instr_word::ldub ) |
316 |
|
DCache.process(cache::rd, cache::ubyte); |
317 |
|
else if ( pOP.instr == instr_word::ldsb ) |
318 |
|
DCache.process(cache::rd, cache::byte); |
319 |
|
else if ( pOP.instr == instr_word::st ) |
320 |
|
DCache.process(cache::wr, cache::word); |
321 |
|
else if ( pOP.instr == instr_word::sth ) |
322 |
|
DCache.process(cache::wr, cache::half); |
323 |
|
else if ( pOP.instr == instr_word::stb ) |
324 |
|
DCache.process(cache::wr, cache::byte); |
325 |
|
|
326 |
ppOP = pOP; |
ppOP = pOP; |
327 |
D.remember(); |
D.remember(); |