[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5. Packet

Packets are defined as information between units. Synchronized units and asynchronized units transfers packets each other through ports.

All packets are implemented as a derived class of packet class.

5.1 packet class  
5.2 bus_packet_base class  
5.3 bus_packet class  
5.4 network_packet_base class  
5.5 network_packet class  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1 packet class

packet class is a base class of all other classes represent packets. All information transferred between hardware units is treated as packets. Information on the bus and packets in the router are implemented with derived class of packet class.

packet class is an abstract class, and root_object is its base class. Derived class must give definition of all pure virtual functions in root_object class.

packet class defines the following member functions:

packet* new_packet(void) const
Generates the same type packet, and returns its pointer. It only casts the return values of new_object of root_object.

packet* clone_object(void) const
Generates the same type object, copies the value of itself, and returns its pointer. It only casts return values of new_object of root_object.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.2 bus_packet_base class

bus_packet_base class represents an abstract packet which represents memory access on the bus. Block transfer and split transaction are supported. This class is a class template with two type parameters: the first specifies address type and the second does data type.

This packet does not include any state other than address and data, and only support state query functions as pure virtual functions and pre-defined virtual functions. For transferring packets, derived class with state must be used. Although the derived class is implemented by defining pure virtual functions, other virtual functions should be re-defined for reducing the cost for function call.

A packet is classified into the following five categories:

request
Request represents read, write or some other requests. Usually target address is specified. The transferring data (e.g. write data) can be attached.

grant
Grant indicates that the request can be acceptable. The requester who receives this packet opens the bus and waits ack, nack or data.

ack
Ack indicates that the request can be acceptable and itself is in the acceptable state. The packet can accompany with the reply data (e.g. read-out data).

nack
Nack indicates that the request can be usually acceptable but now cannot be accepted.

data
Data represents transferred data.

Member functions are shown as follows:

address_type address(void) const
Refers address.

data_type data(void) const
Refers data.

size_t total_packet_count(void) const
Refers the number of data packets used in the bus transactions.

size_t packet_number(void) const
Refers its packet number.

bool is_single(void) const
Returns true with a single word transfer.

bool is_multi(void) const
Returns true with multiple words transfer.

void set_single(void)
Transits to a single word transaction packet.

void set_multi(size_t)
Transits to a multiple word transaction packet which has a size specified by the parameter.

void set_multi(size_t, size_t)
Transits to a multiple word transaction packet which has a size specified by the first parameter and the number specified by the second parameter.

virtual bool is_read(void) const = 0
Returns true if read.

virtual bool is_write(void) const = 0
Returns true if write.

virtual bool is_request(void) const = 0
Returns true if request.

virtual bool is_grant(void) const = 0
Returns true if grant.

virtual bool is_ack(void) const = 0
Returns true if ack.

virtual bool is_nack(void) const = 0
Returns true if nack.

virtual bool is_data(void) const = 0
Returns true if data.

virtual void set_read(void) = 0
Transits to read.

virtual void set_write(void) = 0
Transits to write.

virtual void set_request(void) = 0
Transits to request.

virtual void set_grant(void) = 0
Transits to grant.

virtual void set_ack(void) = 0
Transits to ack.

virtual void set_nack(void) = 0
Transits to nack.

virtual void set_data(void) = 0
Transits to data.

virtual bool is_read_request(void) const
Returns true if read_request.

virtual bool is_read_grant(void) const
Returns true if read_grant.

virtual bool is_read_ack(void) const
Returns true if read_ack.

virtual bool is_read_nack(void) const
Returns true if read_nack.

virtual bool is_read_data(void) const
Returns true if read_data.

virtual bool is_write_request(void) const
Returns true if write_request.

virtual bool is_write_grant(void) const
Returns true if write_grant.

virtual bool is_write_ack(void) const
Returns true if write_ack.

virtual bool is_write_nack(void) const
Returns true if write_nack.

virtual bool is_write_data(void) const
Returns true if write_data.

virtual bool is_single_read_request(void) const
Returns true if it is a single word transaction read_request.

virtual bool is_single_read_grant(void) const
Returns true if it is a single word transaction read_grant.

virtual bool is_single_read_ack(void) const
Returns true if it is a single word transaction read_ack.

virtual bool is_single_read_nack(void) const
Returns true if it is a single word transaction read_nack.

virtual bool is_single_read_data(void) const
Returns true if it is a single word transaction read_data.

virtual bool is_single_write_request(void) const
Returns true if it is a single word transaction write_request.

virtual bool is_single_write_grant(void) const
Returns true if it is a single word transaction write_grant.

virtual bool is_single_write_ack(void) const
Returns true if it is a single word transaction write_ack.

virtual bool is_single_write_nack(void) const
Returns true if it is a single word transaction write_nack.

virtual bool is_single_write_data(void) const
Returns true if it is a single word transaction write_data.

virtual bool is_multi_read_request(void) const
Returns true if it is a multiple word transaction read_request.

virtual bool is_multi_read_grant(void) const
Returns true if it is a multiple word transaction read_grant.

virtual bool is_multi_read_ack(void) const
Returns true if it is a multiple word transaction read_ack.

virtual bool is_multi_read_nack(void) const
Returns true if it is a multiple word transaction read_nack.

virtual bool is_multi_read_data(void) const
Returns true if it is a multiple word transaction read_data.

virtual bool is_multi_write_request(void) const
Returns true if it is a multiple word transaction write_request.

virtual bool is_multi_write_grant(void) const
Returns true if it is a multiple word transaction write_grant.

virtual bool is_multi_write_ack(void) const
Returns true if it is a multiple word transaction write_ack.

virtual bool is_multi_write_nack(void) const
Returns true if it is a multiple word transaction write_nack.

virtual bool is_multi_write_data(void) const
Returns true if it is a multiple word transaction write_data.

virtual void set_read_request(void)
Transits to read_request.

virtual void set_read_grant(void)
Transits to read_grant.

virtual void set_read_ack(void)
Transits to read_ack.

virtual void set_read_nack(void)
Transits to read_nack.

virtual void set_read_data(void)
Transits to read_data.

virtual void set_write_request(void)
Transits to write_request.

virtual void set_write_grant(void)
Transits to write_grant.

virtual void set_write_ack(void)
Transits to write_ack.

virtual void set_write_nack(void)
Transits to write_nack.

virtual void set_write_data(void)
Transits to write_data.

virtual void set_single_read_request(address_type)
Transits to a single word read_request with specified address.

virtual void set_single_read_grant(void)
Transits to a single word read_ack.

virtual void set_single_read_grant(void)
Transits to a single word read_ack.

virtual void set_single_read_nack(void)
Transits to a single word read_nack.

virtual void set_single_read_data(data_type)
Transits to a single word read_data with specified data.

virtual void set_single_write_request(data_type)
Transits to a single word write_request with specified address.

virtual void set_single_write_grant(void)
Transits to a single word write_grant.

virtual void set_single_write_ack(void)
Transits to a single word write_ack.

virtual void set_single_write_nack(void)
Transits to a single word write_nack.

virtual void set_single_write_data(data_type)
Transits to a single word write_data with specified data.

virtual void set_multi_read_request(address_type, size_t)
Transits to a multiple word read_request with address specified with the first parameter and size specified with the second parameter.

virtual void set_multi_read_grant(void)
Transits to a multiple word read_grant.

virtual void set_multi_read_ack(void)
Transits to a multiple word read_ack.

virtual void set_multi_read_nack(void)
Transits to a multiple word read_nack.

virtual void set_multi_read_data(data_type, size_t, size_t)
Transits to a multiple word read_data with data specified with the first parameter, size specified with the second parameter and packet index number specified with the third parameter.

virtual void set_multi_write_request(address_type, size_t)
Transits to a multiple word write_request with address specified with the first parameter and size specified with the second parameter.

virtual void set_multi_write_grant(void)
Transits to a multiple word write_grant.

virtual void set_multi_write_ack(void)
Transits to a multiple word write_ack.

virtual void set_multi_write_nack(void)
Transits to a multiple word write_nack.

virtual void set_multi_write_data(data_type, size_t, size_t)
Transits to a multiple word write_data with data specified with the first parameter, size specified with the second parameter and packet index number specified with the third parameter.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.3 bus_packet class

bus_packet is a instance of a packet which represents memory access on a bus. It is a derived class of bus_packet_base, and only instantiates functions in bus_packet_base.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4 network_packet_base class

network_packet_base class represents a packet on an interconnection network. It is a class template whose parameter is network address type.

A packet holds at least a send node address. For unicast, a destination address is stored, and multiple destinations are stored for multicast. For broadcast, destination node address is not stored. Packet size and generation time are stored. Data is not included.

void set_unicast(void)
Set unicast.

void set_multicast(void)
Set multicast.

void set_broadcast(void)
Set broadcast.

void set_source(address_type)
Set the source node address.

void set_destination(address_type)
Set the destination node address of unicast.

void set_multicast_destination_number(size_t)
Set the number of destination nodes of multicast.

void set_multicast_destination(size_t, address_type)
Set the destination node address of multicast.

void set_length(size_t)
Set the packet length.

void set_timestamp(timestamp_type)
Set the generated timestamp.

bool is_unicast(void) const
Returns true if unicast.

bool is_multicast(void) const
Returns true if multicast.

bool is_broadcast(void) const
Returns true if broadcast.

address_type source(void) const
Refers the source node address.

address_type destination(void) const
Refers the destination node address of unicast.

address_type multicast_destination(size_t) const
Refers the destination node address of multicast.

size_t length(void) const
Refers its packet length.

timestamp_type set_timestamp(void) const
Refers its generated timestamp.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5 network_packet class

network_packet class is a derived class of network_packet_base class with data.

void set_data_size(size_type)
Set data size.

void set_data(size_type, data_type)
Set data.

size_type data_size(void) const
Refers data size.

data_type data(size_type) const
Refers data.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Masaki WAKABAYASHI on September, 3 2003 using texi2html