| 205 |
do_ADDR(); |
do_ADDR(); |
| 206 |
|
|
| 207 |
// turning off load stall |
// turning off load stall |
| 208 |
if (phase_stall[WB] == stall_load) |
if (phase_stall[WB] == stall_load){ |
| 209 |
phase_stall[WB] = stall_no; |
phase_stall[WB] = stall_no; |
| 210 |
|
#ifdef VMDEBUG |
| 211 |
|
cout.form("VM: turning off LOAD stall.\n"); |
| 212 |
|
#endif |
| 213 |
|
} |
| 214 |
|
|
| 215 |
// third phase of load stall |
// third phase of load stall |
| 216 |
if (phase_stall[MA] == stall_load){ |
if (phase_stall[MA] == stall_load){ |
| 217 |
phase_stall[MA] = stall_no; |
phase_stall[MA] = stall_no; |
| 218 |
|
|
| 219 |
phase_stall[WB] = stall_load; |
phase_stall[WB] = stall_load; |
| 220 |
|
#ifdef VMDEBUG |
| 221 |
|
cout.form("VM: third phase of LOAD stall.\n"); |
| 222 |
|
#endif |
| 223 |
} |
} |
| 224 |
|
|
| 225 |
// second phase of load stall |
// second phase of load stall |
| 228 |
phase_stall[ID] = stall_no; |
phase_stall[ID] = stall_no; |
| 229 |
|
|
| 230 |
phase_stall[MA] = stall_load; |
phase_stall[MA] = stall_load; |
| 231 |
|
#ifdef VMDEBUG |
| 232 |
|
cout.form("VM: second phase of LOAD stall.\n"); |
| 233 |
|
#endif |
| 234 |
} |
} |
| 235 |
|
|
| 236 |
// turning off jmpl stall |
// turning off jmpl stall |
| 237 |
if ( phase_stall[ID] == stall_jmpl ) |
if ( phase_stall[ID] == stall_jmpl ){ |
| 238 |
for( int i = ID ; i <= WB ; i++ ) |
for( int i = ID ; i <= WB ; i++ ) |
| 239 |
phase_stall[i] = stall_no; |
phase_stall[i] = stall_no; |
| 240 |
|
#ifdef VMDEBUG |
| 241 |
|
cout.form("VM: turning off JMPL stall.\n"); |
| 242 |
|
#endif |
| 243 |
|
} |
| 244 |
|
|
| 245 |
// second phase of jmpl stall |
// second phase of jmpl stall |
| 246 |
if (phase_stall[IF] == stall_jmpl){ |
if (phase_stall[IF] == stall_jmpl){ |
| 251 |
phase_stall[IF] = stall_no; |
phase_stall[IF] = stall_no; |
| 252 |
for( int i = ID ; i <= WB ; i++ ) |
for( int i = ID ; i <= WB ; i++ ) |
| 253 |
phase_stall[i] = stall_jmpl; |
phase_stall[i] = stall_jmpl; |
| 254 |
|
#ifdef VMDEBUG |
| 255 |
|
cout.form("VM: second phase of JMPL stall.\n"); |
| 256 |
|
#endif |
| 257 |
} |
} |
| 258 |
|
|
| 259 |
} |
} |
| 362 |
return; |
return; |
| 363 |
} |
} |
| 364 |
|
|
| 365 |
if ( phase_active[WB] && OP.is_arlog_src() && |
if ( phase_active[WB] && phase_stall[WB] == stall_no |
| 366 |
|
&& OP.is_arlog_src1() && |
| 367 |
(ppOP.is_arlog_dst() || ppOP.group==instr_word::load) && |
(ppOP.is_arlog_dst() || ppOP.group==instr_word::load) && |
| 368 |
OP.src1 != 0 && |
OP.src1 != 0 && |
| 369 |
Registers.real_regnum(pppsr.CWP, ppOP.dst) |
Registers.real_regnum(pppsr.CWP, ppOP.dst) |
| 370 |
== Registers.real_regnum(psr.CWP, OP.src1) ) |
== Registers.real_regnum(psr.CWP, OP.src1) ){ |
| 371 |
Mpx4.process( 3 ); |
Mpx4.process( 3 ); |
| 372 |
else if ( phase_active[MA] && OP.is_arlog_src() && |
#ifdef VMDEBUG |
| 373 |
|
cout.form("EX: far forward of first argument.\n"); |
| 374 |
|
#endif |
| 375 |
|
} else if ( phase_active[MA] && phase_stall[MA] == stall_no |
| 376 |
|
&& OP.is_arlog_src1() && |
| 377 |
pOP.is_arlog_dst() && OP.src1 != 0 && |
pOP.is_arlog_dst() && OP.src1 != 0 && |
| 378 |
Registers.real_regnum(ppsr.CWP, pOP.dst) |
Registers.real_regnum(ppsr.CWP, pOP.dst) |
| 379 |
== Registers.real_regnum(psr.CWP, OP.src1)) |
== Registers.real_regnum(psr.CWP, OP.src1)){ |
| 380 |
Mpx4.process( 1 ); |
Mpx4.process( 1 ); |
| 381 |
else if ( phase_active[MA] && OP.is_arlog_src() && |
#ifdef VMDEBUG |
| 382 |
|
cout.form("EX: near forward of first argument.\n"); |
| 383 |
|
#endif |
| 384 |
|
} else if ( phase_active[MA] && phase_stall[MA] == stall_no |
| 385 |
|
&& OP.is_arlog_src1() && |
| 386 |
pOP.group == instr_word::load && OP.src1 != 0 && |
pOP.group == instr_word::load && OP.src1 != 0 && |
| 387 |
Registers.real_regnum(ppsr.CWP, pOP.dst) |
Registers.real_regnum(ppsr.CWP, pOP.dst) |
| 388 |
== Registers.real_regnum(psr.CWP,OP.src1) ){ |
== Registers.real_regnum(psr.CWP,OP.src1) ){ |
| 389 |
phase_stall[IF] = stall_load; |
phase_stall[IF] = stall_load; |
| 390 |
phase_stall[ID] = stall_load; |
phase_stall[ID] = stall_load; |
| 391 |
|
#ifdef VMDEBUG |
| 392 |
|
cout.form("EX: starting LOAD stall [first argument].\n"); |
| 393 |
|
#endif |
| 394 |
} else |
} else |
| 395 |
Mpx4.process( 2 ); |
Mpx4.process( 2 ); |
| 396 |
|
|
| 397 |
if ( phase_active[WB] && OP.is_arlog_src() && |
if ( phase_active[WB] && phase_stall[WB] == stall_no && |
| 398 |
|
OP.is_arlog_src2() && |
| 399 |
(ppOP.is_arlog_dst() || ppOP.group==instr_word::load) && |
(ppOP.is_arlog_dst() || ppOP.group==instr_word::load) && |
| 400 |
OP.src2 != 0 && |
OP.src2 != 0 && |
| 401 |
Registers.real_regnum(pppsr.CWP, ppOP.dst) |
Registers.real_regnum(pppsr.CWP, ppOP.dst) |
| 402 |
== Registers.real_regnum(psr.CWP, OP.src2) ) |
== Registers.real_regnum(psr.CWP, OP.src2) ){ |
| 403 |
Mpx5.process( 3 ); |
Mpx5.process( 3 ); |
| 404 |
else if ( phase_active[MA] && OP.is_arlog_src() && |
#ifdef VMDEBUG |
| 405 |
|
cout.form("EX: near forward of second argument.\n"); |
| 406 |
|
#endif |
| 407 |
|
} else if ( phase_active[MA] && phase_stall[MA] == stall_no && |
| 408 |
|
OP.is_arlog_src2() && |
| 409 |
pOP.is_arlog_dst() && OP.src2 != 0 && |
pOP.is_arlog_dst() && OP.src2 != 0 && |
| 410 |
Registers.real_regnum(ppsr.CWP, pOP.dst) |
Registers.real_regnum(ppsr.CWP, pOP.dst) |
| 411 |
== Registers.real_regnum(psr.CWP, OP.src2)) |
== Registers.real_regnum(psr.CWP, OP.src2)){ |
| 412 |
Mpx5.process( 1 ); |
Mpx5.process( 1 ); |
| 413 |
else if ( phase_active[MA] && OP.is_arlog_src() && |
#ifdef VMDEBUG |
| 414 |
|
cout.form("EX: near forward of second argument.\n"); |
| 415 |
|
#endif |
| 416 |
|
} else if ( phase_active[MA] && phase_stall[MA] == stall_no && |
| 417 |
|
OP.is_arlog_src2() && |
| 418 |
pOP.group == instr_word::load && OP.src2 != 0 && |
pOP.group == instr_word::load && OP.src2 != 0 && |
| 419 |
Registers.real_regnum(ppsr.CWP, pOP.dst) |
Registers.real_regnum(ppsr.CWP, pOP.dst) |
| 420 |
== Registers.real_regnum(psr.CWP, OP.src2) ){ |
== Registers.real_regnum(psr.CWP, OP.src2) ){ |
| 421 |
phase_stall[IF] = stall_load; |
phase_stall[IF] = stall_load; |
| 422 |
phase_stall[ID] = stall_load; |
phase_stall[ID] = stall_load; |
| 423 |
|
#ifdef VMDEBUG |
| 424 |
|
cout.form("EX: starting LOAD stall [second argument].\n"); |
| 425 |
|
#endif |
| 426 |
} else |
} else |
| 427 |
Mpx5.process( 2 ); |
Mpx5.process( 2 ); |
| 428 |
|
|
| 429 |
if ( phase_active[WB] && OP.group == instr_word::store && |
if ( phase_active[WB] && phase_stall[WB] == stall_no |
| 430 |
|
&& OP.group == instr_word::store && |
| 431 |
(ppOP.is_arlog_dst() || ppOP.group==instr_word::load) && |
(ppOP.is_arlog_dst() || ppOP.group==instr_word::load) && |
| 432 |
OP.dst != 0 && |
OP.dst != 0 && |
| 433 |
Registers.real_regnum(pppsr.CWP, ppOP.dst) |
Registers.real_regnum(pppsr.CWP, ppOP.dst) |
| 434 |
== Registers.real_regnum(psr.CWP, OP.dst) ) |
== Registers.real_regnum(psr.CWP, OP.dst) ){ |
| 435 |
Mpx7.process( 2 ); |
Mpx7.process( 2 ); |
| 436 |
else |
#ifdef VMDEBUG |
| 437 |
|
cout.form("EX: far forward of destination [store].\n"); |
| 438 |
|
#endif |
| 439 |
|
} else |
| 440 |
Mpx7.process( 1 ); |
Mpx7.process( 1 ); |
| 441 |
|
|
| 442 |
if ( phase_stall[IF] == stall_load && phase_stall[ID] == stall_load ) |
if ( phase_stall[IF] == stall_load && phase_stall[ID] == stall_load ) |
| 463 |
if (OP.instr == instr_word::jmpl){ |
if (OP.instr == instr_word::jmpl){ |
| 464 |
Mpx2.set(2); |
Mpx2.set(2); |
| 465 |
phase_stall[IF] = stall_jmpl; |
phase_stall[IF] = stall_jmpl; |
| 466 |
|
#ifdef VMDEBUG |
| 467 |
|
cout.form("EX: starting JMPL stall.\n"); |
| 468 |
|
#endif |
| 469 |
} |
} |
| 470 |
|
|
| 471 |
if (OP.instr == instr_word::save) |
if (OP.instr == instr_word::save) |
| 491 |
return; |
return; |
| 492 |
} |
} |
| 493 |
|
|
| 494 |
if ( phase_active[WB] && pOP.group == instr_word::store && |
if ( phase_active[WB] && phase_stall[WB] == stall_no |
| 495 |
|
&& pOP.group == instr_word::store && |
| 496 |
(ppOP.is_arlog_dst() || ppOP.group==instr_word::load) && |
(ppOP.is_arlog_dst() || ppOP.group==instr_word::load) && |
| 497 |
pOP.dst != 0 && |
pOP.dst != 0 && |
| 498 |
Registers.real_regnum(pppsr.CWP, ppOP.dst) |
Registers.real_regnum(pppsr.CWP, ppOP.dst) |
| 499 |
== Registers.real_regnum(ppsr.CWP, pOP.dst) ) |
== Registers.real_regnum(ppsr.CWP, pOP.dst) ){ |
| 500 |
Mpx8.process( 2 ); |
Mpx8.process( 2 ); |
| 501 |
else |
#ifdef VMDEBUG |
| 502 |
|
cout.form("EX: near forward of destination [store].\n"); |
| 503 |
|
#endif |
| 504 |
|
} else |
| 505 |
Mpx8.process( 1 ); |
Mpx8.process( 1 ); |
| 506 |
|
|
| 507 |
if ( pOP.instr == instr_word::ld ) |
if ( pOP.instr == instr_word::ld ) |