3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution;
13 * neither the name of the copyright holders nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include "Consumer.hh"
36 #include "CacheRequestType.hh"
42 class SimicsHypervisor;
50 virtual ~Driver() = 0;
53 virtual void get_network_config() {}
54 virtual void hitCallback(NodeID proc, SubBlock& data, CacheRequestType type, int thread) = 0; // Called by sequencer
55 virtual void conflictCallback(NodeID proc, SubBlock& data, CacheRequestType type, int thread) { assert(0); } // Called by sequencer
56 virtual integer_t getInstructionCount(int procID) const { return 1; }
57 virtual integer_t getCycleCount(int procID) const { return 1; }
58 virtual SimicsHypervisor * getHypervisor() { return NULL; }
59 virtual void notifySendNack( int procID, const Address & addr, uint64 remote_timestamp, const MachineID & remote_id) { assert(0); }; //Called by Sequencer
60 virtual void notifyReceiveNack( int procID, const Address & addr, uint64 remote_timestamp, const MachineID & remote_id) { assert(0); }; //Called by Sequencer
61 virtual void notifyReceiveNackFinal( int procID, const Address & addr) { assert(0); }; // Called by Sequencer
62 virtual void notifyTrapStart( int procID, const Address & handlerPC, int threadID, int smtThread ) { assert(0); } //called by Sequencer
63 virtual void notifyTrapComplete( int procID, const Address & newPC, int smtThread ) {assert(0); } // called by Sequencer
64 virtual int getOpalTransactionLevel(int procID, int thread) const {
65 cout << "Driver.hh getOpalTransactionLevel() " << endl;
66 return 0; } //called by Sequencer
67 virtual void addThreadDependency(int procID, int requestor_thread, int conflict_thread) const { assert(0);}
68 virtual uint64 getOpalTime(int procID) const{ return 0; } //called by Sequencer
69 virtual uint64 getOpalTimestamp(int procID, int thread) const{
70 cout << "Driver.hh getOpalTimestamp " << endl;
71 return 0; } // called by Sequencer
72 virtual int inTransaction(int procID, int thread ) const{
73 cout << "Driver.hh inTransaction " << endl;
74 return false; } //called by Sequencer
75 virtual void printDebug(){} //called by Sequencer
77 virtual void printStats(ostream& out) const = 0;
78 virtual void clearStats() = 0;
80 virtual void printConfig(ostream& out) const = 0;
82 //virtual void abortCallback(NodeID proc){}
84 virtual integer_t readPhysicalMemory(int procID, physical_address_t address,
85 int len ){ ASSERT(0); return 0; }
87 virtual void writePhysicalMemory( int procID, physical_address_t address,
88 integer_t value, int len ){ ASSERT(0); }
91 // accessible by subclasses
94 // inaccessible by subclasses