Closed andathan closed 4 years ago
Post of code causing this behavior would be appreciated. Thank you.
I am attaching the code in txt format. The same code produces correct results on MARS (correct = sorted array).
Disclaimer: The code origins from here. I just did the modifications described above.
quicksort.txt Thank you
Problem Solved after putting some NOP commands after all branch commands (j, jr, jal, beq, bne etc). Probably the simulator loaded the next command after the jump (in the delay slot) before executing it, thus changing the result of the program.
Hello, i have found online on github two different codes about quicksort. I tried to test them on QtMips so I removed any incompatible syscalls, i placed the .data section under the .text section and I converted any pseudoinstructions. In both cases, the program (after these modifications) runs correctly on others simulators (for example MARS). However when I run them on QtMips it just gets in a non-ending loop of swapping number x with y and then y with x. Since the code is correct (because it runs on other simulators) what am I doing wrong?I have tried many different setups (cache/pipeline etc).
Are all MIPS instructions implemented with the same way as in other simulators? Are jumps (recursion) allowed?