cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
test_retransmit_timer_todo.cpp
Go to the documentation of this file.
1 
26 #include "retransmit_timer.hpp"
27 
28 using namespace hls;
29 
30 int main()
31 {
32 #pragma HLS inline region off
33  //axiWord inData;
34  event evOut;
35  stream<rxRetransmitTimerUpdate> rxEng_clearTimer;
36  stream<txRetransmitTimerSet> txEng_setTimer;
37  stream<event> eventFifoOut;
38  stream<ap_uint<16> > releaseSessionFifoOut;
39  stream<appNotification> notificationFifoOut;
40 
41  //std::ifstream inputFile;
42  std::ofstream outputFile;
43 
44  /*inputFile.open("/home/dsidler/workspace/toe/retransmit_timer/in.dat");
45 
46  if (!inputFile)
47  {
48  std::cout << "Error: could not open test input file." << std::endl;
49  return -1;
50  }*/
51  outputFile.open("/home/dasidler/toe/hls/toe/retransmit_timer/out.dat");
52  if (!outputFile)
53  {
54  std::cout << "Error: could not open test output file." << std::endl;
55  }
56 
57  uint32_t count = 0;
58  txEng_setTimer.write(txRetransmitTimerSet(7));
59  while (count < 50000)
60  {
61  if (count == 10 || count == 15)
62  {
63  txEng_setTimer.write(txRetransmitTimerSet(7));
64  }
65 
66 
67  retransmit_timer(rxEng_clearTimer, txEng_setTimer, eventFifoOut, releaseSessionFifoOut, notificationFifoOut);
68  if(!eventFifoOut.empty())
69  {
70  eventFifoOut.read(evOut);
71  outputFile << "Event happened, ID: " << evOut.sessionID;// << std::endl;
72  outputFile << "\t\t Count: " << count << std::endl;
73  }
74  count++;
75  }
76 
77 
78  //should return comparison
79 
80  return 0;
81 }