Meatboy 106 has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53524 )

Change subject: mem-ruby: 0B/s andwidth parameters convert to inf tick/B
......................................................................

mem-ruby: 0B/s andwidth parameters convert to inf tick/B

Such parameter value was previously converted to 0 tick/B making the bandwidth parameter value 0 B/s compare greater than non-null bandwidth parameter value in C++.

Change-Id: I94c2d23199f2679eec8d355e89819a51338d5655
---
M src/python/m5/params.py
1 file changed, 14 insertions(+), 4 deletions(-)



diff --git a/src/python/m5/params.py b/src/python/m5/params.py
index af87044..e9d581b 100644
--- a/src/python/m5/params.py
+++ b/src/python/m5/params.py
@@ -1778,8 +1778,8 @@
         return value

     def getValue(self):
-        # convert to seconds per byte
-        value = 8.0 / float(self)
+        # convert to seconds per bit
+        value = 8.0 / value if value > 0 else float('inf')
         # convert to ticks per byte
         value = ticks.fromSecondsToFloatTick(value)
         return value
@@ -1816,8 +1816,7 @@
     def getValue(self):
         # convert to seconds per byte
         value = float(self)
-        if value:
-            value = 1.0 / float(self)
+        value = 1.0 / value if value > 0 else float('inf')
         # convert to ticks per byte
         value = ticks.fromSecondsToFloatTick(value)
         return value

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53524
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I94c2d23199f2679eec8d355e89819a51338d5655
Gerrit-Change-Number: 53524
Gerrit-PatchSet: 1
Gerrit-Owner: Meatboy 106 <garbage2collec...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to