MemTest.py revision 4893
111986Sandreas.sandberg@arm.com# Copyright (c) 2005-2007 The Regents of The University of Michigan 211986Sandreas.sandberg@arm.com# All rights reserved. 311986Sandreas.sandberg@arm.com# 411986Sandreas.sandberg@arm.com# Redistribution and use in source and binary forms, with or without 511986Sandreas.sandberg@arm.com# modification, are permitted provided that the following conditions are 611986Sandreas.sandberg@arm.com# met: redistributions of source code must retain the above copyright 711986Sandreas.sandberg@arm.com# notice, this list of conditions and the following disclaimer; 811986Sandreas.sandberg@arm.com# redistributions in binary form must reproduce the above copyright 911986Sandreas.sandberg@arm.com# notice, this list of conditions and the following disclaimer in the 1011986Sandreas.sandberg@arm.com# documentation and/or other materials provided with the distribution; 1111986Sandreas.sandberg@arm.com# neither the name of the copyright holders nor the names of its 1211986Sandreas.sandberg@arm.com# contributors may be used to endorse or promote products derived from 1311986Sandreas.sandberg@arm.com# this software without specific prior written permission. 1411986Sandreas.sandberg@arm.com# 1511986Sandreas.sandberg@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1611986Sandreas.sandberg@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1711986Sandreas.sandberg@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1811986Sandreas.sandberg@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1911986Sandreas.sandberg@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2011986Sandreas.sandberg@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2111986Sandreas.sandberg@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2211986Sandreas.sandberg@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2311986Sandreas.sandberg@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2411986Sandreas.sandberg@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2511986Sandreas.sandberg@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2611986Sandreas.sandberg@arm.com# 2711986Sandreas.sandberg@arm.com# Authors: Nathan Binkert 2811986Sandreas.sandberg@arm.com 2911986Sandreas.sandberg@arm.comfrom m5.SimObject import SimObject 3011986Sandreas.sandberg@arm.comfrom m5.params import * 3111986Sandreas.sandberg@arm.comfrom m5.proxy import * 3211986Sandreas.sandberg@arm.comfrom m5 import build_env 3311986Sandreas.sandberg@arm.com 3411986Sandreas.sandberg@arm.comclass MemTest(SimObject): 3511986Sandreas.sandberg@arm.com type = 'MemTest' 3611986Sandreas.sandberg@arm.com max_loads = Param.Counter(0, "number of loads to execute") 3711986Sandreas.sandberg@arm.com atomic = Param.Bool(False, "Execute tester in atomic mode? (or timing)\n") 3811986Sandreas.sandberg@arm.com memory_size = Param.Int(65536, "memory size") 3911986Sandreas.sandberg@arm.com percent_dest_unaligned = Param.Percent(50, 4011986Sandreas.sandberg@arm.com "percent of copy dest address that are unaligned") 4111986Sandreas.sandberg@arm.com percent_reads = Param.Percent(65, "target read percentage") 4211986Sandreas.sandberg@arm.com percent_source_unaligned = Param.Percent(50, 4311986Sandreas.sandberg@arm.com "percent of copy source address that are unaligned") 4411986Sandreas.sandberg@arm.com percent_functional = Param.Percent(50, "percent of access that are functional") 4511986Sandreas.sandberg@arm.com percent_uncacheable = Param.Percent(10, 4611986Sandreas.sandberg@arm.com "target uncacheable percentage") 4711986Sandreas.sandberg@arm.com progress_interval = Param.Counter(1000000, 4811986Sandreas.sandberg@arm.com "progress report interval (in accesses)") 4911986Sandreas.sandberg@arm.com trace_addr = Param.Addr(0, "address to trace") 5011986Sandreas.sandberg@arm.com 5111986Sandreas.sandberg@arm.com test = Port("Port to the memory system to test") 5211986Sandreas.sandberg@arm.com functional = Port("Port to the functional memory used for verification") 5311986Sandreas.sandberg@arm.com