URL
https://opencores.org/ocsvn/or1k/or1k/trunk
[/] [or1k/] [trunk/] [or1ksim/] [cpu/] [or1k/] [sprs.c] - Diff between revs 1550 and 1551
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 1550 |
Rev 1551 |
Line 201... |
Line 201... |
}
|
}
|
|
|
/* Get a specific SPR. */
|
/* Get a specific SPR. */
|
uorreg_t mfspr(const uint16_t regno)
|
uorreg_t mfspr(const uint16_t regno)
|
{
|
{
|
extern oraddr_t pcprev;
|
|
uorreg_t ret;
|
uorreg_t ret;
|
|
|
ret = cpu_state.sprs[regno];
|
ret = cpu_state.sprs[regno];
|
|
|
switch (regno) {
|
switch (regno) {
|
case SPR_NPC:
|
case SPR_NPC:
|
ret = cpu_state.pc;
|
ret = cpu_state.pc;
|
case SPR_PPC:
|
|
ret = pcprev;
|
|
case SPR_TTCR:
|
case SPR_TTCR:
|
ret = spr_read_ttcr();
|
ret = spr_read_ttcr();
|
default:
|
default:
|
/* Links to GPRS */
|
/* Links to GPRS */
|
if(regno >= 0x0400 && regno < 0x0420)
|
if(regno >= 0x0400 && regno < 0x0420)
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.