tgen-dram-ctrl.py revision 9728
17199Sgblack@eecs.umich.edu# Copyright (c) 2012 ARM Limited
27199Sgblack@eecs.umich.edu# All rights reserved.
37199Sgblack@eecs.umich.edu#
47199Sgblack@eecs.umich.edu# The license below extends only to copyright in the software and shall
57199Sgblack@eecs.umich.edu# not be construed as granting a license to any other intellectual
67199Sgblack@eecs.umich.edu# property including but not limited to intellectual property relating
77199Sgblack@eecs.umich.edu# to a hardware implementation of the functionality of the software
87199Sgblack@eecs.umich.edu# licensed hereunder.  You may use the software subject to the license
97199Sgblack@eecs.umich.edu# terms below provided that you ensure that this notice is replicated
107199Sgblack@eecs.umich.edu# unmodified and in its entirety in all distributions of the software,
117199Sgblack@eecs.umich.edu# modified or unmodified, in source code or in binary form.
127199Sgblack@eecs.umich.edu#
137199Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
147199Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are
157199Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright
167199Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer;
177199Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright
187199Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the
197199Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution;
207199Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its
217199Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from
227199Sgblack@eecs.umich.edu# this software without specific prior written permission.
237199Sgblack@eecs.umich.edu#
247199Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
257199Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
267199Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
277199Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
287199Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
297199Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
307199Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
317199Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
327199Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
337199Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
347199Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
357199Sgblack@eecs.umich.edu#
367199Sgblack@eecs.umich.edu# Authors: Andreas Hansson
377199Sgblack@eecs.umich.edu
387199Sgblack@eecs.umich.eduimport m5
397199Sgblack@eecs.umich.edufrom m5.objects import *
407199Sgblack@eecs.umich.edu
417199Sgblack@eecs.umich.edu# both traffic generator and communication monitor are only available
427199Sgblack@eecs.umich.edu# if we have protobuf support, so potentially skip this test
437199Sgblack@eecs.umich.edurequire_sim_object("TrafficGen")
447199Sgblack@eecs.umich.edurequire_sim_object("CommMonitor")
457199Sgblack@eecs.umich.edu
467199Sgblack@eecs.umich.edu# even if this is only a traffic generator, call it cpu to make sure
477199Sgblack@eecs.umich.edu# the scripts are happy
487199Sgblack@eecs.umich.educpu = TrafficGen(config_file = "tests/quick/se/70.tgen/tgen-simple-dram.cfg")
497199Sgblack@eecs.umich.edu
507199Sgblack@eecs.umich.edu# system simulated
517199Sgblack@eecs.umich.edusystem = System(cpu = cpu, physmem = DDR3_1600_x64(),
527199Sgblack@eecs.umich.edu                membus = NoncoherentBus(clock="1GHz", width = 16))
537199Sgblack@eecs.umich.edu
547199Sgblack@eecs.umich.edu# add a communication monitor
557199Sgblack@eecs.umich.edusystem.monitor = CommMonitor()
567199Sgblack@eecs.umich.edu
577199Sgblack@eecs.umich.edu# connect the traffic generator to the bus via a communication monitor
587202Sgblack@eecs.umich.edusystem.cpu.port = system.monitor.slave
597202Sgblack@eecs.umich.edusystem.monitor.master = system.membus.slave
607202Sgblack@eecs.umich.edu
617202Sgblack@eecs.umich.edu# connect the system port even if it is not used in this example
627202Sgblack@eecs.umich.edusystem.system_port = system.membus.slave
637202Sgblack@eecs.umich.edu
647202Sgblack@eecs.umich.edu# connect memory to the membus
657202Sgblack@eecs.umich.edusystem.physmem.port = system.membus.master
667599Sminkyu.jeong@arm.com
677599Sminkyu.jeong@arm.com# -----------------------
687202Sgblack@eecs.umich.edu# run simulation
697202Sgblack@eecs.umich.edu# -----------------------
707202Sgblack@eecs.umich.edu
717202Sgblack@eecs.umich.eduroot = Root(full_system = False, system = system)
727202Sgblack@eecs.umich.eduroot.system.mem_mode = 'timing'
737202Sgblack@eecs.umich.edu