18926Sandreas.hansson@arm.com# Copyright (c) 2012 ARM Limited
28926Sandreas.hansson@arm.com# All rights reserved.
38926Sandreas.hansson@arm.com#
48926Sandreas.hansson@arm.com# The license below extends only to copyright in the software and shall
58926Sandreas.hansson@arm.com# not be construed as granting a license to any other intellectual
68926Sandreas.hansson@arm.com# property including but not limited to intellectual property relating
78926Sandreas.hansson@arm.com# to a hardware implementation of the functionality of the software
88926Sandreas.hansson@arm.com# licensed hereunder.  You may use the software subject to the license
98926Sandreas.hansson@arm.com# terms below provided that you ensure that this notice is replicated
108926Sandreas.hansson@arm.com# unmodified and in its entirety in all distributions of the software,
118926Sandreas.hansson@arm.com# modified or unmodified, in source code or in binary form.
128926Sandreas.hansson@arm.com#
134486Sbinkertn@umich.edu# Copyright (c) 2007 The Regents of The University of Michigan
144486Sbinkertn@umich.edu# All rights reserved.
154486Sbinkertn@umich.edu#
164486Sbinkertn@umich.edu# Redistribution and use in source and binary forms, with or without
174486Sbinkertn@umich.edu# modification, are permitted provided that the following conditions are
184486Sbinkertn@umich.edu# met: redistributions of source code must retain the above copyright
194486Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer;
204486Sbinkertn@umich.edu# redistributions in binary form must reproduce the above copyright
214486Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer in the
224486Sbinkertn@umich.edu# documentation and/or other materials provided with the distribution;
234486Sbinkertn@umich.edu# neither the name of the copyright holders nor the names of its
244486Sbinkertn@umich.edu# contributors may be used to endorse or promote products derived from
254486Sbinkertn@umich.edu# this software without specific prior written permission.
264486Sbinkertn@umich.edu#
274486Sbinkertn@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
284486Sbinkertn@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
294486Sbinkertn@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
304486Sbinkertn@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
314486Sbinkertn@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
324486Sbinkertn@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
334486Sbinkertn@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
344486Sbinkertn@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
354486Sbinkertn@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
364486Sbinkertn@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
374486Sbinkertn@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
384486Sbinkertn@umich.edu#
394486Sbinkertn@umich.edu# Authors: Nathan Binkert
404486Sbinkertn@umich.edu
414486Sbinkertn@umich.edufrom m5.params import *
4213665Sandreas.sandberg@arm.comfrom m5.objects.BaseSimpleCPU import BaseSimpleCPU
4313665Sandreas.sandberg@arm.comfrom m5.objects.SimPoint import SimPoint
444486Sbinkertn@umich.edu
455529Snate@binkert.orgclass AtomicSimpleCPU(BaseSimpleCPU):
469518SAndreas.Sandberg@ARM.com    """Simple CPU model executing a configurable number of
479518SAndreas.Sandberg@ARM.com    instructions per cycle. This model uses the simplified 'atomic'
489518SAndreas.Sandberg@ARM.com    memory mode."""
499518SAndreas.Sandberg@ARM.com
504486Sbinkertn@umich.edu    type = 'AtomicSimpleCPU'
519338SAndreas.Sandberg@arm.com    cxx_header = "cpu/simple/atomic.hh"
529518SAndreas.Sandberg@ARM.com
539518SAndreas.Sandberg@ARM.com    @classmethod
549518SAndreas.Sandberg@ARM.com    def memory_mode(cls):
559518SAndreas.Sandberg@ARM.com        return 'atomic'
569518SAndreas.Sandberg@ARM.com
579518SAndreas.Sandberg@ARM.com    @classmethod
589518SAndreas.Sandberg@ARM.com    def support_take_over(cls):
599518SAndreas.Sandberg@ARM.com        return True
609518SAndreas.Sandberg@ARM.com
614486Sbinkertn@umich.edu    width = Param.Int(1, "CPU width")
625487Snate@binkert.org    simulate_data_stalls = Param.Bool(False, "Simulate dcache stall cycles")
635487Snate@binkert.org    simulate_inst_stalls = Param.Bool(False, "Simulate icache stall cycles")
6410381Sdam.sunwoo@arm.com
6510381Sdam.sunwoo@arm.com    def addSimPointProbe(self, interval):
6610381Sdam.sunwoo@arm.com        simpoint = SimPoint()
6710381Sdam.sunwoo@arm.com        simpoint.interval = interval
6810381Sdam.sunwoo@arm.com        self.probeListener = simpoint
69