base.cc revision 11793:ef606668d247
12391SN/A/*
210482Sandreas.hansson@arm.com * Copyright (c) 2015 ARM Limited
37733SAli.Saidi@ARM.com * All rights reserved
47733SAli.Saidi@ARM.com *
57733SAli.Saidi@ARM.com * The license below extends only to copyright in the software and shall
67733SAli.Saidi@ARM.com * not be construed as granting a license to any other intellectual
77733SAli.Saidi@ARM.com * property including but not limited to intellectual property relating
87733SAli.Saidi@ARM.com * to a hardware implementation of the functionality of the software
97733SAli.Saidi@ARM.com * licensed hereunder.  You may use the software subject to the license
107733SAli.Saidi@ARM.com * terms below provided that you ensure that this notice is replicated
117733SAli.Saidi@ARM.com * unmodified and in its entirety in all distributions of the software,
127733SAli.Saidi@ARM.com * modified or unmodified, in source code or in binary form.
137733SAli.Saidi@ARM.com *
142391SN/A * Redistribution and use in source and binary forms, with or without
152391SN/A * modification, are permitted provided that the following conditions are
162391SN/A * met: redistributions of source code must retain the above copyright
172391SN/A * notice, this list of conditions and the following disclaimer;
182391SN/A * redistributions in binary form must reproduce the above copyright
192391SN/A * notice, this list of conditions and the following disclaimer in the
202391SN/A * documentation and/or other materials provided with the distribution;
212391SN/A * neither the name of the copyright holders nor the names of its
222391SN/A * contributors may be used to endorse or promote products derived from
232391SN/A * this software without specific prior written permission.
242391SN/A *
252391SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
262391SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
272391SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
282391SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
292391SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
302391SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
312391SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
322391SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
332391SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
342391SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
352391SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
362665Ssaidi@eecs.umich.edu *
378931Sandreas.hansson@arm.com * Authors: Andreas Sandberg
382391SN/A */
392391SN/A
4011793Sbrandon.potter@amd.com#include "mem/probes/base.hh"
4111793Sbrandon.potter@amd.com
4211793Sbrandon.potter@amd.com#include "params/BaseMemProbe.hh"
439293Sandreas.hansson@arm.com
449293Sandreas.hansson@arm.comBaseMemProbe::BaseMemProbe(BaseMemProbeParams *p)
459293Sandreas.hansson@arm.com    : SimObject(p)
469293Sandreas.hansson@arm.com{
479293Sandreas.hansson@arm.com}
489293Sandreas.hansson@arm.com
499293Sandreas.hansson@arm.comvoid
509293Sandreas.hansson@arm.comBaseMemProbe::regProbeListeners()
519293Sandreas.hansson@arm.com{
529293Sandreas.hansson@arm.com    const BaseMemProbeParams *p(
539293Sandreas.hansson@arm.com        dynamic_cast<const BaseMemProbeParams *>(params()));
549293Sandreas.hansson@arm.com    assert(p);
559356Snilay@cs.wisc.edu
5610405Sandreas.hansson@arm.com    listeners.resize(p->manager.size());
579293Sandreas.hansson@arm.com    for (int i = 0; i < p->manager.size(); i++) {
589293Sandreas.hansson@arm.com        ProbeManager *const mgr(p->manager[i]->getProbeManager());
592394SN/A        listeners[i].reset(new PacketListener(*this, mgr, p->probe_name));
6010700Sandreas.hansson@arm.com    }
6110700Sandreas.hansson@arm.com}
6210700Sandreas.hansson@arm.com