URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 1530 to Rev 1531
- ↔ Reverse comparison
Rev 1530 → Rev 1531
/trunk/or1ksim/cpu/or1k/sprs.c
54,7 → 54,6
{ |
uorreg_t prev_val; |
|
regno %= MAX_SPRS; |
prev_val = cpu_state.sprs[regno]; |
cpu_state.sprs[regno] = value; |
|
204,24 → 203,24
uorreg_t mfspr(const uint16_t regno) |
{ |
extern oraddr_t pcprev; |
uorreg_t ret; |
|
ret = cpu_state.sprs[regno]; |
|
switch (regno) { |
case SPR_NPC: |
return cpu_state.pc; |
ret = cpu_state.pc; |
case SPR_PPC: |
return pcprev; |
ret = pcprev; |
case SPR_TTCR: |
return spr_read_ttcr(); |
ret = spr_read_ttcr(); |
default: |
/* Links to GPRS */ |
if(regno >= 0x0400 && regno < 0x0420) |
return cpu_state.reg[regno - 0x0400]; |
else if (regno < MAX_SPRS) |
return cpu_state.sprs[regno]; |
ret = cpu_state.reg[regno - 0x0400]; |
} |
if (config.sim.verbose) |
PRINTF ("WARNING: read out of SPR range %08X\n", regno); |
return 0; |
|
return ret; |
} |
|
/* Show status of important SPRs. */ |