cloudFPGA (cF) API
1.0
The documentation of the source code of cloudFPGA (cF)
|
Testbench for the IP Transmitter packet handler (IPTX) of the Network Transport Stack (NTS). More...
Macros | |
#define | THIS_NAME "TB" |
#define | TRACE_OFF 0x0000 |
#define | TRACE_CGF 1 << 1 |
#define | TRACE_ARP 1 << 2 |
#define | TRACE_ALL 0xFFFF |
#define | DEBUG_LEVEL (TRACE_OFF) |
#define | TB_MAX_SIM_CYCLES 25000 |
#define | TB_STARTUP_DELAY 0 |
#define | TB_GRACE_TIME 500 |
Functions | |
void | stepSim () |
Increment the simulation counter. More... | |
void | pEmulateArp (stream< Ip4Addr > &siIPTX_LookupReq, stream< ArpLkpReply > &soIPTX_LookupRep, EthAddr piMacAddress, Ip4Addr piIp4Address, Ip4Addr piSubNetMask, Ip4Addr piGatewayAddr) |
Emulate the behavior of the Address Resolution Process (ARP). More... | |
int | createGoldenFile (string inpDAT_FileName, string outDAT_GoldName, EthAddr myMacAddress, Ip4Addr myIp4Address, Ip4Addr mySubNetMask, Ip4Addr myGatewayAddr) |
Create the golden reference file from an input test file. More... | |
void | iptx_top_wrap (EthAddr piMMIO_MacAddress, Ip4Addr piMMIO_SubNetMask, Ip4Addr piMMIO_GatewayAddr, stream< AxisIp4 > &siL3MUX_Data, stream< AxisEth > &soL2MUX_Data, stream< Ip4Addr > &soARP_LookupReq, stream< ArpLkpReply > &siARP_LookupRep) |
A wrapper for the Toplevel of IP the IP Transmitter Handler (IPTX). More... | |
int | main (int argc, char *argv[]) |
Main function. More... | |
Variables | |
bool | gTraceEvent |
bool | gFatalError |
unsigned int | gSimCycCnt |
unsigned int | gMaxSimCycles |
Testbench for the IP Transmitter packet handler (IPTX) of the Network Transport Stack (NTS).
#define DEBUG_LEVEL (TRACE_OFF) |
Definition at line 46 of file test_iptx.cpp.
#define TB_GRACE_TIME 500 |
Definition at line 46 of file test_iptx.hpp.
#define TB_MAX_SIM_CYCLES 25000 |
Definition at line 44 of file test_iptx.hpp.
#define TB_STARTUP_DELAY 0 |
Definition at line 45 of file test_iptx.hpp.
#define THIS_NAME "TB" |
Definition at line 39 of file test_iptx.cpp.
#define TRACE_ALL 0xFFFF |
Definition at line 44 of file test_iptx.cpp.
#define TRACE_ARP 1 << 2 |
Definition at line 43 of file test_iptx.cpp.
#define TRACE_CGF 1 << 1 |
Definition at line 42 of file test_iptx.cpp.
#define TRACE_OFF 0x0000 |
Definition at line 41 of file test_iptx.cpp.
int createGoldenFile | ( | string | inpDAT_FileName, |
string | outDAT_GoldName, | ||
EthAddr | myMacAddress, | ||
Ip4Addr | myIp4Address, | ||
Ip4Addr | mySubNetMask, | ||
Ip4Addr | myGatewayAddr | ||
) |
Create the golden reference file from an input test file.
[in] | inpDAT_FileName | the input DAT file to generate from. |
[in] | outDAT_GoldName | the output DAT gold file to create. |
[in] | myMacAddress | the MAC address of the FPGA. |
[in] | myIp4Address | the IPv4 address of the FPGA. |
[in] | mySubNetMask | The sub-network-mask. |
[in] | myGatewayAddr | The default gateway address. |
Definition at line 138 of file test_iptx.cpp.
void iptx_top_wrap | ( | EthAddr | piMMIO_MacAddress, |
Ip4Addr | piMMIO_SubNetMask, | ||
Ip4Addr | piMMIO_GatewayAddr, | ||
stream< AxisIp4 > & | siL3MUX_Data, | ||
stream< AxisEth > & | soL2MUX_Data, | ||
stream< Ip4Addr > & | soARP_LookupReq, | ||
stream< ArpLkpReply > & | siARP_LookupRep | ||
) |
A wrapper for the Toplevel of IP the IP Transmitter Handler (IPTX).
[in] | piMMIO_MacAddress | The MAC address from MMIO (in network order). |
[in] | piMMIO_SubNetMask | The sub-network-mask from [MMIO]. |
[in] | piMMIO_GatewayAddr | The default gateway address from [MMIO]. |
[in] | siL3MUX_Data | The IP4 data stream from the L3 Multiplexer (L3MUX). |
[out] | soL2MUX_Data | The ETH data stream to the L2 Multiplexer (L2MUX). |
[out] | soARP_LookupReq | The IP4 address lookup request to AddressResolutionProtocol (ARP). |
[in] | siARP_LookupRep | The MAC address looked-up from [ARP]. |
This process is a wrapper for the 'iptx_top' entity. It instantiates an 'iptx_top' entity and connects it with the appropriate 'AxisRaw' streams instead of the derived stream classes which are not supported by the interface synthesis optimization of Vivado HLS.
Definition at line 328 of file test_iptx.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function.
[in] | argv[1] | The filename of an input test vector (.e.g, ../../../../test/testVectors/siTOE_OnePkt.dat) |
Definition at line 368 of file test_iptx.cpp.
void pEmulateArp | ( | stream< Ip4Addr > & | siIPTX_LookupReq, |
stream< ArpLkpReply > & | soIPTX_LookupRep, | ||
EthAddr | piMacAddress, | ||
Ip4Addr | piIp4Address, | ||
Ip4Addr | piSubNetMask, | ||
Ip4Addr | piGatewayAddr | ||
) |
Emulate the behavior of the Address Resolution Process (ARP).
[in] | siIPTX_LookupReq | ARP lookup request from [IPTX]. |
[out] | soIPTX_LookupRep | ARP lookup reply to [IPTX]. |
[in] | piMacAddress | The Ethernet MAC address of the FPGA. |
[in] | piIp4Address | The IPv4 address of the FPGA. |
[in] | piSubNetMask | The sub-network-mask from [MMIO]. |
[in] | piGatewayAddr | The default gateway address from [MMIO]. |
Definition at line 72 of file test_iptx.cpp.
void stepSim | ( | ) |
Increment the simulation counter.
Definition at line 51 of file test_iptx.cpp.
bool gFatalError |
Definition at line 54 of file test_iptx.hpp.
unsigned int gMaxSimCycles |
Definition at line 56 of file test_iptx.hpp.
unsigned int gSimCycCnt |
GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT
Definition at line 55 of file test_iptx.hpp.
bool gTraceEvent |
HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)
Definition at line 53 of file test_iptx.hpp.