|
cloudFPGA (cF) API
1.0
The documentation of the source code of cloudFPGA (cF)
|
Functions | |
| def | tcp_tx (sock, message, count, verbose=False) |
| def | tcp_rx (sock, message, count, verbose) |
| def | waitUntilSocketPairCanBeReused (ipFpga, portFpga) |
| def | tcp_txrx_loop (sock, message, count, verbose=False) |
| def | tcp_txrx_ramp (sock, message, count, verbose=False) |
Variables | |
| string | gEchoRxPath = './echoRx.dat' |
| string | gEchoTxPath = './echoTx.dat' |
| int | rc = 0 |
| parser = argparse.ArgumentParser(description='A script to send/receive TCP data to/from an FPGA module.') | |
| type | |
| str | |
| default | |
| help | |
| int | |
| action | |
| args = parser.parse_args() | |
| ipFpga = getFpgaIpv4(args) | |
| instId = getInstanceId(args) | |
| ipResMngr = getResourceManagerIpv4(args) | |
| portFpga = getFpgaPort(args) | |
| portResMngr = getResourceManagerPort(args) | |
| int | tcpDP = 8803 |
| tuple | fpgaAssociation = (str(ipFpga), tcpDP) |
| int | tcpSP = tcpDP + 49152 |
| tuple | hostAssociation = (ipSaStr, tcpSP) |
| tcpSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| seed = args.seed | |
| size = args.size | |
| count = args.loop_count | |
| message = str_static_gen(size) | |
| verbose = args.verbose | |
| tx_thread = threading.Thread(target=tcp_tx, args=(tcpSock, message, count, args.verbose)) | |
| rx_thread = threading.Thread(target=tcp_rx, args=(tcpSock, message, count, args.verbose)) | |
| result = filecmp.cmp(gEchoTxPath, gEchoRxPath, shallow=False) | |
| def tc_TcpEcho.tcp_rx | ( | sock, | |
| message, | |||
| count, | |||
| verbose | |||
| ) |
TCP Rx Thread. :param sock, the socket to receive from. :param message, the expected string message to be received. :param count, the number of segment to receive. :param verbose, enables verbosity. :return None
Definition at line 89 of file tc_TcpEcho.py.
| def tc_TcpEcho.tcp_tx | ( | sock, | |
| message, | |||
| count, | |||
verbose = False |
|||
| ) |
TCP Tx Thread. :param sock, the socket to send to. :param message, the random string to sent. :param count, the number of segments to send. :param verbose, enables verbosity. :return None
Definition at line 44 of file tc_TcpEcho.py.
| def tc_TcpEcho.tcp_txrx_loop | ( | sock, | |
| message, | |||
| count, | |||
verbose = False |
|||
| ) |
TCP Tx-Rx Single-Thread Loop. :param sock The socket to send/receive to/from. :param message The message string to sent. :param count The number of segments send. :param verbose Enables verbosity. :return None
Definition at line 153 of file tc_TcpEcho.py.
| def tc_TcpEcho.tcp_txrx_ramp | ( | sock, | |
| message, | |||
| count, | |||
verbose = False |
|||
| ) |
TCP Tx-Rx Single-Thread Ramp. :param sock The socket to send/receive to/from. :param message The message string to sent. :param count The number of segments to send. :param verbose Enables verbosity. :return None
Definition at line 234 of file tc_TcpEcho.py.
| def tc_TcpEcho.waitUntilSocketPairCanBeReused | ( | ipFpga, | |
| portFpga | |||
| ) |
Check and wait until the a socket pair can be reused.
[INFO] When a client or a server initiates an active close, then the same destination socket
(i.e. the same IP address / TCP port number) cannot be re-used immediately because
of security issues. Therefore, a closed connection must linger in a 'TIME_WAIT' or
'FIN_WAIT' state for as long as 2xMSL (Maximum Segment Lifetime), which corresponds
to twice the time a TCP segment might exist in the internet system. The MSL is
arbitrarily defined to be 2 minutes long.
:param ipFpga: the IP address of FPGA.
:param portFpga: the TCP port of the FPGA.
:return: nothing
Definition at line 129 of file tc_TcpEcho.py.
| tc_TcpEcho.action |
Definition at line 322 of file tc_TcpEcho.py.
| tc_TcpEcho.args = parser.parse_args() |
Definition at line 335 of file tc_TcpEcho.py.
| tc_TcpEcho.count = args.loop_count |
Definition at line 449 of file tc_TcpEcho.py.
| tc_TcpEcho.default |
Definition at line 310 of file tc_TcpEcho.py.
Definition at line 377 of file tc_TcpEcho.py.
| string tc_TcpEcho.gEchoRxPath = './echoRx.dat' |
Definition at line 41 of file tc_TcpEcho.py.
| string tc_TcpEcho.gEchoTxPath = './echoTx.dat' |
Definition at line 42 of file tc_TcpEcho.py.
| tc_TcpEcho.help |
Definition at line 311 of file tc_TcpEcho.py.
| tuple tc_TcpEcho.hostAssociation = (ipSaStr, tcpSP) |
Definition at line 389 of file tc_TcpEcho.py.
| tc_TcpEcho.instId = getInstanceId(args) |
Definition at line 347 of file tc_TcpEcho.py.
| tc_TcpEcho.int |
Definition at line 312 of file tc_TcpEcho.py.
| tc_TcpEcho.ipFpga = getFpgaIpv4(args) |
Definition at line 343 of file tc_TcpEcho.py.
| tc_TcpEcho.ipResMngr = getResourceManagerIpv4(args) |
Definition at line 351 of file tc_TcpEcho.py.
| tc_TcpEcho.message = str_static_gen(size) |
Definition at line 453 of file tc_TcpEcho.py.
| tc_TcpEcho.parser = argparse.ArgumentParser(description='A script to send/receive TCP data to/from an FPGA module.') |
Definition at line 309 of file tc_TcpEcho.py.
| tc_TcpEcho.portFpga = getFpgaPort(args) |
Definition at line 355 of file tc_TcpEcho.py.
| tc_TcpEcho.portResMngr = getResourceManagerPort(args) |
Definition at line 359 of file tc_TcpEcho.py.
| int tc_TcpEcho.rc = 0 |
| tc_TcpEcho.result = filecmp.cmp(gEchoTxPath, gEchoRxPath, shallow=False) |
Definition at line 476 of file tc_TcpEcho.py.
| tc_TcpEcho.rx_thread = threading.Thread(target=tcp_rx, args=(tcpSock, message, count, args.verbose)) |
Definition at line 465 of file tc_TcpEcho.py.
| tc_TcpEcho.seed = args.seed |
Definition at line 434 of file tc_TcpEcho.py.
| tc_TcpEcho.size = args.size |
Definition at line 440 of file tc_TcpEcho.py.
| tc_TcpEcho.str |
Definition at line 310 of file tc_TcpEcho.py.
| int tc_TcpEcho.tcpDP = 8803 |
Definition at line 376 of file tc_TcpEcho.py.
| tc_TcpEcho.tcpSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
Definition at line 399 of file tc_TcpEcho.py.
Definition at line 388 of file tc_TcpEcho.py.
| tc_TcpEcho.tx_thread = threading.Thread(target=tcp_tx, args=(tcpSock, message, count, args.verbose)) |
Definition at line 464 of file tc_TcpEcho.py.
| tc_TcpEcho.type |
Definition at line 310 of file tc_TcpEcho.py.
| tc_TcpEcho.verbose = args.verbose |
Definition at line 457 of file tc_TcpEcho.py.