fs.py (3183:bd8f3870620f) fs.py (3223:a2b6fa575c05)
1# Copyright (c) 2006 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

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

50 dest="benchmark",
51 help="Specify the benchmark to run. Available benchmarks: %s"\
52 % DefinedBenchmarks)
53parser.add_option("--etherdump", action="store", type="string", dest="etherdump",
54 help="Specify the filename to dump a pcap capture of the" \
55 "ethernet traffic")
56parser.add_option("--checkpoint_dir", action="store", type="string",
57 help="Place all checkpoints in this absolute directory")
1# Copyright (c) 2006 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

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

50 dest="benchmark",
51 help="Specify the benchmark to run. Available benchmarks: %s"\
52 % DefinedBenchmarks)
53parser.add_option("--etherdump", action="store", type="string", dest="etherdump",
54 help="Specify the filename to dump a pcap capture of the" \
55 "ethernet traffic")
56parser.add_option("--checkpoint_dir", action="store", type="string",
57 help="Place all checkpoints in this absolute directory")
58parser.add_option("-c", "--checkpoint", action="store", type="int",
59 help="restore from checkpoint <N>")
60
61(options, args) = parser.parse_args()
62
63if args:
64 print "Error: script doesn't take any positional arguments"
65 sys.exit(1)
66
67if options.detailed:
58
59(options, args) = parser.parse_args()
60
61if args:
62 print "Error: script doesn't take any positional arguments"
63 sys.exit(1)
64
65if options.detailed:
68 cpu = DetailedO3CPU()
69 cpu2 = DetailedO3CPU()
66 cpu = DerivO3CPU()
67 cpu2 = DerivO3CPU()
70 mem_mode = 'timing'
71elif options.timing:
72 cpu = TimingSimpleCPU()
73 cpu2 = TimingSimpleCPU()
74 mem_mode = 'timing'
75else:
76 cpu = AtomicSimpleCPU()
77 cpu2 = AtomicSimpleCPU()
78 mem_mode = 'atomic'
79
80cpu.clock = '2GHz'
81cpu2.clock = '2GHz'
68 mem_mode = 'timing'
69elif options.timing:
70 cpu = TimingSimpleCPU()
71 cpu2 = TimingSimpleCPU()
72 mem_mode = 'timing'
73else:
74 cpu = AtomicSimpleCPU()
75 cpu2 = AtomicSimpleCPU()
76 mem_mode = 'atomic'
77
78cpu.clock = '2GHz'
79cpu2.clock = '2GHz'
82cpu.cpu_id = 0
83cpu2.cpu_id = 0
84
85if options.benchmark:
86 if options.benchmark not in Benchmarks:
87 print "Error benchmark %s has not been defined." % options.benchmark
88 print "Valid benchmarks are: %s" % DefinedBenchmarks
89 sys.exit(1)
90
91 bm = Benchmarks[options.benchmark]

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

112 cpu.connectMemPorts(root.system.membus)
113 cpu.mem = root.system.physmem
114else:
115 print "Error I don't know how to create more than 2 systems."
116 sys.exit(1)
117
118m5.instantiate(root)
119
80
81if options.benchmark:
82 if options.benchmark not in Benchmarks:
83 print "Error benchmark %s has not been defined." % options.benchmark
84 print "Valid benchmarks are: %s" % DefinedBenchmarks
85 sys.exit(1)
86
87 bm = Benchmarks[options.benchmark]

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

108 cpu.connectMemPorts(root.system.membus)
109 cpu.mem = root.system.physmem
110else:
111 print "Error I don't know how to create more than 2 systems."
112 sys.exit(1)
113
114m5.instantiate(root)
115
120if options.checkpoint:
121 from os.path import isdir
122 from os import listdir, getcwd
123 import re
124 if options.checkpoint_dir:
125 cptdir = options.checkpoint_dir
126 else:
127 cptdir = getcwd()
128
129 if not isdir(cptdir):
130 m5.panic("checkpoint dir %s does not exist!" % cptdir)
131
132 dirs = listdir(cptdir)
133 expr = re.compile('cpt.([0-9]*)')
134 cpts = []
135 for dir in dirs:
136 match = expr.match(dir)
137 if match:
138 cpts.append(match.group(1))
139
140 if options.checkpoint > len(cpts):
141 m5.panic('Checkpoint %d not found' % options.checkpoint)
142
143 m5.restoreCheckpoint(root, "/".join([cptdir, "cpt.%s" % cpts[options.checkpoint - 1]]))
144
145if options.maxtick:
146 maxtick = options.maxtick
147elif options.maxtime:
148 simtime = int(options.maxtime * root.clock.value)
149 print "simulating for: ", simtime
150 maxtick = simtime
151else:
152 maxtick = -1

--- 15 unchanged lines hidden ---
116if options.maxtick:
117 maxtick = options.maxtick
118elif options.maxtime:
119 simtime = int(options.maxtime * root.clock.value)
120 print "simulating for: ", simtime
121 maxtick = simtime
122else:
123 maxtick = -1

--- 15 unchanged lines hidden ---