aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/Packet.hpp
blob: 0d2ba42af57468038ada6b0c56bef1da503ce5b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once


#include <boost/log/trivial.hpp>

#include <armnn/Exceptions.hpp>

class Packet
{
public:
    Packet(uint32_t header, uint32_t length, const char* data)
    : m_Header(header), m_Length(length), m_Data(data)
          {
              m_PacketId = ((header >> 16) & 1023);
              m_PacketFamily = (header >> 26);

             if (length == 0)
             {
                 if (m_Data != nullptr)
                 {
                     throw armnn::Exception("Data should be null");
                 }
             }
          };

    uint32_t GetHeader() const;
    uint32_t GetPacketFamily() const;
    uint32_t GetPacketId() const;
    uint32_t GetLength() const;
    const char* GetData();

    uint32_t GetPacketClass() const;
    uint32_t GetPacketType() const;

private:
    uint32_t m_Header;
    uint32_t m_PacketFamily;
    uint32_t m_PacketId;
    uint32_t m_Length;
    const char* m_Data;
};