aboutsummaryrefslogtreecommitdiffstats
path: root/sources/api/board.h
blob: c1ef60d111ea8095699a584be1a91e30b48ddc5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <string>
#include <sys/types.h>

#ifndef BOARD_H
#define BOARD_H
/** This class defines how the host
 * interfaces with the board.
 */
class BoardInterface{
  const uint SEND_BUF_SIZE = 32*2048;
              // send each instruction as a 256-bit packet
  const uint RECV_BUF_SIZE = 1024*32;
  const std::string TO_FPGA_DEFAULT = "/dev/xdma0_h2c_0";
  const std::string FROM_FPGA_DEFAULT = "/dev/xdma0_c2h_0";
public:
  enum class IFACE {
      XDMA = 0
  };
  BoardInterface(IFACE, int dimm_select = 0);
  ~BoardInterface();
  int init();
  int sendData(void* data, const uint size);
  int recvData(void* buf , const uint size);
private:
  IFACE iface_type;
  // XDMA related constructs
  int to_card;
  int from_card;
  int dimm_select;
  void* send_buf;
  void* recv_buf;
  int xdma_send(void* data, const uint size);
  int xdma_recv(void* buf,  const uint size);
  // end XDMA related constructs
};

#endif