MemTest.py revision 13892
12141SN/A# Copyright (c) 2015 ARM Limited
21376SN/A# All rights reserved.
31376SN/A#
41376SN/A# The license below extends only to copyright in the software and shall
51376SN/A# not be construed as granting a license to any other intellectual
61376SN/A# property including but not limited to intellectual property relating
71376SN/A# to a hardware implementation of the functionality of the software
81376SN/A# licensed hereunder.  You may use the software subject to the license
91376SN/A# terms below provided that you ensure that this notice is replicated
101376SN/A# unmodified and in its entirety in all distributions of the software,
111376SN/A# modified or unmodified, in source code or in binary form.
121376SN/A#
131376SN/A# Copyright (c) 2005-2007 The Regents of The University of Michigan
141376SN/A# All rights reserved.
151376SN/A#
161376SN/A# Redistribution and use in source and binary forms, with or without
171376SN/A# modification, are permitted provided that the following conditions are
181376SN/A# met: redistributions of source code must retain the above copyright
191376SN/A# notice, this list of conditions and the following disclaimer;
201376SN/A# redistributions in binary form must reproduce the above copyright
211376SN/A# notice, this list of conditions and the following disclaimer in the
221376SN/A# documentation and/or other materials provided with the distribution;
231376SN/A# neither the name of the copyright holders nor the names of its
241376SN/A# contributors may be used to endorse or promote products derived from
251376SN/A# this software without specific prior written permission.
261376SN/A#
271376SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
281376SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
291428SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
301428SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
315467Snate@binkert.org# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
325467Snate@binkert.org# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
331881SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
341881SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
351881SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
361881SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
371881SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
385467Snate@binkert.org#
391881SN/A# Authors: Nathan Binkert
401881SN/A#          Andreas Hansson
411881SN/Afrom m5.params import *
421881SN/Afrom m5.proxy import *
431881SN/A
445467Snate@binkert.orgfrom m5.objects.ClockedObject import ClockedObject
455467Snate@binkert.org
465467Snate@binkert.orgclass MemTest(ClockedObject):
475467Snate@binkert.org    type = 'MemTest'
485467Snate@binkert.org    cxx_header = "cpu/testers/memtest/memtest.hh"
491881SN/A
501881SN/A    # Interval of packet injection, the size of the memory range
511881SN/A    # touched, and an optional stop condition
521881SN/A    interval = Param.Cycles(1, "Interval between request packets")
531881SN/A    size = Param.Unsigned(65536, "Size of memory region to use (bytes)")
541881SN/A    max_loads = Param.Counter(0, "Number of loads to execute before exiting")
551881SN/A
561881SN/A    # Control the mix of packets and if functional accesses are part of
571881SN/A    # the mix or not
585467Snate@binkert.org    percent_reads = Param.Percent(65, "Percentage reads")
595467Snate@binkert.org    percent_functional = Param.Percent(50, "Percentage functional accesses")
605467Snate@binkert.org    percent_uncacheable = Param.Percent(10, "Percentage uncacheable")
615467Snate@binkert.org
625467Snate@binkert.org    # Determine how often to print progress messages and what timeout
631881SN/A    # to use for checking progress of both requests and responses
641881SN/A    progress_interval = Param.Counter(1000000,
655467Snate@binkert.org        "Progress report interval (in accesses)")
665467Snate@binkert.org    progress_check = Param.Cycles(5000000, "Cycles before exiting " \
675467Snate@binkert.org                                      "due to lack of progress")
685467Snate@binkert.org
695467Snate@binkert.org    port = MasterPort("Port to the memory system")
705467Snate@binkert.org    system = Param.System(Parent.any, "System this tester is part of")
715467Snate@binkert.org
725467Snate@binkert.org    # Add the ability to supress error responses on functional
735467Snate@binkert.org    # accesses as Ruby needs this
745467Snate@binkert.org    suppress_func_warnings = Param.Bool(False, "Suppress warnings when "\
755467Snate@binkert.org                                            "functional accesses fail.")
765467Snate@binkert.org