URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 1354 |
Rev 1432 |
Line 37... |
Line 37... |
/* Ugly, but fast */
|
/* Ugly, but fast */
|
/* Get a specific SPR. */
|
/* Get a specific SPR. */
|
static inline sprword
|
static inline sprword
|
mfspr_(const uint16_t regno)
|
mfspr_(const uint16_t regno)
|
{
|
{
|
extern uorreg_t reg[32];
|
|
extern oraddr_t pcprev;
|
extern oraddr_t pcprev;
|
extern sprword sprs[MAX_SPRS];
|
|
|
|
switch (regno) {
|
switch (regno) {
|
case SPR_NPC:
|
case SPR_NPC:
|
return pc;
|
return cpu_state.pc;
|
case SPR_PPC:
|
case SPR_PPC:
|
return pcprev;
|
return pcprev;
|
case SPR_TTCR:
|
case SPR_TTCR:
|
return spr_read_ttcr();
|
return spr_read_ttcr();
|
default:
|
default:
|
/* Links to GPRS */
|
/* Links to GPRS */
|
if(regno >= 0x0400 && regno < 0x0420)
|
if(regno >= 0x0400 && regno < 0x0420)
|
return reg[regno - 0x0400];
|
return cpu_state.reg[regno - 0x0400];
|
else if (regno < MAX_SPRS)
|
else if (regno < MAX_SPRS)
|
return sprs[regno];
|
return cpu_state.sprs[regno];
|
}
|
}
|
if (config.sim.verbose)
|
if (config.sim.verbose)
|
PRINTF ("WARNING: read out of SPR range %08X\n", regno);
|
PRINTF ("WARNING: read out of SPR range %08X\n", regno);
|
return 0;
|
return 0;
|
}
|
}
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.