1// -*- mode:c++ -*- 2 3// Copyright (c) 2007 MIPS Technologies, 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 --- 83 unchanged lines hidden (view full) --- 92 flags[IsFloating] ? 'f' : 'r', 93 flags[IsFloating] ? FD : RD, 94 RS, RT); 95 } 96 97}}; 98 99output header {{ |
100 uint64_t getMemData(ExecContext *xc, Packet *packet); |
101 102}}; 103 104output exec {{ 105 /** return data in cases where there the size of data is only 106 known in the packet 107 */ |
108 uint64_t getMemData(ExecContext *xc, Packet *packet) { |
109 switch (packet->getSize()) 110 { 111 case 1: 112 return packet->get<uint8_t>(); 113 114 case 2: 115 return packet->get<uint16_t>(); 116 --- 31 unchanged lines hidden (view full) --- 148 149 %(InitiateAccDeclare)s 150 151 %(CompleteAccDeclare)s 152 }; 153}}; 154 155def template EACompDeclare {{ |
156 Fault eaComp(ExecContext *, Trace::InstRecord *) const; |
157}}; 158 159def template InitiateAccDeclare {{ |
160 Fault initiateAcc(ExecContext *, Trace::InstRecord *) const; |
161}}; 162 163 164def template CompleteAccDeclare {{ |
165 Fault completeAcc(Packet *, ExecContext *, Trace::InstRecord *) const; |
166}}; 167 168def template LoadStoreConstructor {{ 169 %(class_name)s::%(class_name)s(ExtMachInst machInst) 170 : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) 171 { 172 %(constructor)s; 173 } 174}}; 175 176 177def template EACompExecute {{ 178 Fault |
179 %(class_name)s::eaComp(ExecContext *xc, Trace::InstRecord *traceData) const |
180 { 181 Addr EA; 182 Fault fault = NoFault; 183 184 if (this->isFloating()) { 185 %(fp_enable_check)s; 186 187 if(fault != NoFault) --- 9 unchanged lines hidden (view full) --- 197 xc->setEA(EA); 198 } 199 200 return fault; 201 } 202}}; 203 204def template LoadExecute {{ |
205 Fault %(class_name)s::execute(ExecContext *xc, |
206 Trace::InstRecord *traceData) const 207 { 208 Addr EA; 209 Fault fault = NoFault; 210 211 if (this->isFloating()) { 212 %(fp_enable_check)s; 213 --- 15 unchanged lines hidden (view full) --- 229 } 230 231 return fault; 232 } 233}}; 234 235 236def template LoadInitiateAcc {{ |
237 Fault %(class_name)s::initiateAcc(ExecContext *xc, |
238 Trace::InstRecord *traceData) const 239 { 240 Addr EA; 241 Fault fault = NoFault; 242 243 if (this->isFloating()) { 244 %(fp_enable_check)s; 245 --- 9 unchanged lines hidden (view full) --- 255 fault = initiateMemRead(xc, traceData, EA, Mem, memAccessFlags); 256 } 257 258 return fault; 259 } 260}}; 261 262def template LoadCompleteAcc {{ |
263 Fault %(class_name)s::completeAcc(Packet *pkt, ExecContext *xc, |
264 Trace::InstRecord *traceData) const 265 { 266 Fault fault = NoFault; 267 268 if (this->isFloating()) { 269 %(fp_enable_check)s; 270 271 if(fault != NoFault) --- 13 unchanged lines hidden (view full) --- 285 %(op_wb)s; 286 } 287 288 return fault; 289 } 290}}; 291 292def template StoreExecute {{ |
293 Fault %(class_name)s::execute(ExecContext *xc, |
294 Trace::InstRecord *traceData) const 295 { 296 Addr EA; 297 Fault fault = NoFault; 298 299 %(fp_enable_check)s; 300 %(op_decl)s; 301 %(op_rd)s; --- 17 unchanged lines hidden (view full) --- 319 } 320 321 return fault; 322 } 323}}; 324 325 326def template StoreFPExecute {{ |
327 Fault %(class_name)s::execute(ExecContext *xc, |
328 Trace::InstRecord *traceData) const 329 { 330 Addr EA; 331 Fault fault = NoFault; 332 333 %(fp_enable_check)s; 334 if(fault != NoFault) 335 return fault; --- 18 unchanged lines hidden (view full) --- 354 %(op_wb)s; 355 } 356 357 return fault; 358 } 359}}; 360 361def template StoreCondExecute {{ |
362 Fault %(class_name)s::execute(ExecContext *xc, |
363 Trace::InstRecord *traceData) const 364 { 365 Addr EA; 366 Fault fault = NoFault; 367 uint64_t write_result = 0; 368 369 %(fp_enable_check)s; 370 %(op_decl)s; --- 17 unchanged lines hidden (view full) --- 388 %(op_wb)s; 389 } 390 391 return fault; 392 } 393}}; 394 395def template StoreInitiateAcc {{ |
396 Fault %(class_name)s::initiateAcc(ExecContext *xc, |
397 Trace::InstRecord *traceData) const 398 { 399 Addr EA; 400 Fault fault = NoFault; 401 402 %(fp_enable_check)s; 403 %(op_decl)s; 404 %(op_rd)s; --- 10 unchanged lines hidden (view full) --- 415 416 return fault; 417 } 418}}; 419 420 421def template StoreCompleteAcc {{ 422 Fault %(class_name)s::completeAcc(Packet *pkt, |
423 ExecContext *xc, |
424 Trace::InstRecord *traceData) const 425 { 426 return NoFault; 427 } 428}}; 429 430def template StoreCondCompleteAcc {{ 431 Fault %(class_name)s::completeAcc(Packet *pkt, |
432 ExecContext *xc, |
433 Trace::InstRecord *traceData) const 434 { 435 Fault fault = NoFault; 436 437 %(fp_enable_check)s; 438 %(op_dest_decl)s; 439 440 uint64_t write_result = pkt->req->getExtraData(); --- 6 unchanged lines hidden (view full) --- 447 %(op_wb)s; 448 } 449 450 return fault; 451 } 452}}; 453 454def template MiscExecute {{ |
455 Fault %(class_name)s::execute(ExecContext *xc, |
456 Trace::InstRecord *traceData) const 457 { 458 Addr EA M5_VAR_USED = 0; 459 Fault fault = NoFault; 460 461 %(fp_enable_check)s; 462 %(op_decl)s; 463 %(op_rd)s; 464 %(ea_code)s; 465 466 if (fault == NoFault) { 467 %(memacc_code)s; 468 } 469 470 return NoFault; 471 } 472}}; 473 474def template MiscInitiateAcc {{ |
475 Fault %(class_name)s::initiateAcc(ExecContext *xc, |
476 Trace::InstRecord *traceData) const 477 { 478 panic("Misc instruction does not support split access method!"); 479 return NoFault; 480 } 481}}; 482 483 484def template MiscCompleteAcc {{ |
485 Fault %(class_name)s::completeAcc(Packet *pkt, ExecContext *xc, |
486 Trace::InstRecord *traceData) const 487 { 488 panic("Misc instruction does not support split access method!"); 489 490 return NoFault; 491 } 492}}; 493 --- 105 unchanged lines hidden --- |