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; --- 158 unchanged lines hidden (view full) --- 167 _status = Idle; 168} 169 170 171template <class T> 172Fault 173TimingSimpleCPU::read(Addr addr, T &data, unsigned flags) 174{ |
175 // need to fill in CPU & thread IDs here 176 Request *data_read_req = new Request(); |
177 |
178 data_read_req->setVirt(0, addr, sizeof(T), flags, cpuXC->readPC()); |
179 180 if (traceData) { 181 traceData->setAddr(data_read_req->getVaddr()); 182 } 183 184 // translate to physical address 185 Fault fault = cpuXC->translateDataReadReq(data_read_req); 186 --- 61 unchanged lines hidden (view full) --- 248 return read(addr, (uint32_t&)data, flags); 249} 250 251 252template <class T> 253Fault 254TimingSimpleCPU::write(T data, Addr addr, unsigned flags, uint64_t *res) 255{ |
256 // need to fill in CPU & thread IDs here 257 Request *data_write_req = new Request(); 258 data_write_req->setVirt(0, addr, sizeof(T), flags, cpuXC->readPC()); |
259 260 // translate to physical address 261 Fault fault = cpuXC->translateDataWriteReq(data_write_req); 262 // Now do the access. 263 if (fault == NoFault) { 264 Packet *data_write_pkt = 265 new Packet(data_write_req, Packet::WriteReq, Packet::Broadcast); 266 data_write_pkt->allocate(); --- 64 unchanged lines hidden (view full) --- 331} 332 333 334void 335TimingSimpleCPU::fetch() 336{ 337 checkForInterrupts(); 338 |
339 // need to fill in CPU & thread IDs here 340 Request *ifetch_req = new Request(); |
341 Fault fault = setupFetchRequest(ifetch_req); 342 343 ifetch_pkt = new Packet(ifetch_req, Packet::ReadReq, Packet::Broadcast); 344 ifetch_pkt->dataStatic(&inst); 345 346 if (fault == NoFault) { 347 if (!icachePort.sendTiming(ifetch_pkt)) { 348 // Need to wait for retry --- 220 unchanged lines hidden --- |