Deleted Added
sdiff udiff text old ( 12748:ae5ce8e42de7 ) new ( 12749:223c83ed9979 )
full compact
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * Copyright (c) 2009 Advanced Micro Devices, Inc.
4 * All rights reserved.
5 *
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

--- 93 unchanged lines hidden (view full) ---

102 flags.set(Request::INST_FETCH);
103 }
104 } else {
105 cmd = MemCmd::WriteReq;
106 flags.set(Request::PF_EXCLUSIVE);
107 }
108
109 // Prefetches are assumed to be 0 sized
110 RequestPtr req = new Request(m_address, 0, flags,
111 m_tester_ptr->masterId(), curTick(), m_pc);
112 req->setContext(index);
113
114 PacketPtr pkt = new Packet(req, cmd);
115 // despite the oddity of the 0 size (questionable if this should
116 // even be allowed), a prefetch is still a read and as such needs
117 // a place to store the result
118 uint8_t *data = new uint8_t[1];
119 pkt->dataDynamic(data);
120
121 // push the subblock onto the sender state. The sequencer will
122 // update the subblock on the return
123 pkt->senderState = new SenderState(m_address, req->getSize());
124
125 if (port->sendTimingReq(pkt)) {
126 DPRINTF(RubyTest, "successfully initiated prefetch.\n");
127 } else {
128 // If the packet did not issue, must delete
129 delete pkt->senderState;
130 delete pkt->req;
131 delete pkt;
132
133 DPRINTF(RubyTest,
134 "prefetch initiation failed because Port was busy.\n");
135 }
136}
137
138void
139Check::initiateFlush()
140{
141
142 DPRINTF(RubyTest, "initiating Flush\n");
143
144 int index = random_mt.random(0, m_num_writers - 1);
145 MasterPort* port = m_tester_ptr->getWritableCpuPort(index);
146
147 Request::Flags flags;
148
149 RequestPtr req = new Request(m_address, CHECK_SIZE, flags,
150 m_tester_ptr->masterId(), curTick(), m_pc);
151
152 Packet::Command cmd;
153
154 cmd = MemCmd::FlushReq;
155
156 PacketPtr pkt = new Packet(req, cmd);
157

--- 16 unchanged lines hidden (view full) ---

174 MasterPort* port = m_tester_ptr->getWritableCpuPort(index);
175
176 Request::Flags flags;
177
178 // Create the particular address for the next byte to be written
179 Addr writeAddr(m_address + m_store_count);
180
181 // Stores are assumed to be 1 byte-sized
182 RequestPtr req = new Request(writeAddr, 1, flags, m_tester_ptr->masterId(),
183 curTick(), m_pc);
184
185 req->setContext(index);
186 Packet::Command cmd;
187
188 // 1 out of 8 chance, issue an atomic rather than a write
189 // if ((random() & 0x7) == 0) {
190 // cmd = MemCmd::SwapReq;
191 // } else {

--- 18 unchanged lines hidden (view full) ---

210 (TesterStatus_to_string(m_status)).c_str());
211 m_status = TesterStatus_Action_Pending;
212 DPRINTF(RubyTest, "Check %#x, State=Action_Pending\n", m_address);
213 } else {
214 // If the packet did not issue, must delete
215 // Note: No need to delete the data, the packet destructor
216 // will delete it
217 delete pkt->senderState;
218 delete pkt->req;
219 delete pkt;
220
221 DPRINTF(RubyTest, "failed to initiate action - sequencer not ready\n");
222 }
223
224 DPRINTF(RubyTest, "status after action update: %s\n",
225 (TesterStatus_to_string(m_status)).c_str());
226}

--- 12 unchanged lines hidden (view full) ---

239 // If necessary, make the request an instruction fetch
240 if (m_tester_ptr->isInstOnlyCpuPort(index) ||
241 (m_tester_ptr->isInstDataCpuPort(index) &&
242 (random_mt.random(0, 0x1)))) {
243 flags.set(Request::INST_FETCH);
244 }
245
246 // Checks are sized depending on the number of bytes written
247 RequestPtr req = new Request(m_address, CHECK_SIZE, flags,
248 m_tester_ptr->masterId(), curTick(), m_pc);
249
250 req->setContext(index);
251 PacketPtr pkt = new Packet(req, MemCmd::ReadReq);
252 uint8_t *dataArray = new uint8_t[CHECK_SIZE];
253 pkt->dataDynamic(dataArray);
254
255 DPRINTF(RubyTest, "Seq read: index %d\n", index);

--- 8 unchanged lines hidden (view full) ---

264 TesterStatus_to_string(m_status).c_str());
265 m_status = TesterStatus_Check_Pending;
266 DPRINTF(RubyTest, "Check %#x, State=Check_Pending\n", m_address);
267 } else {
268 // If the packet did not issue, must delete
269 // Note: No need to delete the data, the packet destructor
270 // will delete it
271 delete pkt->senderState;
272 delete pkt->req;
273 delete pkt;
274
275 DPRINTF(RubyTest, "failed to initiate check - cpu port not ready\n");
276 }
277
278 DPRINTF(RubyTest, "status after check update: %s\n",
279 TesterStatus_to_string(m_status).c_str());
280}

--- 114 unchanged lines hidden ---