當前位置: 首頁>>代碼示例>>Python>>正文


Python common.Options類代碼示例

本文整理匯總了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)
開發者ID:MortezaRamezani,項目名稱:gem5,代碼行數:10,代碼來源:sw.py

示例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
開發者ID:duanqz,項目名稱:systemimgpack,代碼行數:11,代碼來源:zipformatter.py

示例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)
開發者ID:powerjg,項目名稱:gem5,代碼行數:47,代碼來源:base_config.py

示例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")
開發者ID:pranith,項目名稱:gem5,代碼行數:31,代碼來源:ruby_gpu_random_test.py

示例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()

開發者ID:Starstok,項目名稱:systemimgpack,代碼行數:29,代碼來源:otanormalize.py

示例6: port

 def port(self):
     """abstracts the port of the dialog"""
     try:
         return int(self.url.partition(':')[2])
     except ValueError:
         return Options.defaultPort()
開發者ID:ospalh,項目名稱:kajongg-fork,代碼行數:6,代碼來源:login.py

示例7: main

def main():
    Options.setCommandLineOptions()
    if Options.CPROFILING:
        cProfile.run("run(sys.argv[1:])", sort=1)
    else:
        run(sys.argv[1:])
開發者ID:gsdlab,項目名稱:ClaferSMT,代碼行數:6,代碼來源:ClaferRun.py


注:本文中的common.Options類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。