AbstractController.hh revision 7008
17008Snate@binkert.org/*
27008Snate@binkert.org * Copyright (c) 2009 Mark D. Hill and David A. Wood
37008Snate@binkert.org * All rights reserved.
47008Snate@binkert.org *
57008Snate@binkert.org * Redistribution and use in source and binary forms, with or without
67008Snate@binkert.org * modification, are permitted provided that the following conditions are
77008Snate@binkert.org * met: redistributions of source code must retain the above copyright
87008Snate@binkert.org * notice, this list of conditions and the following disclaimer;
97008Snate@binkert.org * redistributions in binary form must reproduce the above copyright
107008Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
117008Snate@binkert.org * documentation and/or other materials provided with the distribution;
127008Snate@binkert.org * neither the name of the copyright holders nor the names of its
137008Snate@binkert.org * contributors may be used to endorse or promote products derived from
147008Snate@binkert.org * this software without specific prior written permission.
157008Snate@binkert.org *
167008Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
177008Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
187008Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
197008Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
207008Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
217008Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
227008Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
237008Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
247008Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
257008Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
267008Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
277008Snate@binkert.org */
286285Snate@binkert.org
296285Snate@binkert.org#ifndef ABSTRACTCONTROLLER_H
306285Snate@binkert.org#define ABSTRACTCONTROLLER_H
316285Snate@binkert.org
326876Ssteve.reinhardt@amd.com#include "sim/sim_object.hh"
336876Ssteve.reinhardt@amd.com#include "params/RubyController.hh"
346876Ssteve.reinhardt@amd.com
356285Snate@binkert.org#include "mem/ruby/common/Consumer.hh"
366285Snate@binkert.org#include "mem/protocol/MachineType.hh"
376506Spdudnik@gmail.com#include "mem/ruby/common/Address.hh"
386881SBrad.Beckmann@amd.com#include "mem/ruby/network/Network.hh"
396285Snate@binkert.org
406285Snate@binkert.orgclass MessageBuffer;
416285Snate@binkert.orgclass Network;
426285Snate@binkert.org
436876Ssteve.reinhardt@amd.comclass AbstractController : public SimObject, public Consumer {
446285Snate@binkert.orgpublic:
456876Ssteve.reinhardt@amd.com    typedef RubyControllerParams Params;
466876Ssteve.reinhardt@amd.com    AbstractController(const Params *p) : SimObject(p) {}
476285Snate@binkert.org
486285Snate@binkert.org  // returns the number of controllers created of the specific subtype
496285Snate@binkert.org  //  virtual int getNumberOfControllers() const = 0;
506285Snate@binkert.org  virtual MessageBuffer* getMandatoryQueue() const = 0;
516285Snate@binkert.org  virtual const int & getVersion() const = 0;
526285Snate@binkert.org  virtual const string toString() const = 0;  // returns text version of controller type
536285Snate@binkert.org  virtual const string getName() const = 0;   // return instance name
546285Snate@binkert.org  virtual const MachineType getMachineType() const = 0;
556863Sdrh5@cs.wisc.edu  virtual void blockOnQueue(Address, MessageBuffer*) = 0;
566863Sdrh5@cs.wisc.edu  virtual void unblock(Address) = 0;
576881SBrad.Beckmann@amd.com  virtual void initNetworkPtr(Network* net_ptr) = 0;
586285Snate@binkert.org
596285Snate@binkert.org  virtual void print(ostream & out) const = 0;
606285Snate@binkert.org  virtual void printStats(ostream & out) const = 0;
616285Snate@binkert.org  virtual void printConfig(ostream & out) const = 0;
626285Snate@binkert.org  virtual void wakeup() = 0;
636285Snate@binkert.org  //  virtual void dumpStats(ostream & out) = 0;
646285Snate@binkert.org  virtual void clearStats() = 0;
656285Snate@binkert.org
666285Snate@binkert.org};
676285Snate@binkert.org
686285Snate@binkert.org#endif
69