lukem512 / risky-business

A simple simulator of a SuperScalar RISC machine.
https://lukemitchell.co/risky-business/
0 stars 0 forks source link

Tight loops can cause a problem with Rj and Rk arrays #30

Open lukem512 opened 8 years ago

lukem512 commented 8 years ago

If a loop body is tight and the number of Functional Units high, race conditions can prevent the loop from terminating.

LDC r3 0
LDC r4 1
printloop:
CMP r5 r3 r1
BGTEZ r5 halt
ADD r13 r0 r3
LDR r9 r13
PRNT r9
ADD r3 r3 r4
B printloop
halt:
HLT