URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 515 |
Rev 517 |
Line 119... |
Line 119... |
sprs[regno] = value;
|
sprs[regno] = value;
|
else if (config.sim.verbose)
|
else if (config.sim.verbose)
|
printf("WARNING: write out of SPR range %08X\n", regno);
|
printf("WARNING: write out of SPR range %08X\n", regno);
|
}
|
}
|
|
|
|
#if 0
|
/* Get a specific SPR. */
|
/* Get a specific SPR. */
|
inline sprword
|
inline sprword
|
mfspr_(const int regno)
|
mfspr_(const int regno)
|
{
|
{
|
extern unsigned long reg[32];
|
extern unsigned long reg[32];
|
extern unsigned long pc;
|
extern unsigned long pc;
|
extern unsigned long pcprev;
|
extern unsigned long pcprev;
|
|
|
switch (regno) {
|
switch (regno) {
|
|
case SPR_SR:
|
|
/* Exceptions are always enabled */
|
|
return sprs[regno] | SPR_SR_EXR;
|
case SPR_NPC:
|
case SPR_NPC:
|
return pc;
|
return pc;
|
case SPR_PPC:
|
case SPR_PPC:
|
return pcprev;
|
return pcprev;
|
case SPR_SR:
|
|
/* Exceptions are always enabled */
|
|
return sprs[regno] | SPR_SR_EXR;
|
|
|
|
|
|
default:
|
default:
|
/* Links to GPRS */
|
/* Links to GPRS */
|
if(regno >= 0x0400 && regno < 0x0420)
|
if(regno >= 0x0400 && regno < 0x0420)
|
return reg[regno - 0x0400];
|
return reg[regno - 0x0400];
|
}
|
else if (regno < MAX_SPRS)
|
if (regno < MAX_SPRS)
|
|
return sprs[regno];
|
return 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;
|
}
|
}
|
|
#endif
|
|
|
/* Set a specific bit from SPR. LSB in a word is numbered zero. */
|
/* Set a specific bit from SPR. LSB in a word is numbered zero. */
|
inline void
|
inline void
|
setsprbit(const int regno, const int bitnum, const unsigned long bitvalue)
|
setsprbit(const int regno, const int bitnum, const unsigned long bitvalue)
|
{
|
{
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.