cloudFPGA (cF) API
1.0
The documentation of the source code of cloudFPGA (cF)
|
Functions | |
def | tcp_rx_loop (clientSock, serverSock, size, ip_da, tcp_dp, count, verbose=False) |
def | tcp_rx_ramp (clientSock, serverSock, ip_da, tcp_dp, verbose=False, start=1, end=0xFFFF) |
Variables | |
parser = argparse.ArgumentParser(description='A script to receive TCP data from an FPGA module.') | |
type | |
str | |
default | |
help | |
int | |
action | |
args = parser.parse_args() | |
ipFpga = getFpgaIpv4(args) | |
instId = getInstanceId(args) | |
ipResMngr = getResourceManagerIpv4(args) | |
portFpgaServer = XMIT_MODE_LSN_PORT | |
portResMngr = getResourceManagerPort(args) | |
tuple | fpgaServerAssociation = (str(ipFpga), portFpgaServer) |
tcpClientSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
hostname = socket.gethostname() | |
ipHostStr = socket.gethostbyname(hostname) | |
ip4Str = ni.ifaddresses(itf)[AF_INET][0]['addr'] | |
ipHost = int(ipaddress.IPv4Address(ipHostStr)) | |
int | dpHost = 2718 |
tuple | hostListenAssociation = (str(ipHostStr), dpHost) |
tcpListenSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
reqMsgAsBytes = struct.pack(">IHH", ipHost, dpHost, 0) | |
tcpServerSock | |
fpgaClientAssociation | |
seed = args.seed | |
int | TODO_MAX_SEG_SIZE = 2048 |
size = args.size | |
count = args.loop_count | |
verbose = args.verbose | |
def tc_TcpRecv.tcp_rx_loop | ( | clientSock, | |
serverSock, | |||
size, | |||
ip_da, | |||
tcp_dp, | |||
count, | |||
verbose = False |
|||
) |
TCP Rx Single-Thread Loop. Requests the FPGA to send 'count' segments of 'size' bytes and expect the HOST to receive them on the socket (ip_da, tcp_port). Each segment is made of the following repetitive pattern '48692066726f6d200x464d4b553630210a' which decodes into "Hi from FMKU60\n". :param clientSock The socket to send to. :param serverSock The socket to receive from. :param size The size of the expected segment. :param ip_da The destination address of the host. :param tcp_dp The destination port of the host. :param count The number of segments to receive. :param verbose Enables verbosity. :return None
Definition at line 44 of file tc_TcpRecv.py.
def tc_TcpRecv.tcp_rx_ramp | ( | clientSock, | |
serverSock, | |||
ip_da, | |||
tcp_dp, | |||
verbose = False , |
|||
start = 1 , |
|||
end = 0xFFFF |
|||
) |
TCP Rx Single-Thread Ramp. Requests the FPGA to send 'start'-'end' number of segments to the HOST, each segment with an increasing number of bytes from 'start' to 'end'. Expect the HOST to receive the segments on the socket (ip_da, tcp_port). Each segment is made of the following repetitive pattern pattern '48692066726f6d200x464d4b553630210a' which decodes into "Hi from FMKU60\n". :param clientSock The socket to send to. :param serverSock The socket to receive from. :param ip_da The destination address of the host :param tcp_dp The destination port of the host. :param verbose Enables verbosity. :param start The start size of the ramp (in bytes). :param end The end size of the ramp (in bytes). :return None
Definition at line 156 of file tc_TcpRecv.py.
tc_TcpRecv.action |
Definition at line 299 of file tc_TcpRecv.py.
tc_TcpRecv.args = parser.parse_args() |
Definition at line 302 of file tc_TcpRecv.py.
tc_TcpRecv.count = args.loop_count |
Definition at line 474 of file tc_TcpRecv.py.
tc_TcpRecv.default |
Definition at line 281 of file tc_TcpRecv.py.
int tc_TcpRecv.dpHost = 2718 |
Definition at line 385 of file tc_TcpRecv.py.
tc_TcpRecv.fpgaClientAssociation |
Definition at line 441 of file tc_TcpRecv.py.
tuple tc_TcpRecv.fpgaServerAssociation = (str(ipFpga), portFpgaServer) |
Definition at line 338 of file tc_TcpRecv.py.
tc_TcpRecv.help |
Definition at line 282 of file tc_TcpRecv.py.
Definition at line 386 of file tc_TcpRecv.py.
tc_TcpRecv.hostname = socket.gethostname() |
Definition at line 366 of file tc_TcpRecv.py.
tc_TcpRecv.instId = getInstanceId(args) |
Definition at line 314 of file tc_TcpRecv.py.
tc_TcpRecv.int |
Definition at line 283 of file tc_TcpRecv.py.
tc_TcpRecv.ip4Str = ni.ifaddresses(itf)[AF_INET][0]['addr'] |
Definition at line 373 of file tc_TcpRecv.py.
tc_TcpRecv.ipFpga = getFpgaIpv4(args) |
Definition at line 310 of file tc_TcpRecv.py.
Definition at line 382 of file tc_TcpRecv.py.
string tc_TcpRecv.ipHostStr = socket.gethostbyname(hostname) |
Definition at line 367 of file tc_TcpRecv.py.
tc_TcpRecv.ipResMngr = getResourceManagerIpv4(args) |
Definition at line 318 of file tc_TcpRecv.py.
tc_TcpRecv.portFpgaServer = XMIT_MODE_LSN_PORT |
Definition at line 322 of file tc_TcpRecv.py.
tc_TcpRecv.portResMngr = getResourceManagerPort(args) |
Definition at line 326 of file tc_TcpRecv.py.
tc_TcpRecv.reqMsgAsBytes = struct.pack(">IHH", ipHost, dpHost, 0) |
Definition at line 419 of file tc_TcpRecv.py.
tc_TcpRecv.seed = args.seed |
Definition at line 456 of file tc_TcpRecv.py.
tc_TcpRecv.size = args.size |
Definition at line 464 of file tc_TcpRecv.py.
tc_TcpRecv.str |
Definition at line 281 of file tc_TcpRecv.py.
tc_TcpRecv.tcpClientSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
Definition at line 343 of file tc_TcpRecv.py.
tc_TcpRecv.tcpListenSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
Definition at line 392 of file tc_TcpRecv.py.
tc_TcpRecv.tcpServerSock |
Definition at line 441 of file tc_TcpRecv.py.
int tc_TcpRecv.TODO_MAX_SEG_SIZE = 2048 |
Definition at line 463 of file tc_TcpRecv.py.
tc_TcpRecv.type |
Definition at line 281 of file tc_TcpRecv.py.
tc_TcpRecv.verbose = args.verbose |
Definition at line 478 of file tc_TcpRecv.py.