memhelpers.hh (12384:481add71d2e4) | memhelpers.hh (13229:b45254f2733a) |
---|---|
1/* 2 * Copyright (c) 2011 Google 3 * Copyright (c) 2015 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 --- 42 unchanged lines hidden (view full) --- 51} 52 53static void 54getMem(PacketPtr pkt, uint64_t &mem, unsigned dataSize, 55 Trace::InstRecord *traceData) 56{ 57 switch (dataSize) { 58 case 1: | 1/* 2 * Copyright (c) 2011 Google 3 * Copyright (c) 2015 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 --- 42 unchanged lines hidden (view full) --- 51} 52 53static void 54getMem(PacketPtr pkt, uint64_t &mem, unsigned dataSize, 55 Trace::InstRecord *traceData) 56{ 57 switch (dataSize) { 58 case 1: |
59 mem = pkt->get | 59 mem = pkt->getLE<uint8_t>(); |
60 break; 61 case 2: | 60 break; 61 case 2: |
62 mem = pkt->get | 62 mem = pkt->getLE<uint16_t>(); |
63 break; 64 case 4: | 63 break; 64 case 4: |
65 mem = pkt->get | 65 mem = pkt->getLE<uint32_t>(); |
66 break; 67 case 8: | 66 break; 67 case 8: |
68 mem = pkt->get | 68 mem = pkt->getLE<uint64_t>(); |
69 break; 70 default: 71 panic("Unhandled size in getMem.\n"); 72 } 73 if (traceData) 74 traceData->setData(mem); 75} 76 77template <typename T, size_t N> 78static void 79getPackedMem(PacketPtr pkt, std::array<uint64_t, N> &mem, unsigned dataSize) 80{ | 69 break; 70 default: 71 panic("Unhandled size in getMem.\n"); 72 } 73 if (traceData) 74 traceData->setData(mem); 75} 76 77template <typename T, size_t N> 78static void 79getPackedMem(PacketPtr pkt, std::array<uint64_t, N> &mem, unsigned dataSize) 80{ |
81 std::array | 81 std::array<T, N> real_mem = pkt->getLE<std::array<T, N> >(); |
82 for (int i = 0; i < N; i++) 83 mem[i] = real_mem[i]; 84} 85 86template <size_t N> 87static void 88getMem(PacketPtr pkt, std::array<uint64_t, N> &mem, unsigned dataSize, 89 Trace::InstRecord *traceData) --- 160 unchanged lines hidden --- | 82 for (int i = 0; i < N; i++) 83 mem[i] = real_mem[i]; 84} 85 86template <size_t N> 87static void 88getMem(PacketPtr pkt, std::array<uint64_t, N> &mem, unsigned dataSize, 89 Trace::InstRecord *traceData) --- 160 unchanged lines hidden --- |