Fix the python NetworkBandwidth conversion function
authorNathan Binkert <binkertn@umich.edu>
Wed, 6 Apr 2005 21:59:31 +0000 (17:59 -0400)
committerNathan Binkert <binkertn@umich.edu>
Wed, 6 Apr 2005 21:59:31 +0000 (17:59 -0400)
python/m5/convert.py:
    Fix the NetworkBandwidth conversion function

--HG--
extra : convert_revision : 93d9856fe6b59827c116e15835d2ef51292bd6c4

python/m5/convert.py

index 6ccefd2fc20d424c5236ee6d1d9c2344fa61ce0d..a89303687568736d47937ecee826601b37e45af4 100644 (file)
@@ -153,15 +153,15 @@ def toNetworkBandwidth(value):
         raise TypeError, "wrong type '%s' should be str" % type(value)
 
     if value.endswith('Tbps'):
-        return float(value[:-3]) * tera
+        return float(value[:-4]) * tera
     elif value.endswith('Gbps'):
-        return float(value[:-3]) * giga
+        return float(value[:-4]) * giga
     elif value.endswith('Mbps'):
-        return float(value[:-3]) * mega
+        return float(value[:-4]) * mega
     elif value.endswith('kbps'):
-        return float(value[:-3]) * kilo
+        return float(value[:-4]) * kilo
     elif value.endswith('bps'):
-        return float(value[:-2])
+        return float(value[:-3])
     else:
         return float(value)