socket channel connection
initiator_socket : as same as master socket
target_socket : as same as slave socket
ex:
1. create sockets in master/slave sides
initiator_socket
target_socket
connect(ini_socket, [tat_socket,...]) // connect one master to multi slaves
2. create trx payload to socket channel in master side
Trx trx = new();
trx.addr = 0x100;
trx.data = [0x1, 0x2, 0x3]; // generation payload
init_socket.write(trx);
3. collected trx in slave side
trx = tgt_socket.get_trx(); // fetch trx from socket channel fifo, and double check the trx is valid
if (trx != NULL) { // do something .... }
4. blocking trx
blocking interface conveys transactions in blocking fashion; its methods do not return until the transaction has been successfully sent or retrieved. Because delivery may consume time to complete, the methods in such an interface are declared as tasks
5. non blocking trx
A non-blocking interface attempts to convey a transaction without consuming simulation time. Its methods are declared as functions. Because delivery may fail (e.g. the target component is busy and can not accept the request), the methods may return with failed status.
6. port, export, imps
port: instantiated in components that require, or use, the associate interface to initiate transaction requests. export : instantiated by components that forward an implementation of the methods defined in the associated interface. The implementation is typically provided by an imp port in a child component.
沒有留言:
張貼留言