diff options
author | Nikhil Raj <nikhil.raj@arm.com> | 2019-08-15 15:49:45 +0100 |
---|---|---|
committer | Nikhil Raj <nikhil.raj@arm.com> | 2019-08-15 15:49:45 +0100 |
commit | bc62605b8f4592881dcc6eb74b5d7af089ae3fd0 (patch) | |
tree | 07094a9442131a443237fd6ae728ca711958b75c /src/profiling/Packet.hpp | |
parent | 4e3e818e1ea73544f3aec4e2ac2621a1c3380b54 (diff) | |
download | armnn-bc62605b8f4592881dcc6eb74b5d7af089ae3fd0.tar.gz |
IVGCVSW-3415 Create the Packet Class
Change-Id: Ie59e82e7f87f5ba6496aa8579bc9d40360d90999
Signed-off-by: Nikhil Raj <nikhil.raj@arm.com>
Diffstat (limited to 'src/profiling/Packet.hpp')
-rw-r--r-- | src/profiling/Packet.hpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/profiling/Packet.hpp b/src/profiling/Packet.hpp new file mode 100644 index 0000000000..0d2ba42af5 --- /dev/null +++ b/src/profiling/Packet.hpp @@ -0,0 +1,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; +};
\ No newline at end of file |