packet.hh (8229:78bf55f23338) | packet.hh (8436:5648986156db) |
---|---|
1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * Copyright (c) 2010 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 --- 89 unchanged lines hidden (view full) --- 98 MessageResp, 99 // Error responses 100 // @TODO these should be classified as responses rather than 101 // requests; coding them as requests initially for backwards 102 // compatibility 103 NetworkNackError, // nacked at network layer (not by protocol) 104 InvalidDestError, // packet dest field invalid 105 BadAddressError, // memory address invalid | 1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * Copyright (c) 2010 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 --- 89 unchanged lines hidden (view full) --- 98 MessageResp, 99 // Error responses 100 // @TODO these should be classified as responses rather than 101 // requests; coding them as requests initially for backwards 102 // compatibility 103 NetworkNackError, // nacked at network layer (not by protocol) 104 InvalidDestError, // packet dest field invalid 105 BadAddressError, // memory address invalid |
106 FunctionalReadError, // unable to fulfill functional read 107 FunctionalWriteError, // unable to fulfill functional write |
|
106 // Fake simulator-only commands 107 PrintReq, // Print state matching address 108 FlushReq, //request for a cache flush 109 NUM_MEM_CMDS 110 }; 111 112 private: 113 /** --- 121 unchanged lines hidden (view full) --- 235 /// when the packet is destroyed? 236 static const FlagsType STATIC_DATA = 0x00001000; 237 /// The data pointer points to a value that should be freed when 238 /// the packet is destroyed. 239 static const FlagsType DYNAMIC_DATA = 0x00002000; 240 /// the data pointer points to an array (thus delete []) needs to 241 /// be called on it rather than simply delete. 242 static const FlagsType ARRAY_DATA = 0x00004000; | 108 // Fake simulator-only commands 109 PrintReq, // Print state matching address 110 FlushReq, //request for a cache flush 111 NUM_MEM_CMDS 112 }; 113 114 private: 115 /** --- 121 unchanged lines hidden (view full) --- 237 /// when the packet is destroyed? 238 static const FlagsType STATIC_DATA = 0x00001000; 239 /// The data pointer points to a value that should be freed when 240 /// the packet is destroyed. 241 static const FlagsType DYNAMIC_DATA = 0x00002000; 242 /// the data pointer points to an array (thus delete []) needs to 243 /// be called on it rather than simply delete. 244 static const FlagsType ARRAY_DATA = 0x00004000; |
245 /// suppress the error if this packet encounters a functional 246 /// access failure. 247 static const FlagsType SUPPRESS_FUNC_ERROR = 0x00008000; |
|
243 244 Flags flags; 245 246 public: 247 typedef MemCmd::Command Command; 248 249 /// The command field of the packet. 250 MemCmd cmd; --- 172 unchanged lines hidden (view full) --- 423 bool sharedAsserted() { return flags.isSet(SHARED); } 424 425 // Special control flags 426 void setExpressSnoop() { flags.set(EXPRESS_SNOOP); } 427 bool isExpressSnoop() { return flags.isSet(EXPRESS_SNOOP); } 428 void setSupplyExclusive() { flags.set(SUPPLY_EXCLUSIVE); } 429 void clearSupplyExclusive() { flags.clear(SUPPLY_EXCLUSIVE); } 430 bool isSupplyExclusive() { return flags.isSet(SUPPLY_EXCLUSIVE); } | 248 249 Flags flags; 250 251 public: 252 typedef MemCmd::Command Command; 253 254 /// The command field of the packet. 255 MemCmd cmd; --- 172 unchanged lines hidden (view full) --- 428 bool sharedAsserted() { return flags.isSet(SHARED); } 429 430 // Special control flags 431 void setExpressSnoop() { flags.set(EXPRESS_SNOOP); } 432 bool isExpressSnoop() { return flags.isSet(EXPRESS_SNOOP); } 433 void setSupplyExclusive() { flags.set(SUPPLY_EXCLUSIVE); } 434 void clearSupplyExclusive() { flags.clear(SUPPLY_EXCLUSIVE); } 435 bool isSupplyExclusive() { return flags.isSet(SUPPLY_EXCLUSIVE); } |
436 void setSuppressFuncError() { flags.set(SUPPRESS_FUNC_ERROR); } 437 bool suppressFuncError() { return flags.isSet(SUPPRESS_FUNC_ERROR); } |
|
431 432 // Network error conditions... encapsulate them as methods since 433 // their encoding keeps changing (from result field to command 434 // field, etc.) 435 void 436 setNacked() 437 { 438 assert(isResponse()); --- 173 unchanged lines hidden (view full) --- 612 } 613 614 void 615 makeTimingResponse() 616 { 617 makeResponse(); 618 } 619 | 438 439 // Network error conditions... encapsulate them as methods since 440 // their encoding keeps changing (from result field to command 441 // field, etc.) 442 void 443 setNacked() 444 { 445 assert(isResponse()); --- 173 unchanged lines hidden (view full) --- 619 } 620 621 void 622 makeTimingResponse() 623 { 624 makeResponse(); 625 } 626 |
627 void 628 setFunctionalResponseStatus(bool success) 629 { 630 if (!success) { 631 if (isWrite()) { 632 cmd = MemCmd::FunctionalWriteError; 633 } else { 634 cmd = MemCmd::FunctionalReadError; 635 } 636 } 637 } 638 |
|
620 /** 621 * Take a request packet that has been returned as NACKED and 622 * modify it so that it can be sent out again. Only packets that 623 * need a response can be NACKED, so verify that that is true. 624 */ 625 void 626 reinitNacked() 627 { --- 193 unchanged lines hidden --- | 639 /** 640 * Take a request packet that has been returned as NACKED and 641 * modify it so that it can be sent out again. Only packets that 642 * need a response can be NACKED, so verify that that is true. 643 */ 644 void 645 reinitNacked() 646 { --- 193 unchanged lines hidden --- |