[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Port manages connection and packet transfer between units. It
includes port
class which represents shared wires for multiple
inputs/outputs, and virtual_channel_input
and
virtual_channel_output
class representing a virtual channel.
6.1 port class 6.2 bus_port_base class 6.3 bus_port class 6.4 virtual_channel_input class 6.5 virtual_channel_output class
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
port
class is used for connection between classes representing
hardware. By connecting multiple ports, a path which can share all
connecting ports is generated. When a packet is transferred to a
port, the packet can be got or referred by all connected ports.
For simulating the situation that a wire is occupied with a port, a unique identifier is assigned automatically. If requests conflict, arbitration is performed according to the specified algorithm based on port ID, and the owner is selected. After using the path, the owner release the ownership.
A unique transaction ID is automatically assigned to a sequence of packet transfer. The ID is updated when the owner is changed. The arbitrary ID can be specified. This ID is also used for split transaction.
The path can hold multiple arbiters. If not specified, a single arbiter can be used. By using multiple arbiters multiple owners can be treated.
6.1.1 port class definition 6.1.2 Sending packet 6.1.3 Port ownership 6.1.4 Using port class
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
bool is_connected(void) const
bool is_connected(const port&) const
bool have_packet(void) const
void connect(port&)
void disconnect(port&)
void disconnect(void)
void put(packet*)
packet* get(void)
void clear(void)
const packet* look(void) const
bool is_connected_to_asynchronous_unit(void) const
bool is_connected_to_asynchronous_unit(const asynchronous_unit&) const
void connect_to_asynchronous_unit(asynchronous_unit&)
void disconnect_asynchronous_unit(void)
int id(void) const
void set_id(int)
bool is_owned(int = 0) const
bool is_owner(int = 0) const
void request_ownership(int = 0)
void release_ownership(int = 0)
int transaction_id(void) const
void set_transaction_id(int)
void set_number_of_arbiter(int)
virtual bool compete(int, int) const
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Packet is sent according to the following procedures. Here, an exclusive operation for the path is not performed. For an exclusive operation, an ownership must be obtained for sending/receiving packets. See section 6.1.3 Port ownership.
new
.
put
member function. After that, handling of packet
is done by the port, the user cannot touch it.
have_packet
function.
look
member function.
If the packet has been sent, it can be referred. The packet which is
not required at that point, it is not needed to be received. Note
that the unreceived packet is left in the port until overwritten by
the succeeding packets.
get
member function.
If the packet has been sent, it can be received. Actually, the
pointer is received. The receiving user must release the packet after
using the information.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Multiple processors try to write the shared bus simultaneously in the system which connects multiple processors to a single bus. This access conflict must be solved with exclusive operation. Each port provides the ownership for the exclusion.
A unique ID is automatically assigned into connected ports each other.
For obtaining the ownership, a port requests to the path. If multiple
requests conflict, arbitration is done with the specified arbitration
algorithm, and the owner is selected. After using the path, the owner
release its ownership. Arbitration algorithm is implemented with
compete
virtual function, and users can modify it freely.
Default algorithm is round-robin.
To get the ownership, the following steps are required. Note that requesting and releasing of the ownership must be done in the output phase, while checking state must be done in the input phase.
request_ownership
function.
is_owner
function. If it does not get an ownership, request it
again in an output phase.
release_ownership
function.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
As an example of using port
class, a program of
bus_packet
communicates between two ports is shown.
#include <isis/isis.h> int main(void) { port a, b; a.connect(b); packet* pkt = new bus_packet<int>; ((bus_packet<int>*)(pkt))->address() = 100; a.put(pkt); pkt = b.get(); ((bus_packet<int>*)(pkt))->address()++; b.put(pkt); pkt = a.get(); cout << *pkt << endl; delete pkt; return 0; } |
100
, and send it.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
bus_port_base
class is a class for bus interfaces. An actual
bus is implemented as a derived class of port
class and
bus_packet_base
class, but it is cumbersome job to access them
directly. bus_port_base
class is prepared in order to hide
this complexity. See section 5.2 bus_packet_base class.
This class only prepares the interface of the abstract class
bus_packet_base
. So packet generation function is not
prepared. See section 6.3 bus_port class.
const packet_type* look(void) const
address_type address(void) const
data_type data(void) const
int total_packet_count(void) const
int packet_number(void) const
bool is_single(void) const
bool is_multi(void) const
bool is_ready(void) const
bool is_read(void) const
read
packet exists on the bus.
bool is_write(void) const
write
packet exists on the bus.
bool is_request(void) const
request
packet exists on the bus.
bool is_grant(void) const
grant
packet exists on the bus.
bool is_ack(void) const
ack
packet exists on the bus.
bool is_nack(void) const
nack
packet exists on the bus.
bool is_data(void) const
data
packet exists on the bus.
bool is_read_request(void)
read_request
packet exists on the bus.
bool is_read_grant(void) const
read_grant
packet exists on the bus.
bool is_read_ack(void) const
read_ack
packet exists on the bus.
bool is_read_nack(void) const
read_nack
packet exists on the bus.
bool is_read_data(void) const
read_data
packet exists on the bus.
bool is_write_request(void)
write_request
packet exists on the bus.
bool is_write_grant(void) const
write_grant
packet exists on the bus.
bool is_write_ack(void) const
write_ack
packet exists on the bus.
bool is_write_nack(void) const
write_nack
packet exists on the bus.
bool is_write_data(void) const
write_data
packet exists on the bus.
bool is_single_read_request(void) const
read_request
packet exists on the
bus.
bool is_single_read_grant(void) const
read_grant
packet exists on the
bus.
bool is_single_read_ack(void) const
read_ack
packet exists on the
bus.
bool is_single_read_nack(void) const
read_nack
packet exists on the
bus.
bool is_single_read_data(void) const
read_data
packet exists on the
bus.
bool is_single_write_request(void) const
write_request
packet exists on
the bus.
bool is_single_write_grant(void) const
write_grant
packet exists on the
bus.
bool is_single_write_ack(void) const
write_ack
packet exists on the
bus.
bool is_single_write_nack(void) const
write_nack
packet exists on the
bus.
bool is_single_write_data(void) const
write_data
packet exists on the
bus.
bool is_multi_read_request(void) const
read_request
packet exists on
the bus.
bool is_multi_read_grant(void) const
read_grant
packet exists on the
bus.
bool is_multi_read_ack(void) const
read_ack
packet exists on the
bus.
bool is_multi_read_nack(void) const
read_nack
packet exists on the
bus.
bool is_multi_read_data(void) const
read_data
packet exists on the
bus.
bool is_multi_write_request(void) const
write_request
packet exists on
the bus.
bool is_multi_write_grant(void) const
write_grant
packet exists on
the bus.
bool is_multi_write_ack(void) const
write_ack
packet exists on the
bus.
bool is_multi_write_nack(void) const
write_nack
packet exists on the
bus.
bool is_multi_write_data(void) const
write_data
packet exists on the
bus.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
bus_port
class is a class for an interface of bus consisting of
bus_packet
class. It is a derived class of
bus_port_base
class, and the packet sending functions are
added. See section 6.2 bus_port_base class.
void send_single_read_request(address_type)
read_request
. The first argument is the
address.
void send_single_read_grant(void)
read_grant
.
void send_single_read_ack(void)
read_ack
.
void send_single_read_nack(void)
read_nack
.
void send_single_read_data(data_type)
read_data
. The first argument is the
data.
void send_single_write_request(address_type)
write_request
. The first argument is the
address.
void send_single_write_grant(void)
write_grant
.
void send_single_write_ack(void)
write_ack
.
void send_single_write_nack(void)
write_nack
.
void send_single_write_data(data_type)
write_data
. The first argument is the
data.
void send_multi_read_request(address_type, unsigned int)
read_request
. The first argument is the
address, and the second argument is the number of transferred words.
void send_multi_read_grant(void)
read_grant
.
void send_multi_read_ack(void)
read_ack
.
void send_multi_read_nack(void)
read_nack
.
void send_multi_read_data(data_type, unsigned int, unsigned int)
read_data
. The first argument is the
data, and the second argument is the index number of the data.
void send_multi_write_request(address_type, unsigned int)
write_request
. The first argument is
the address, and the second argument is the number of transferred
words.
void send_multi_write_grant(void)
write_grant
.
void send_multi_write_ack(void)
write_ack
.
void send_multi_write_nack(void)
write_nack
.
void send_multi_write_data(data_type, unsigned int, unsigned int)
write_data
. The first argument is the
data and the second argument is the number of transferred words, and
the third argument is the index number of the data.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
virtual_channel_input
class represents an input port of a
virtual channel. Combined with an object of virtual channel output
class, a virtual channel is realized. Specified number of the path
for virtual packets are generated. Each channel has a specified size
of queue, and stores a certain number of packets. It also support
handshake function. See section 6.5 virtual_channel_output class.
6.4.1 virtual_channel_input class definition
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
virtual_channel_input(void)
virtual_channel_input(size_t a, size_t b)
bool is_connected(void)
bool is_connected(const virtual_channel_output&)
void connect(virtual_channel_output&)
void disconnect(void)
size_t channel_size(void) const
size_t buffer_size(void) const
void channel_resize(size_t)
void buffer_resize(size_t)
bool empty(size_t)
bool full(size_t)
size_t length(size_t)
packet* get(size_t)
const packet* look(size_t)
void del(size_t)
void clear(size_t)
void clear(void)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
virtual_channel_output
class represents an output port of a
virtual channel. Combined with an object of
virtual_channel_input
class, virtual channel is realized.
See section 6.4 virtual_channel_input class.
6.5.1 virtual_channel_output class definition
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
virtual_channel_output(void)
bool is_connected(void)
bool is_connected(const virtual_channel_input&)
void connect(virtual_channel_input&)
void disconnect(void)
size_t channel_size(void) const
size_t buffer_size(void) const
void channel_resize(size_t)
void buffer_resize(size_t)
bool empty(size_t)
bool full(size_t)
size_t length(size_t)
void put(size_t, packet*)
const packet* look(size_t) const
void clear(size_t)
void clear(void)
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |