MemTest.py revision 4486
18452Snate@binkert.org# Copyright (c) 2005-2007 The Regents of The University of Michigan 26501Snate@binkert.org# All rights reserved. 36501Snate@binkert.org# 46501Snate@binkert.org# Redistribution and use in source and binary forms, with or without 56501Snate@binkert.org# modification, are permitted provided that the following conditions are 66501Snate@binkert.org# met: redistributions of source code must retain the above copyright 76501Snate@binkert.org# notice, this list of conditions and the following disclaimer; 86501Snate@binkert.org# redistributions in binary form must reproduce the above copyright 96501Snate@binkert.org# notice, this list of conditions and the following disclaimer in the 106501Snate@binkert.org# documentation and/or other materials provided with the distribution; 116501Snate@binkert.org# neither the name of the copyright holders nor the names of its 126501Snate@binkert.org# contributors may be used to endorse or promote products derived from 136501Snate@binkert.org# this software without specific prior written permission. 146501Snate@binkert.org# 156501Snate@binkert.org# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 166501Snate@binkert.org# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 176501Snate@binkert.org# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 186501Snate@binkert.org# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 196501Snate@binkert.org# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 206501Snate@binkert.org# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 216501Snate@binkert.org# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 226501Snate@binkert.org# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 236501Snate@binkert.org# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 246501Snate@binkert.org# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 256501Snate@binkert.org# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 266501Snate@binkert.org# 278452Snate@binkert.org# Authors: Nathan Binkert 286501Snate@binkert.org 298452Snate@binkert.orgfrom m5.SimObject import SimObject 308452Snate@binkert.orgfrom m5.params import * 316501Snate@binkert.orgfrom m5.proxy import * 328452Snate@binkert.orgfrom m5 import build_env 336501Snate@binkert.org 348452Snate@binkert.orgclass MemTest(SimObject): 356501Snate@binkert.org type = 'MemTest' 366501Snate@binkert.org max_loads = Param.Counter("number of loads to execute") 378452Snate@binkert.org atomic = Param.Bool(False, "Execute tester in atomic mode? (or timing)\n") 388452Snate@binkert.org memory_size = Param.Int(65536, "memory size") 398452Snate@binkert.org percent_dest_unaligned = Param.Percent(50, 4013663Sandreas.sandberg@arm.com "percent of copy dest address that are unaligned") 418452Snate@binkert.org percent_reads = Param.Percent(65, "target read percentage") 426501Snate@binkert.org percent_source_unaligned = Param.Percent(50, 438452Snate@binkert.org "percent of copy source address that are unaligned") 448452Snate@binkert.org percent_functional = Param.Percent(50, "percent of access that are functional") 4513663Sandreas.sandberg@arm.com percent_uncacheable = Param.Percent(10, 466501Snate@binkert.org "target uncacheable percentage") 478452Snate@binkert.org progress_interval = Param.Counter(1000000, 488452Snate@binkert.org "progress report interval (in accesses)") 498452Snate@binkert.org trace_addr = Param.Addr(0, "address to trace") 5013663Sandreas.sandberg@arm.com 518452Snate@binkert.org test = Port("Port to the memory system to test") 528452Snate@binkert.org functional = Port("Port to the functional memory used for verification") 536501Snate@binkert.org