SeriesRequestGenerator.hh revision 6145
14997Sgblack@eecs.umich.edu 25417Sgblack@eecs.umich.edu/* 34997Sgblack@eecs.umich.edu * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 44997Sgblack@eecs.umich.edu * All rights reserved. 57087Snate@binkert.org * 67087Snate@binkert.org * Redistribution and use in source and binary forms, with or without 77087Snate@binkert.org * modification, are permitted provided that the following conditions are 87087Snate@binkert.org * met: redistributions of source code must retain the above copyright 97087Snate@binkert.org * notice, this list of conditions and the following disclaimer; 107087Snate@binkert.org * redistributions in binary form must reproduce the above copyright 117087Snate@binkert.org * notice, this list of conditions and the following disclaimer in the 127087Snate@binkert.org * documentation and/or other materials provided with the distribution; 134997Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its 147087Snate@binkert.org * contributors may be used to endorse or promote products derived from 157087Snate@binkert.org * this software without specific prior written permission. 167087Snate@binkert.org * 177087Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 187087Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 197087Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 207087Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 217087Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 224997Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 237087Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 244997Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 254997Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 264997Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 274997Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 284997Sgblack@eecs.umich.edu */ 294997Sgblack@eecs.umich.edu 304997Sgblack@eecs.umich.edu/* 314997Sgblack@eecs.umich.edu * $Id$ 324997Sgblack@eecs.umich.edu * 334997Sgblack@eecs.umich.edu * Description: 344997Sgblack@eecs.umich.edu * 354997Sgblack@eecs.umich.edu */ 364997Sgblack@eecs.umich.edu 374997Sgblack@eecs.umich.edu// This Deterministic Generator generates GETX requests for all nodes in the system 384997Sgblack@eecs.umich.edu// The GETX requests are generated one at a time in round-robin fashion 0...1...2...etc. 394997Sgblack@eecs.umich.edu 4011793Sbrandon.potter@amd.com#ifndef DETERMGETXGENERATOR_H 4111793Sbrandon.potter@amd.com#define DETERMGETXGENERATOR_H 424997Sgblack@eecs.umich.edu 4310474Sandreas.hansson@arm.com#include "Global.hh" 444997Sgblack@eecs.umich.edu#include "Consumer.hh" 459898Sandreas@sandberg.pp.se#include "DetermGETXGeneratorStatus.hh" 4611793Sbrandon.potter@amd.com#include "NodeID.hh" 478229Snate@binkert.org#include "Address.hh" 4811793Sbrandon.potter@amd.com#include "SpecifiedGenerator.hh" 498229Snate@binkert.org 508582Sgblack@eecs.umich.educlass Sequencer; 515149Sgblack@eecs.umich.educlass SubBlock; 525086Sgblack@eecs.umich.educlass DeterministicDriver; 535086Sgblack@eecs.umich.edu 548232Snate@binkert.orgclass DetermGETXGenerator : public SpecifiedGenerator { 558767Sgblack@eecs.umich.edupublic: 565086Sgblack@eecs.umich.edu // Constructors 578767Sgblack@eecs.umich.edu DetermGETXGenerator(NodeID node, DeterministicDriver& driver); 585895Sgblack@eecs.umich.edu 595086Sgblack@eecs.umich.edu // Destructor 605086Sgblack@eecs.umich.edu ~DetermGETXGenerator(); 615086Sgblack@eecs.umich.edu 6210905Sandreas.sandberg@arm.com // Public Methods 6310905Sandreas.sandberg@arm.com void wakeup(); 6410905Sandreas.sandberg@arm.com void performCallback(NodeID proc, SubBlock& data); 655124Sgblack@eecs.umich.edu 668953Sgblack@eecs.umich.edu void print(ostream& out) const; 678953Sgblack@eecs.umich.eduprivate: 685124Sgblack@eecs.umich.edu // Private Methods 698953Sgblack@eecs.umich.edu int thinkTime() const; 708953Sgblack@eecs.umich.edu int waitTime() const; 715124Sgblack@eecs.umich.edu void initiateStore(); 728953Sgblack@eecs.umich.edu void pickAddress(); 735124Sgblack@eecs.umich.edu 745245Sgblack@eecs.umich.edu Sequencer* sequencer() const; 755245Sgblack@eecs.umich.edu 765236Sgblack@eecs.umich.edu // copy constructor and assignment operator 775236Sgblack@eecs.umich.edu DetermGETXGenerator(const DetermGETXGenerator& obj); 788953Sgblack@eecs.umich.edu DetermGETXGenerator& operator=(const DetermGETXGenerator& obj); 798953Sgblack@eecs.umich.edu 808953Sgblack@eecs.umich.edu // Data Members (m_ prefix) 818953Sgblack@eecs.umich.edu DetermGETXGeneratorStatus m_status; 828953Sgblack@eecs.umich.edu int m_counter; 838953Sgblack@eecs.umich.edu Address m_address; 848953Sgblack@eecs.umich.edu NodeID m_node; 858953Sgblack@eecs.umich.edu DeterministicDriver& m_driver; 868953Sgblack@eecs.umich.edu Time m_last_transition; 878953Sgblack@eecs.umich.edu}; 888953Sgblack@eecs.umich.edu 898953Sgblack@eecs.umich.edu// Output operator declaration 908953Sgblack@eecs.umich.eduostream& operator<<(ostream& out, const DetermGETXGenerator& obj); 918953Sgblack@eecs.umich.edu 928953Sgblack@eecs.umich.edu// ******************* Definitions ******************* 938953Sgblack@eecs.umich.edu 948953Sgblack@eecs.umich.edu// Output operator definition 958953Sgblack@eecs.umich.eduextern inline 965895Sgblack@eecs.umich.eduostream& operator<<(ostream& out, const DetermGETXGenerator& obj) 9712455Sgabeblack@google.com{ 985124Sgblack@eecs.umich.edu obj.print(out); 998962Sgblack@eecs.umich.edu out << flush; 1008962Sgblack@eecs.umich.edu return out; 1018962Sgblack@eecs.umich.edu} 1029064Snilay@cs.wisc.edu 1038962Sgblack@eecs.umich.edu#endif //DETERMGETXGENERATOR_H 1048962Sgblack@eecs.umich.edu 1055124Sgblack@eecs.umich.edu