SeriesRequestGenerator.hh revision 6386
12SN/A/* 21762SN/A * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 32SN/A * 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. 272665Ssaidi@eecs.umich.edu */ 282665Ssaidi@eecs.umich.edu 292665Ssaidi@eecs.umich.edu/* 302SN/A * $Id$ 312SN/A * 322SN/A * Description: 332SN/A * 342SN/A */ 352SN/A 361354SN/A// This Deterministic Generator generates GETX requests for all nodes in the system 371354SN/A// The GETX requests are generated one at a time in round-robin fashion 0...1...2...etc. 382SN/A 392SN/A#ifndef DETERMGETXGENERATOR_H 405501Snate@binkert.org#define DETERMGETXGENERATOR_H 415546Snate@binkert.org 427004Snate@binkert.org#include "mem/ruby/tester/Tester_Globals.hh" 432SN/A#include "mem/ruby/common/Consumer.hh" 442SN/A#include "mem/protocol/DetermGETXGeneratorStatus.hh" 4556SN/A#include "mem/ruby/tester/SpecifiedGenerator.hh" 465769Snate@binkert.org#include "mem/ruby/common/Global.hh" 472361SN/A#include "mem/ruby/common/Address.hh" 481354SN/A 496216Snate@binkert.orgclass DeterministicDriver; 508232Snate@binkert.orgclass DMAController; 5156SN/A 522SN/Aclass DetermGETXGenerator : public SpecifiedGenerator { 535543Ssaidi@eecs.umich.edupublic: 542SN/A // Constructors 551354SN/A DetermGETXGenerator(NodeID node, DeterministicDriver * driver); 561354SN/A 572SN/A // Destructor 582SN/A ~DetermGETXGenerator(); 592SN/A 602SN/A // Public Methods 615501Snate@binkert.org void wakeup(); 625501Snate@binkert.org void performCallback(NodeID proc, Address address); 632SN/A 64395SN/A void print(ostream& out) const; 652SN/Aprivate: 662SN/A // Private Methods 672SN/A int thinkTime() const; 685769Snate@binkert.org int waitTime() const; 698902Sandreas.hansson@arm.com void initiateStore(); 705769Snate@binkert.org void initiateDMA(); 715769Snate@binkert.org void pickAddress(); 727059Snate@binkert.org 737059Snate@binkert.org DMAController* dma() const; 747059Snate@binkert.org 757059Snate@binkert.org // copy constructor and assignment operator 767059Snate@binkert.org DetermGETXGenerator(const DetermGETXGenerator& obj); 777059Snate@binkert.org DetermGETXGenerator& operator=(const DetermGETXGenerator& obj); 787059Snate@binkert.org 797059Snate@binkert.org DeterministicDriver * parent_driver; 807059Snate@binkert.org // Data Members (m_ prefix) 817059Snate@binkert.org DetermGETXGeneratorStatus m_status; 827059Snate@binkert.org int m_counter; 837059Snate@binkert.org bool issued_load; 847059Snate@binkert.org Address m_address; 857059Snate@binkert.org NodeID m_node; 867059Snate@binkert.org long int counter; 877059Snate@binkert.org Time m_last_transition; 885769Snate@binkert.org}; 897058Snate@binkert.org 907058Snate@binkert.org// Output operator declaration 917058Snate@binkert.orgostream& operator<<(ostream& out, const DetermGETXGenerator& obj); 922SN/A 935502Snate@binkert.org// ******************* Definitions ******************* 945502Snate@binkert.org 955502Snate@binkert.org// Output operator definition 965503Snate@binkert.orgextern inline 975503Snate@binkert.orgostream& operator<<(ostream& out, const DetermGETXGenerator& obj) 985502Snate@binkert.org{ 995502Snate@binkert.org obj.print(out); 1005502Snate@binkert.org out << flush; 1015502Snate@binkert.org return out; 1025502Snate@binkert.org} 1035502Snate@binkert.org 1045502Snate@binkert.org#endif //DETERMGETXGENERATOR_H 1055602Snate@binkert.org 1065602Snate@binkert.org