MemTest.py revision 4486
15331Sgblack@eecs.umich.edu# Copyright (c) 2005-2007 The Regents of The University of Michigan
25331Sgblack@eecs.umich.edu# All rights reserved.
35331Sgblack@eecs.umich.edu#
45331Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
55331Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are
65331Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright
75331Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer;
85331Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright
95331Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the
105331Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution;
115331Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its
125331Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from
135331Sgblack@eecs.umich.edu# this software without specific prior written permission.
145331Sgblack@eecs.umich.edu#
155331Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
165331Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
175331Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
185331Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
195331Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
205331Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
215331Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
225331Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
235331Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
245331Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
255331Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
265331Sgblack@eecs.umich.edu#
275331Sgblack@eecs.umich.edu# Authors: Nathan Binkert
285331Sgblack@eecs.umich.edu
295331Sgblack@eecs.umich.edufrom m5.SimObject import SimObject
304276Sgblack@eecs.umich.edufrom m5.params import *
314276Sgblack@eecs.umich.edufrom m5.proxy import *
324276Sgblack@eecs.umich.edufrom m5 import build_env
334276Sgblack@eecs.umich.edu
344276Sgblack@eecs.umich.educlass MemTest(SimObject):
354276Sgblack@eecs.umich.edu    type = 'MemTest'
364276Sgblack@eecs.umich.edu    max_loads = Param.Counter("number of loads to execute")
374276Sgblack@eecs.umich.edu    atomic = Param.Bool(False, "Execute tester in atomic mode? (or timing)\n")
384276Sgblack@eecs.umich.edu    memory_size = Param.Int(65536, "memory size")
394276Sgblack@eecs.umich.edu    percent_dest_unaligned = Param.Percent(50,
404276Sgblack@eecs.umich.edu        "percent of copy dest address that are unaligned")
414276Sgblack@eecs.umich.edu    percent_reads = Param.Percent(65, "target read percentage")
424276Sgblack@eecs.umich.edu    percent_source_unaligned = Param.Percent(50,
434276Sgblack@eecs.umich.edu        "percent of copy source address that are unaligned")
444276Sgblack@eecs.umich.edu    percent_functional = Param.Percent(50, "percent of access that are functional")
454276Sgblack@eecs.umich.edu    percent_uncacheable = Param.Percent(10,
464276Sgblack@eecs.umich.edu        "target uncacheable percentage")
474276Sgblack@eecs.umich.edu    progress_interval = Param.Counter(1000000,
484276Sgblack@eecs.umich.edu        "progress report interval (in accesses)")
494276Sgblack@eecs.umich.edu    trace_addr = Param.Addr(0, "address to trace")
504276Sgblack@eecs.umich.edu
514276Sgblack@eecs.umich.edu    test = Port("Port to the memory system to test")
524276Sgblack@eecs.umich.edu    functional = Port("Port to the functional memory used for verification")
534276Sgblack@eecs.umich.edu