cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
test_arp.hpp
Go to the documentation of this file.
1 
2 /*
3  * Copyright 2016 -- 2021 IBM Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 
31 #ifndef _TEST_ARP_H_
32 #define _TEST_ARP_H_
33 
34 #include <hls_stream.h>
35 #include <map>
36 #include <stdio.h>
37 #include <string>
38 
39 #include "../src/arp.hpp"
40 #include "../../../NTS/nts_types.hpp"
41 #include "../../../NTS/nts_utils.hpp"
42 #include "../../../NTS/SimNtsUtils.hpp"
43 #include "../../../NTS/SimArpPacket.hpp"
44 #include "../../../NTS/SimEthFrame.hpp"
45 #include "../../../NTS/SimIp4Packet.hpp"
46 
47 //---------------------------------------------------------
48 //-- TESTBENCH GLOBAL DEFINES
49 // 'TB_STARTUP_DELAY' is used to delay the start of the [TB] functions.
50 // 'TB_GRACE_TIME' adds some cycles to drain the DUT at the end before.
51 //---------------------------------------------------------
52 #define TB_MAX_SIM_CYCLES 25000
53 #define TB_STARTUP_DELAY 0
54 #define TB_GRACE_TIME 500
55 
56 #define CAM_LOOKUP_LATENCY 2
57 #define CAM_UPDATE_LATENCY 10
58 
59 const Ip4Addr RESERVED_SENDER_PROTOCOL_ADDRESS = 0xCAFEFADE; // Do not use in DAT files
60 
61 //---------------------------------------------------------
62 //-- TESTBENCH GLOBAL VARIABLES
63 //-- These variables might be updated/overwritten by the
64 //-- content of a test-vector file.
65 //---------------------------------------------------------
68 unsigned int gSimCycCnt;
69 unsigned int gMaxSimCycles;
70 
71 #endif
72 
const Ip4Addr RESERVED_SENDER_PROTOCOL_ADDRESS
Definition: test_arp.hpp:59
unsigned int gMaxSimCycles
Definition: test_arp.hpp:69
unsigned int gSimCycCnt
Definition: test_arp.hpp:68
bool gTraceEvent
Definition: test_arp.hpp:66
bool gFatalError
Definition: test_arp.hpp:67
ap_uint< 32 > Ip4Addr
Definition: AxisIp4.hpp:169