cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
test_close_timer_todo.cpp File Reference
#include "close_timer.hpp"
Include dependency graph for test_close_timer_todo.cpp:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 30 of file test_close_timer_todo.cpp.

31 {
32 #pragma HLS inline region off
33  //axiWord inData;
34  ap_uint<16> outData;
35  stream<ap_uint<16> > timeWaitFifo;
36  stream<ap_uint<16> > sessionReleaseFifo;
37 
38  //std::ifstream inputFile;
39  std::ofstream outputFile;
40 
41  /*inputFile.open("/home/dsidler/workspace/toe/retransmit_timer/in.dat");
42 
43  if (!inputFile)
44  {
45  std::cout << "Error: could not open test input file." << std::endl;
46  return -1;
47  }*/
48  outputFile.open("/home/dasidler/toe/hls/toe/close_timer/out.dat");
49  if (!outputFile)
50  {
51  std::cout << "Error: could not open test output file." << std::endl;
52  }
53 
54  uint32_t count = 0;
55  uint32_t setCount = 0;
56  timeWaitFifo.write(1);
57  timeWaitFifo.write(2);
58  while (count < 2147483647)
59  {
60 
61  if ((count % 1000000000) == 0)
62  {
63  outputFile << "set new timer, count: " << count << std::endl;
64  timeWaitFifo.write(1);
65  setCount = count;
66  }
67 
68  close_timer(timeWaitFifo, sessionReleaseFifo);
69  while(!sessionReleaseFifo.empty())
70  {
71  double dbcount = count - setCount;
72  sessionReleaseFifo.read(outData);
73  outputFile << "Event fired at count: " << count;
74  outputFile << " ID: " << outData;// << std::endl;
75  outputFile << " Time[s]: " << ((dbcount * 6.66) /1000000000) << std::endl;
76  }
77  count++;
78  }
79 
80 
81  //should return comparison
82 
83  return 0;
84 }