projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f050ebe
)
python: added __nonzero__ function to SimObject Bool params
author
Brad Beckmann
<Brad.Beckmann@amd.com>
Fri, 6 Apr 2012 20:47:07 +0000
(13:47 -0700)
committer
Brad Beckmann
<Brad.Beckmann@amd.com>
Fri, 6 Apr 2012 20:47:07 +0000
(13:47 -0700)
src/python/m5/params.py
patch
|
blob
|
history
diff --git
a/src/python/m5/params.py
b/src/python/m5/params.py
index 84af269f091182b6cb10a03c1414e6e4f6e2eff4..f5af3a14b7c7da0260f4a79c1b42576ed63a0b30 100644
(file)
--- a/
src/python/m5/params.py
+++ b/
src/python/m5/params.py
@@
-639,6
+639,11
@@
class Bool(ParamValue):
def __str__(self):
return str(self.value)
+ # implement truth value testing for Bool parameters so that these params
+ # evaluate correctly during the python configuration phase
+ def __nonzero__(self):
+ return bool(self.value)
+
def ini_str(self):
if self.value:
return 'true'