SystemC-Components-Test/tests/sim_performance/packet.h

33 lines
682 B
C
Raw Permalink Normal View History

/*
* packet.h
*
* Created on: 04.05.2020
* Author: eyck
*/
#ifndef _SIM_PERFORMANCE_PACKET_H_
#define _SIM_PERFORMANCE_PACKET_H_
#include <tlm>
struct packet {
std::vector<uint8_t> routing;
};
2023-12-22 20:42:21 +01:00
struct packet_ext : public tlm::tlm_extension<packet_ext>, public packet {
packet_ext() = default;
packet_ext& operator=(packet_ext const& o) = default;
2023-12-22 20:42:21 +01:00
tlm_extension_base* clone() const override { return new packet_ext(*this); }
2023-12-22 20:42:21 +01:00
void copy_from(tlm_extension_base const& o) override {
auto* ext = dynamic_cast<packet_ext const*>(&o);
if(ext)
2023-12-22 20:42:21 +01:00
this->routing = ext->routing;
}
};
#endif /* _SIM_PERFORMANCE_PACKET_H_ */