Merge zizzer.eecs.umich.edu:/bk/newmem
[gem5.git] / src / mem / packet.cc
index 4cda657f533a24b5a6f0d5ce9519c208eaa92040..91298df8ce62a07c169f72165a5764863634d305 100644 (file)
@@ -24,6 +24,9 @@
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Ali Saidi
+ *          Steve Reinhardt
  */
 
 /**
@@ -54,6 +57,19 @@ Packet::cmdString() const
     }
 }
 
+const std::string &
+Packet::cmdIdxToString(Packet::Command idx)
+{
+    switch (idx) {
+      case ReadReq:         return ReadReqString;
+      case WriteReq:        return WriteReqString;
+      case WriteReqNoAck:   return WriteReqNoAckString;
+      case ReadResp:        return ReadRespString;
+      case WriteResp:       return WriteRespString;
+      default:              return OtherCmdString;
+    }
+}
+
 /** delete the data pointed to in the data pointer. Ok to call to matter how
  * data was allocted. */
 void