Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Honored Contributor I
714 Views

eret does not update registers properly.

Hi, 

 

I'm using Shadow Registers with VIC on NIOS II f core. I am trying to use shadow registers both for interrupts and non-interrupt threads. I have 5 interrupts and 64 shadow registers enabled in my system. 

 

When my system takes an interrupt, the shadow register set gets activated and using an eret after processing the interrupt works fine. 

 

The problem occurs when I'm in a shadow register set that's not associated with interrupt and I try to return to base register set (reg. set 0) as described in "Changing Register Sets" section on processor handbook. As recommended, I am loading r30 (since I'm in shadow register) with desired CRS and executing eret. This returns the control to the address specified in ea register and updates the status register but no other register is modified/restored. This is causing stack corruption since sp isn't getting updated either.  

 

Am I missing something? Any pointers are appreciated. 

 

Thanks! 

 

[Update] It looks like this problem occurs only when trying to jump to base register set (reg. set 0 in my case) from a shadow register. Does this need to be treated as a special case?
0 Kudos
0 Replies