本文整理汇总了Python中common.Options类的典型用法代码示例。如果您正苦于以下问题:Python Options类的具体用法?Python Options怎么用?Python Options使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Options类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
def main():
# Add options
parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addFSOptions(parser)
(options, args) = parser.parse_args()
system = build_switch(options)
root = Root(full_system = True, system = system)
Simulation.run(options, root, None, None)
示例2: genOptions
def genOptions(inZip):
""" Generate options.
Only format framework.
"""
options = Options()
options.inZip = inZip
options.outZip = inZip + ".std.zip"
options.formatFrw = True
return options
示例3: init_system
def init_system(self, system):
"""Initialize a system.
Arguments:
system -- System to initialize.
"""
self.create_clk_src(system)
system.cpu = self.create_cpus(system.cpu_clk_domain)
if _have_kvm_support and \
any([isinstance(c, BaseKvmCPU) for c in system.cpu]):
self.init_kvm(system)
if self.use_ruby:
# Add the ruby specific and protocol specific options
parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Ruby.define_options(parser)
(options, args) = parser.parse_args()
# Set the default cache size and associativity to be very
# small to encourage races between requests and writebacks.
options.l1d_size="32kB"
options.l1i_size="32kB"
options.l2_size="4MB"
options.l1d_assoc=4
options.l1i_assoc=2
options.l2_assoc=8
options.num_cpus = self.num_cpus
options.num_dirs = 2
bootmem = getattr(system, 'bootmem', None)
Ruby.create_system(options, True, system, system.iobus,
system._dma_ports, bootmem)
# Create a seperate clock domain for Ruby
system.ruby.clk_domain = SrcClockDomain(
clock = options.ruby_clock,
voltage_domain = system.voltage_domain)
for i, cpu in enumerate(system.cpu):
if not cpu.switched_out:
cpu.createInterruptController()
cpu.connectCachedPorts(system.ruby._cpu_ports[i])
else:
sha_bus = self.create_caches_shared(system)
for cpu in system.cpu:
self.init_cpu(system, cpu, sha_bus)
示例4: addToPath
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys
addToPath('../')
from common import Options
from ruby import Ruby
# Get paths we might need.
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(config_root)
parser = optparse.OptionParser()
Options.addNoISAOptions(parser)
parser.add_option("--maxloads", metavar="N", default=100,
help="Stop after N loads")
parser.add_option("-f", "--wakeup_freq", metavar="N", default=10,
help="Wakeup every N cycles")
parser.add_option("-u", "--num-compute-units", type="int", default=1,
help="number of compute units in the GPU")
parser.add_option("--num-cp", type="int", default=0,
help="Number of GPU Command Processors (CP)")
# not super important now, but to avoid putting the number 4 everywhere, make
# it an option/knob
parser.add_option("--cu-per-sqc", type="int", default=4, help="number of CUs \
sharing an SQC (icache, and thus icache TLB)")
parser.add_option("--simds-per-cu", type="int", default=4, help="SIMD units" \
"per CU")
示例5: Options
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
__author__ = '[email protected]'
from os import sys
from common import Options, Log
from zipformatter import ZipFormatter
# Global
TAG="reverse-oatnormalize"
OPTIONS = Options()
if __name__ == "__main__":
Log.DEBUG = True
OPTIONS.handle(sys.argv)
ZipFormatter.create(OPTIONS).format()
示例6: port
def port(self):
"""abstracts the port of the dialog"""
try:
return int(self.url.partition(':')[2])
except ValueError:
return Options.defaultPort()
示例7: main
def main():
Options.setCommandLineOptions()
if Options.CPROFILING:
cProfile.run("run(sys.argv[1:])", sort=1)
else:
run(sys.argv[1:])