projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df1ea2c
)
Fix bounds check for the cwp
author
Gabe Black
<gblack@eecs.umich.edu>
Sun, 11 Mar 2007 00:29:31 +0000
(19:29 -0500)
committer
Gabe Black
<gblack@eecs.umich.edu>
Sun, 11 Mar 2007 00:29:31 +0000
(19:29 -0500)
--HG--
extra : convert_revision :
097e6b0c80d71417329b2a4cd118046aa5ed777a
src/arch/sparc/miscregfile.cc
patch
|
blob
|
history
diff --git
a/src/arch/sparc/miscregfile.cc
b/src/arch/sparc/miscregfile.cc
index 20bc4ae5dddcb4d64e58c7bf747229e4f162c50e..ac30afde98eb8344797c55513a20909ebbcfd01b 100644
(file)
--- a/
src/arch/sparc/miscregfile.cc
+++ b/
src/arch/sparc/miscregfile.cc
@@
-654,7
+654,12
@@
void MiscRegFile::setReg(int miscReg,
#endif
return;
case MISCREG_CWP:
- new_val = val > NWindows ? NWindows - 1 : val;
+ new_val = val >= NWindows ? NWindows - 1 : val;
+ if (val >= NWindows) {
+ new_val = NWindows - 1;
+ warn("Attempted to set the CWP to %d with NWindows = %d\n",
+ val, NWindows);
+ }
tc->changeRegFileContext(CONTEXT_CWP, new_val);
break;
case MISCREG_GL: