Andreas Sandberg has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/39376 )

Change subject: python: Fix incorrect anyToLatency conversion
......................................................................

python: Fix incorrect anyToLatency conversion

The anyToLatency conversion function incorrectly inverted values
without units.

Change-Id: Ife0aa6837bf7d830b9a3f2611c77f6501cfe19ab
Signed-off-by: Andreas Sandberg <andreas.sandb...@arm.com>
---
M src/python/m5/util/convert.py
1 file changed, 4 insertions(+), 4 deletions(-)



diff --git a/src/python/m5/util/convert.py b/src/python/m5/util/convert.py
index 73335e6..4dab2e6 100644
--- a/src/python/m5/util/convert.py
+++ b/src/python/m5/util/convert.py
@@ -156,13 +156,13 @@
 def anyToLatency(value):
     """result is a clock period"""
     try:
-        return 1 / toFrequency(value)
-    except (ValueError, ZeroDivisionError):
+        return toLatency(value)
+    except ValueError:
         pass

     try:
-        return toLatency(value)
-    except ValueError:
+        return 1 / toFrequency(value)
+    except (ValueError, ZeroDivisionError):
         pass

     raise ValueError("cannot convert '%s' to clock period" % value)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/39376
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: Ife0aa6837bf7d830b9a3f2611c77f6501cfe19ab
Gerrit-Change-Number: 39376
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <andreas.sandb...@arm.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