ticks.py (9528:d05714c2ab9c) ticks.py (11802:be62996c95d1)
1# Copyright (c) 2007 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 20 unchanged lines hidden (view full) ---

29import sys
30from m5.util import warn
31
32tps = 1.0e12 # default to 1 THz (1 Tick == 1 ps)
33tps_fixed = False # once set to true, can't be changed
34
35# fix the global frequency and tell C++ about it
36def fixGlobalFrequency():
1# Copyright (c) 2007 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 20 unchanged lines hidden (view full) ---

29import sys
30from m5.util import warn
31
32tps = 1.0e12 # default to 1 THz (1 Tick == 1 ps)
33tps_fixed = False # once set to true, can't be changed
34
35# fix the global frequency and tell C++ about it
36def fixGlobalFrequency():
37 import internal
37 import _m5.core
38 global tps, tps_fixed
39 if not tps_fixed:
40 tps_fixed = True
38 global tps, tps_fixed
39 if not tps_fixed:
40 tps_fixed = True
41 internal.core.setClockFrequency(int(tps))
41 _m5.core.setClockFrequency(int(tps))
42 print "Global frequency set at %d ticks per second" % int(tps)
43
44def setGlobalFrequency(ticksPerSecond):
45 from m5.util import convert
46
47 global tps, tps_fixed
48
49 if tps_fixed:

--- 41 unchanged lines hidden ---
42 print "Global frequency set at %d ticks per second" % int(tps)
43
44def setGlobalFrequency(ticksPerSecond):
45 from m5.util import convert
46
47 global tps, tps_fixed
48
49 if tps_fixed:

--- 41 unchanged lines hidden ---