|
From: Stephen W. <st...@ic...> - 2008-04-22 23:20:57
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stephen Williams wrote: | Try modifying the vhtread_run() function in vthread.cc to include | a simple print after the call to the opcode, like this: | | ~ bool rc = (cp->opcode)(thr, cp); | ~ cerr << "thr pc=" << thr->pc << " bit4=" << thr->bits4 << endl; OK, I'm seeing something interesting. The second %addi is not working. Judging by the symptoms, it appears to be reading a 32'd0 from the thread where it should be reading a 32'd1. ~ %load/v 12, v0xa0296d8_0, 4; "small1" pc=0x84469e0 bit4=64'b000000000000000000000000000000010001111111111111_0001_0001X010ZX10 ~ %mov 32, 12, 4; pc=0x84469f0 bit4=64'b0000000000000000000000000000_0001_0001111111111111_0001_0001X010ZX10 ~ %mov 36, 0, 28; pc=0x8446a00 bit4=64'b_0000000000000000000000000000_0001000111111111111100010001X010ZX10 ~ %addi 32, 1, 32; pc=0x8446a10 bit4=64'b_00000000000000000000000000000001_000111111111111100010001X010ZX10 The 32'd1 stays 32'd1 in the thread, and hence the loop. We need to look more carefully at the of_ADDI instruction. The most likely problem is the vector_to_array() call returning a wrong value. Then we need to look closely at the lvb array that is made up by from the immediate data. This is probably OK if the first %addi created an addition. Then we also need to look at the final result that is lva. That is probably OK (given the initial lva and lvb) because the thread got modified with the correct result after the first %addi. Can you put a test print in of_ADDI that prints lva[0] and lvb[0] right before the "for" loop in the of_ADDI instruction? I'm going to best that lva!=0 and lva[1]==0 every time through the of_ADDI instruction. - -- Steve Williams "The woods are lovely, dark and deep. steve at icarus.com But I have promises to keep, http://www.icarus.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep." -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFIDnLcrPt1Sc2b3ikRArjLAJ9rU6RGHgcIpw8QHoeraH3pUaBLewCfda1E DgNvhyHBwnRWwmyvtPd2kg4= =SHQK -----END PGP SIGNATURE----- |