-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-hotspot.py
60 lines (43 loc) · 1.46 KB
/
test-hotspot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import sys
#sys.path.append('../HotSpot-5.02')
#import hotspot
from m5mbridge import getController
from m5mbridge.factory import createMachine, fixArgs
from m5mbridge.entry import initM5MBridge, dump
from m5.stats import StatsDumpSimulator
from m5.patsim import PatEventSimulator
from m5mbridge.controller.playback import simplePlaybackDevice, timeAccuratePlaybackDevice
from m5mbridge.machine import options
# C
args = ['--config_fn', '../gem5/m5out/config.ini', '--debug=controller-']
opts = options.parse(fixArgs(args))
initM5MBridge(args)
controller = getController()
spd = simplePlaybackDevice('../gem5/m5out/events.log.gz', options=opts)
for (e,m) in spd:
print "Unpickling, ", e
controller.machine = m
controller.stateModified(e)
exit(137)
stats = StatsDumpSimulator('stats.txt')
stats = StatsDumpSimulator('stats.txt')
pat = PatEventSimulator('mcpat-test.log')
controller = getController()
stats.dumpOne()
from m5mbridge.machine import component
machine = controller.machine
print machine.tree
from m5mbridge.modules.m5.importer.generatecalcparts import addNewComponent
#addNewComponent(machine.tree, 'system', 'TEST', id=12, type='Bus', rw='yes')
cpu = machine.tree.children[0].children[0]
print "CPU-id: {0} name: {1}".format(cpu, cpu.name)
print machine.tree
stats.dumpOne()
pat.importPatData(controller)
# Give McPat time to compute machine
from time import sleep
sleep(60)
while stats.haveDump():
stats.dumpOne()
sleep(1)
controller.tick()