MMIX Bug |
||
Content
|
MMIXware Versionmmix-20110831Bug ReportedInitial: 27/3/2012AuthorMartin RuckertDescriptionThe interval counter rI measures the elapsed time in clock cycles but is decremented in mmix-sim by 1 for each instruction. Further, the filter features of rU are not implemented in mmix-sim.Detailsmmix-doc specifies in section 40:The interval Counter rI decreases by 1 on every "clock pulse" of the MMIX processor.
mmix-doc specifies in section 50: ... The usage counter rU consists of three fields (up, um, uc), called the usage pattern up, the usage mask um, and the usage count uc. The most significant byte of rU is the usage pattern; the next most significant byte is the usage mask; and the remaining 48 bits are the usage count. Whenever an instruction whose OP ∧ um=up has been executed, the value of uc increases by 1 (mod 2 u48). This specification is implemented in mmix-pipe.
mmix-sim specifies in section 1: This is not in agreement with the specification of mmix-doc and creates a systematic difference between mmix-sim and mmix-pipe. While the simulated time measured in υ is available to the interactive user of mmix-sim by measn of the sclock variable, it is not available to the running program. The running program has access only to rI and rU. The usage counter correctly counts instructions but the filter mechanism is not implemented as specified. It can be used as a replacement for the present rI if the number of instructions is required. Without a correct implementation of rI, the running program can not accurately reflect on its running time. Proposed patchTwo patches effect the documentation.@@ -52,3 +52,3 @@ -$2^{32}$ for each~$\mu$ and 1~for each~$\upsilon$. But the interval -counter~rI decreases by~1 for each instruction, and the usage -counter~rU increases by~1 for each instruction. +$2^{32}$ for each~$\mu$ and 1~for each~$\upsilon$. The interval +counter~rI decreases by~1 for each~$\upsilon$, and the usage +count field of~rU may increase by~1~(mod~$2^{48}$) for each instruction. @@ -189 +189 @@ -cause a break in simulation after 250 instructions have been executed. +cause a break in simulation after $250\upsilon$ have elapsed.One patch is necessary to handle the extra two cycles of a bad guess. @@ -2114 +2115,5 @@ - else bad_guesses++, sclock.l+=2; /* penalty is $2\upsilon$ for bad guess */ + else { + bad_guesses++, sclock.l+=2; /* penalty is $2\upsilon$ for bad guess */ + if (g[rI].h==0 && g[rI].l<=2) tracing=breakpoint=true; + g[rI]=incr(g[rI],-2); + }And one patch fixes the code to update the clocks. The actual code is largely taken from mmix-pipe. @@ -2646,8 +2651,14 @@ @ DiscussionThe patch as given above is now part of the sources. |
Please help to keep this site up to date! If you want to point out important material or projects that are not listed here, if you find errors or want to suggest improvements, please send email to