SeriesRequestGenerator.hh revision 6386
12SN/A/*
210292SAndreas.Sandberg@ARM.com * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
34039Sbinkertn@umich.edu * All rights reserved.
42SN/A *
52SN/A * Redistribution and use in source and binary forms, with or without
62SN/A * modification, are permitted provided that the following conditions are
72SN/A * met: redistributions of source code must retain the above copyright
82SN/A * notice, this list of conditions and the following disclaimer;
92SN/A * redistributions in binary form must reproduce the above copyright
102SN/A * notice, this list of conditions and the following disclaimer in the
112SN/A * documentation and/or other materials provided with the distribution;
122SN/A * neither the name of the copyright holders nor the names of its
132SN/A * contributors may be used to endorse or promote products derived from
142SN/A * this software without specific prior written permission.
152SN/A *
162SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272SN/A */
282665Ssaidi@eecs.umich.edu
292665Ssaidi@eecs.umich.edu/*
302665Ssaidi@eecs.umich.edu * $Id$
3110292SAndreas.Sandberg@ARM.com *
322SN/A * Description:
332SN/A *
344039Sbinkertn@umich.edu */
354039Sbinkertn@umich.edu
362SN/A// This Deterministic Generator generates GETX requests for all nodes in the system
374039Sbinkertn@umich.edu// The GETX requests are generated one at a time in round-robin fashion 0...1...2...etc.
382SN/A
392SN/A#ifndef DETERMGETXGENERATOR_H
402SN/A#define DETERMGETXGENERATOR_H
412SN/A
428229Snate@binkert.org#include "mem/ruby/tester/Tester_Globals.hh"
432621SN/A#include "mem/ruby/common/Consumer.hh"
442SN/A#include "mem/protocol/DetermGETXGeneratorStatus.hh"
452SN/A#include "mem/ruby/tester/SpecifiedGenerator.hh"
464039Sbinkertn@umich.edu#include "mem/ruby/common/Global.hh"
472SN/A#include "mem/ruby/common/Address.hh"
484039Sbinkertn@umich.edu
494039Sbinkertn@umich.educlass DeterministicDriver;
504039Sbinkertn@umich.educlass DMAController;
514039Sbinkertn@umich.edu
525756Snate@binkert.orgclass DetermGETXGenerator : public SpecifiedGenerator {
534039Sbinkertn@umich.edupublic:
544039Sbinkertn@umich.edu  // Constructors
554039Sbinkertn@umich.edu  DetermGETXGenerator(NodeID node, DeterministicDriver * driver);
564039Sbinkertn@umich.edu
574039Sbinkertn@umich.edu  // Destructor
585756Snate@binkert.org  ~DetermGETXGenerator();
595756Snate@binkert.org
609331Schander.sudanthi@arm.com  // Public Methods
614039Sbinkertn@umich.edu  void wakeup();
624039Sbinkertn@umich.edu  void performCallback(NodeID proc, Address address);
634039Sbinkertn@umich.edu
644039Sbinkertn@umich.edu  void print(ostream& out) const;
654039Sbinkertn@umich.eduprivate:
662SN/A  // Private Methods
675756Snate@binkert.org  int thinkTime() const;
685756Snate@binkert.org  int waitTime() const;
695756Snate@binkert.org  void initiateStore();
705756Snate@binkert.org  void initiateDMA();
715756Snate@binkert.org  void pickAddress();
725756Snate@binkert.org
735756Snate@binkert.org  DMAController* dma() const;
745756Snate@binkert.org
755756Snate@binkert.org  // copy constructor and assignment operator
765756Snate@binkert.org  DetermGETXGenerator(const DetermGETXGenerator& obj);
775756Snate@binkert.org  DetermGETXGenerator& operator=(const DetermGETXGenerator& obj);
785756Snate@binkert.org
795756Snate@binkert.org  DeterministicDriver * parent_driver;
802SN/A  // Data Members (m_ prefix)
814039Sbinkertn@umich.edu  DetermGETXGeneratorStatus m_status;
824039Sbinkertn@umich.edu  int m_counter;
832SN/A  bool issued_load;
845756Snate@binkert.org  Address m_address;
855756Snate@binkert.org  NodeID m_node;
865756Snate@binkert.org  long int counter;
875756Snate@binkert.org  Time m_last_transition;
885756Snate@binkert.org};
895756Snate@binkert.org
905756Snate@binkert.org// Output operator declaration
915756Snate@binkert.orgostream& operator<<(ostream& out, const DetermGETXGenerator& obj);
925756Snate@binkert.org
935756Snate@binkert.org// ******************* Definitions *******************
945756Snate@binkert.org
955756Snate@binkert.org// Output operator definition
965756Snate@binkert.orgextern inline
975756Snate@binkert.orgostream& operator<<(ostream& out, const DetermGETXGenerator& obj)
985756Snate@binkert.org{
995756Snate@binkert.org  obj.print(out);
1002SN/A  out << flush;
1014039Sbinkertn@umich.edu  return out;
1024039Sbinkertn@umich.edu}
1034039Sbinkertn@umich.edu
1044039Sbinkertn@umich.edu#endif //DETERMGETXGENERATOR_H
1052SN/A
1064039Sbinkertn@umich.edu