timing.hh (5710:b44dd45bd604) | timing.hh (5728:9574f561dfa2) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 35 unchanged lines hidden (view full) --- 44 45 virtual void init(); 46 47 public: 48 Event *drainEvent; 49 50 private: 51 | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 35 unchanged lines hidden (view full) --- 44 45 virtual void init(); 46 47 public: 48 Event *drainEvent; 49 50 private: 51 |
52 /* 53 * If an access needs to be broken into fragments, currently at most two, 54 * the the following two classes are used as the sender state of the 55 * packets so the CPU can keep track of everything. In the main packet 56 * sender state, there's an array with a spot for each fragment. If a 57 * fragment has already been accepted by the CPU, aka isn't waiting for 58 * a retry, it's pointer is NULL. After each fragment has successfully 59 * been processed, the "outstanding" counter is decremented. Once the 60 * count is zero, the entire larger access is complete. 61 */ 62 class SplitMainSenderState : public Packet::SenderState 63 { 64 public: 65 int outstanding; 66 PacketPtr fragments[2]; 67 68 SplitMainSenderState() 69 { 70 fragments[0] = NULL; 71 fragments[1] = NULL; 72 } 73 74 int 75 getPendingFragment() 76 { 77 if (fragments[0]) { 78 return 0; 79 } else if (fragments[1]) { 80 return 1; 81 } else { 82 return -1; 83 } 84 } 85 }; 86 87 class SplitFragmentSenderState : public Packet::SenderState 88 { 89 public: 90 SplitFragmentSenderState(PacketPtr _bigPkt, int _index) : 91 bigPkt(_bigPkt), index(_index) 92 {} 93 PacketPtr bigPkt; 94 int index; 95 96 void 97 clearFromParent() 98 { 99 SplitMainSenderState * main_send_state = 100 dynamic_cast<SplitMainSenderState *>(bigPkt->senderState); 101 main_send_state->fragments[index] = NULL; 102 } 103 }; 104 105 bool handleReadPacket(PacketPtr pkt); 106 // This function always implicitly uses dcache_pkt. 107 bool handleWritePacket(); 108 |
|
52 class CpuPort : public Port 53 { 54 protected: 55 TimingSimpleCPU *cpu; 56 Tick lat; 57 58 public: 59 --- 149 unchanged lines hidden --- | 109 class CpuPort : public Port 110 { 111 protected: 112 TimingSimpleCPU *cpu; 113 Tick lat; 114 115 public: 116 --- 149 unchanged lines hidden --- |