blob: ce378441f45965ad44cce3811484835d2ff09fa0 [file] [log] [blame]
Nikhil Rajbc626052019-08-15 15:49:45 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
Aron Virginas-Tare898db92019-08-22 12:56:34 +01007#include <armnn/Exceptions.hpp>
Nikhil Rajbc626052019-08-15 15:49:45 +01008
9#include <boost/log/trivial.hpp>
10
Aron Virginas-Tare898db92019-08-22 12:56:34 +010011namespace armnn
12{
13
14namespace profiling
15{
Nikhil Rajbc626052019-08-15 15:49:45 +010016
17class Packet
18{
19public:
20 Packet(uint32_t header, uint32_t length, const char* data)
21 : m_Header(header), m_Length(length), m_Data(data)
22 {
23 m_PacketId = ((header >> 16) & 1023);
24 m_PacketFamily = (header >> 26);
25
26 if (length == 0)
27 {
28 if (m_Data != nullptr)
29 {
30 throw armnn::Exception("Data should be null");
31 }
32 }
33 };
34
35 uint32_t GetHeader() const;
36 uint32_t GetPacketFamily() const;
37 uint32_t GetPacketId() const;
38 uint32_t GetLength() const;
39 const char* GetData();
40
41 uint32_t GetPacketClass() const;
42 uint32_t GetPacketType() const;
43
44private:
45 uint32_t m_Header;
46 uint32_t m_PacketFamily;
47 uint32_t m_PacketId;
48 uint32_t m_Length;
49 const char* m_Data;
Aron Virginas-Tare898db92019-08-22 12:56:34 +010050};
51
52} // namespace profiling
53
54} // namespace armnn