fs.py (3180:664fe611de8e) | fs.py (3183:bd8f3870620f) |
---|---|
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>") |
|
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: --- 44 unchanged lines hidden (view full) --- 110 cpu.connectMemPorts(root.system.membus) 111 cpu.mem = root.system.physmem 112else: 113 print "Error I don't know how to create more than 2 systems." 114 sys.exit(1) 115 116m5.instantiate(root) 117 | 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: --- 44 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 |
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 |
|
118if options.maxtick: 119 maxtick = options.maxtick 120elif options.maxtime: 121 simtime = int(options.maxtime * root.clock.value) 122 print "simulating for: ", simtime 123 maxtick = simtime 124else: 125 maxtick = -1 --- 15 unchanged lines hidden --- | 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 --- |