SeriesRequestGenerator.hh revision 6386
11689SN/A/*
27854SAli.Saidi@ARM.com * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
37854SAli.Saidi@ARM.com * All rights reserved.
47854SAli.Saidi@ARM.com *
57854SAli.Saidi@ARM.com * Redistribution and use in source and binary forms, with or without
67854SAli.Saidi@ARM.com * modification, are permitted provided that the following conditions are
77854SAli.Saidi@ARM.com * met: redistributions of source code must retain the above copyright
87854SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer;
97854SAli.Saidi@ARM.com * redistributions in binary form must reproduce the above copyright
107854SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer in the
117854SAli.Saidi@ARM.com * documentation and/or other materials provided with the distribution;
127854SAli.Saidi@ARM.com * neither the name of the copyright holders nor the names of its
137854SAli.Saidi@ARM.com * contributors may be used to endorse or promote products derived from
142329SN/A * this software without specific prior written permission.
151689SN/A *
161689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
181689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
191689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
201689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
211689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
221689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
271689SN/A */
281689SN/A
291689SN/A/*
301689SN/A * $Id$
311689SN/A *
321689SN/A * Description:
331689SN/A *
341689SN/A */
351689SN/A
361689SN/A// This Deterministic Generator generates GETX requests for all nodes in the system
371689SN/A// The GETX requests are generated one at a time in round-robin fashion 0...1...2...etc.
381689SN/A
392665Ssaidi@eecs.umich.edu#ifndef DETERMGETXGENERATOR_H
402665Ssaidi@eecs.umich.edu#define DETERMGETXGENERATOR_H
412935Sksewell@umich.edu
421689SN/A#include "mem/ruby/tester/Tester_Globals.hh"
431689SN/A#include "mem/ruby/common/Consumer.hh"
441060SN/A#include "mem/protocol/DetermGETXGeneratorStatus.hh"
451060SN/A#include "mem/ruby/tester/SpecifiedGenerator.hh"
463773Sgblack@eecs.umich.edu#include "mem/ruby/common/Global.hh"
476329Sgblack@eecs.umich.edu#include "mem/ruby/common/Address.hh"
481858SN/A
496658Snate@binkert.orgclass DeterministicDriver;
501717SN/Aclass DMAController;
518232Snate@binkert.org
528232Snate@binkert.orgclass DetermGETXGenerator : public SpecifiedGenerator {
535529Snate@binkert.orgpublic:
541060SN/A  // Constructors
556221Snate@binkert.org  DetermGETXGenerator(NodeID node, DeterministicDriver * driver);
566221Snate@binkert.org
571061SN/A  // Destructor
585529Snate@binkert.org  ~DetermGETXGenerator();
594329Sktlim@umich.edu
604329Sktlim@umich.edu  // Public Methods
612292SN/A  void wakeup();
622292SN/A  void performCallback(NodeID proc, Address address);
632292SN/A
642292SN/A  void print(ostream& out) const;
653788Sgblack@eecs.umich.eduprivate:
663798Sgblack@eecs.umich.edu  // Private Methods
675529Snate@binkert.org  int thinkTime() const;
682361SN/A  int waitTime() const;
691060SN/A  void initiateStore();
702292SN/A  void initiateDMA();
712292SN/A  void pickAddress();
726221Snate@binkert.org
736221Snate@binkert.org  DMAController* dma() const;
742292SN/A
756221Snate@binkert.org  // copy constructor and assignment operator
766221Snate@binkert.org  DetermGETXGenerator(const DetermGETXGenerator& obj);
776221Snate@binkert.org  DetermGETXGenerator& operator=(const DetermGETXGenerator& obj);
782292SN/A
796221Snate@binkert.org  DeterministicDriver * parent_driver;
806221Snate@binkert.org  // Data Members (m_ prefix)
816221Snate@binkert.org  DetermGETXGeneratorStatus m_status;
822292SN/A  int m_counter;
836221Snate@binkert.org  bool issued_load;
842292SN/A  Address m_address;
856221Snate@binkert.org  NodeID m_node;
862292SN/A  long int counter;
876221Snate@binkert.org  Time m_last_transition;
882292SN/A};
892292SN/A
902292SN/A// Output operator declaration
912292SN/Aostream& operator<<(ostream& out, const DetermGETXGenerator& obj);
922292SN/A
932292SN/A// ******************* Definitions *******************
942292SN/A
952292SN/A// Output operator definition
962292SN/Aextern inline
972292SN/Aostream& operator<<(ostream& out, const DetermGETXGenerator& obj)
982292SN/A{
991060SN/A  obj.print(out);
1001060SN/A  out << flush;
1011061SN/A  return out;
1021060SN/A}
1032292SN/A
1041062SN/A#endif //DETERMGETXGENERATOR_H
1051062SN/A
1068240Snate@binkert.org