aboutsummaryrefslogtreecommitdiffstats
path: root/sources/api/board.h
diff options
context:
space:
mode:
authorAtaberk <olgunataberk@gmail.com>2022-09-25 17:22:03 +0200
committerAtaberk <olgunataberk@gmail.com>2022-09-25 17:22:03 +0200
commitdc0b3db1b4f1895a07e5fe280ee3790e87f97b9f (patch)
treeb47203aa281bdd959def4451c84d310cd9cf2e12 /sources/api/board.h
downloaddram-bender-dc0b3db1b4f1895a07e5fe280ee3790e87f97b9f.tar.gz
Initial commit
Diffstat (limited to 'sources/api/board.h')
-rw-r--r--sources/api/board.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/sources/api/board.h b/sources/api/board.h
new file mode 100644
index 0000000..0935392
--- /dev/null
+++ b/sources/api/board.h
@@ -0,0 +1,35 @@
+#include <string>
+
+#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);
+ ~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;
+ 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