sim: Add support for forking
[gem5.git] / src / python / m5 / ticks.py
index 91834c9c8809ee426b8346d0f4deddc6d8b06973..0d82f6edde5502b03ac06a30b6845eb3c58f953a 100644 (file)
@@ -27,6 +27,7 @@
 # Authors: Nathan Binkert
 
 import sys
+from m5.util import warn
 
 tps = 1.0e12         # default to 1 THz (1 Tick == 1 ps)
 tps_fixed = False    # once set to true, can't be changed
@@ -41,7 +42,7 @@ def fixGlobalFrequency():
         print "Global frequency set at %d ticks per second" % int(tps)
 
 def setGlobalFrequency(ticksPerSecond):
-    import convert
+    from m5.util import convert
 
     global tps, tps_fixed
 
@@ -81,8 +82,8 @@ def fromSeconds(value):
     int_value = int(round(value))
     err = (value - int_value) / value
     if err > frequency_tolerance:
-        print >>sys.stderr, "Warning: rounding error > tolerance"
-        print >>sys.stderr, "    %f rounded to %d" % (value, int_value)
+        warn("rounding error > tolerance\n    %f rounded to %d", value,
+            int_value)
     return int_value
 
 __all__ = [ 'setGlobalFrequency', 'fixGlobalFrequency', 'fromSeconds',