MatchLib
Public Types | Public Member Functions | List of all members
Packet< DataWidth, DestWidthPerHop, MaxHops, PacketIdWidth > Class Template Reference

Parameterized implementation of a network packet. More...

#include <nvhls_packet.h>

Inheritance diagram for Packet< DataWidth, DestWidthPerHop, MaxHops, PacketIdWidth >:
nvhls_message

Public Types

enum  {
  data_width = DataWidth, dest_width_per_hop = DestWidthPerHop, dest_width = DestWidthPerHop * MaxHops, packet_id_width = PacketIdWidth,
  width = data_width + dest_width + packet_id_width, data_start_bit = 0, data_end_bit = data_width - 1, dest_start_bit = data_end_bit + 1,
  dest_end_bit = dest_start_bit + dest_width - 1, packet_id_start_bit = dest_end_bit + 1, packet_id_end_bit = packet_id_start_bit + packet_id_width - 1
}
 

Public Member Functions

 Packet (const Packet &other)
 
Packetoperator= (const Packet &other)
 
void reset ()
 
 NVUINTW (data_width) data
 
 NVUINTW (dest_width) dest
 
 NVUINTW (packet_id_width) packet_id
 
template<unsigned int Size>
void Marshall (Marshaller< Size > &m)
 

Detailed Description

template<int DataWidth, int DestWidthPerHop, int MaxHops = 1, int PacketIdWidth = 0>
class Packet< DataWidth, DestWidthPerHop, MaxHops, PacketIdWidth >

Parameterized implementation of a network packet.

Template Parameters
DataWidthWidth of data field in a packet.
DestWidthPerHopNumber of bits required to encode destination field for one hop in a packet.
MaxHopsMaximum number of hops. For source routing, this field is used along with DestWidthPerHop field to calculate total width of destination field to be encoded in a packet. (default: 1)
PacketIdWidthWidth of packet id field. PacketID acts a an identified for every hop in a packet. (default: 0)
Overview
  • Packet class is a generalized implementation of a network packet. Packet Format: <PACKET-ID>:<DEST>:<DATA>
  • PacketID field is optional and can be removed by setting PacketIdWidth to 0.
A Simple Example
#include <nvhls_packet.h>
...
Packet_t packet;
packet.data = 0xdeadbeef; // Initialize data
packet.dest = 0xde // Set destination information for data
...

Definition at line 71 of file nvhls_packet.h.


The documentation for this class was generated from the following file: