python: Fix unproxing of VectorParams
[gem5.git] / src / python / m5 / ticks.py
index 181a65eba68c7e7e01da9e499cbca805b83db87d..ce9459f2a98cea00d13bd3b2bce1c236960b4bb5 100644 (file)
 # 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
 
 # fix the global frequency and tell C++ about it
 def fixGlobalFrequency():
-    import internal
+    import _m5.core
     global tps, tps_fixed
     if not tps_fixed:
         tps_fixed = True
-        internal.core.setClockFrequency(int(tps))
+        _m5.core.setClockFrequency(int(tps))
         print "Global frequency set at %d ticks per second" % int(tps)
 
 def setGlobalFrequency(ticksPerSecond):
@@ -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',