OpenCores
Issue List
CALL SR bug #5
Closed olivier.girard opened this issue over 12 years ago
olivier.girard commented over 12 years ago

Based on the TI documentation when a 'call' instruction is executed 1st thing that happens is R1(stack pointer) decremented by 2. When using CALL in conjunction with the stack pointer, the current openmsp430 (svn 127 or earlier) is fetching the call address before the SR update.

For example the code: CALL 4(R1) will in execute: CALL 2(R1)

olivier.girard commented over 12 years ago

Bug fixed with SVN revision 129.

Note that beside PUSH and CALL, there are no other instructions modifying SR which can also use it as an argument.

olivier.girard closed this over 12 years ago
sjackson commented about 9 years ago

Olivier,

I went back and checked, we're on Rev 117 so it likely got fixed in a subsequent release(s). I talked to the other engineer that actually found the bug, but our memory was a bit foggy on the circumstances for failure and unfortunately I only left a short comment in the code where I fixed it in the execution unit.

wire 1:0 mb_wr_msk = inst_alu`EXEC_NO_WR | reg_pc_call ? 2'b00 : // saj added reg_pc_call to prevent mem writes

sjackson commented about 9 years ago

Disregard, got posted to wrong bug


Assignee
No one
Labels
Bug