BaseKvmCPU.py revision 9651:f551c8ad12a5
112952Sgabeblack@google.com# Copyright (c) 2012 ARM Limited 212952Sgabeblack@google.com# All rights reserved. 312952Sgabeblack@google.com# 412952Sgabeblack@google.com# The license below extends only to copyright in the software and shall 512952Sgabeblack@google.com# not be construed as granting a license to any other intellectual 612952Sgabeblack@google.com# property including but not limited to intellectual property relating 712952Sgabeblack@google.com# to a hardware implementation of the functionality of the software 812952Sgabeblack@google.com# licensed hereunder. You may use the software subject to the license 912952Sgabeblack@google.com# terms below provided that you ensure that this notice is replicated 1012952Sgabeblack@google.com# unmodified and in its entirety in all distributions of the software, 1112952Sgabeblack@google.com# modified or unmodified, in source code or in binary form. 1212952Sgabeblack@google.com# 1312952Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without 1412952Sgabeblack@google.com# modification, are permitted provided that the following conditions are 1512952Sgabeblack@google.com# met: redistributions of source code must retain the above copyright 1612952Sgabeblack@google.com# notice, this list of conditions and the following disclaimer; 1712952Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright 1812952Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the 1912952Sgabeblack@google.com# documentation and/or other materials provided with the distribution; 2012952Sgabeblack@google.com# neither the name of the copyright holders nor the names of its 2112952Sgabeblack@google.com# contributors may be used to endorse or promote products derived from 2212952Sgabeblack@google.com# this software without specific prior written permission. 2312952Sgabeblack@google.com# 2412952Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2512952Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2612952Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2712952Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2812952Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2912952Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3012952Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3112957Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3212957Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3312957Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3412953Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3512998Sgabeblack@google.com# 3612998Sgabeblack@google.com# Authors: Andreas Sandberg 3712952Sgabeblack@google.com 3812952Sgabeblack@google.comfrom m5.params import * 3912952Sgabeblack@google.comfrom m5.proxy import * 4012952Sgabeblack@google.com 4112957Sgabeblack@google.comfrom BaseCPU import BaseCPU 4212962Sgabeblack@google.comfrom KvmVM import KvmVM 4312957Sgabeblack@google.com 4412962Sgabeblack@google.comclass BaseKvmCPU(BaseCPU): 4512962Sgabeblack@google.com type = 'BaseKvmCPU' 4612957Sgabeblack@google.com cxx_header = "cpu/kvm/base.hh" 4712957Sgabeblack@google.com abstract = True 4812957Sgabeblack@google.com 4912957Sgabeblack@google.com @classmethod 5012957Sgabeblack@google.com def export_method_cxx_predecls(cls, code): 5112962Sgabeblack@google.com code('#include "cpu/kvm/base.hh"') 5212962Sgabeblack@google.com 5312962Sgabeblack@google.com @classmethod 5412962Sgabeblack@google.com def export_methods(cls, code): 5512962Sgabeblack@google.com code(''' 5612962Sgabeblack@google.com void dump(); 5712962Sgabeblack@google.com''') 5812962Sgabeblack@google.com 5912957Sgabeblack@google.com @classmethod 6012957Sgabeblack@google.com def memory_mode(cls): 6112957Sgabeblack@google.com return 'atomic_noncaching' 6212957Sgabeblack@google.com 6312957Sgabeblack@google.com @classmethod 6412957Sgabeblack@google.com def require_caches(cls): 6512957Sgabeblack@google.com return False 6612957Sgabeblack@google.com 6712957Sgabeblack@google.com @classmethod 6812957Sgabeblack@google.com def support_take_over(cls): 6912957Sgabeblack@google.com return True 7012957Sgabeblack@google.com 7112957Sgabeblack@google.com kvmVM = Param.KvmVM(Parent.any, 'KVM VM (i.e., shared memory domain)') 7212957Sgabeblack@google.com hostFactor = Param.Float(1.0, "Cycle scale factor") 7312957Sgabeblack@google.com