rogue
Loading...
Searching...
No Matches
XvcConnection.h
Go to the documentation of this file.
1
18#ifndef __ROGUE_PROTOCOLS_XILINX_XVC_CONNECTION_H__
19#define __ROGUE_PROTOCOLS_XILINX_XVC_CONNECTION_H__
20#include "rogue/Directives.h"
21
22#include <netinet/in.h>
23#include <sys/socket.h>
24
25#include <vector>
26
27#include "rogue/GeneralError.h"
29
30namespace rogue {
31namespace protocols {
32namespace xilinx {
42 int sd_;
43 JtagDriver* drv_;
44 struct sockaddr_in peer_;
45
46 // just use vectors to back raw memory; DONT use 'size/resize'
47 // (unfortunately 'resize' fills elements beyond the current 'size'
48 // with zeroes)
49
50 uint8_t* rp_;
51 vector<uint8_t> rxb_;
52 uint64_t rl_;
53 uint64_t tl_;
54
55 vector<uint8_t> txb_;
56 uint64_t maxVecLen_;
57 uint64_t supVecLen_;
58 uint64_t chunk_;
59
60 public:
68 XvcConnection(int sd, JtagDriver* drv, uint64_t maxVecLen_ = 32768);
69
75 virtual void fill(uint64_t n);
76
80 virtual void flush();
81
87 virtual void bump(uint64_t n);
88
92 virtual void allocBufs();
93
97 virtual void run();
98
106 ssize_t readTo(void* buf, size_t count);
107
109 virtual ~XvcConnection();
110};
111} // namespace xilinx
112} // namespace protocols
113} // namespace rogue
114
115#endif
Base transport driver for the AxisToJtag firmware protocol.
Definition JtagDriver.h:68
Manages one TCP client connection speaking the XVC protocol.
ssize_t readTo(void *buf, size_t count)
Reads up to count bytes with timeout.
virtual void flush()
Flushes pending TX buffer bytes to socket.
virtual void fill(uint64_t n)
Ensures at least n bytes are available in RX buffer.
virtual void run()
Runs command processing loop for this connection.
virtual ~XvcConnection()
Closes this XVC TCP sub-connection.
virtual void bump(uint64_t n)
Marks n RX bytes as consumed.
virtual void allocBufs()
Allocates/reinitializes internal RX/TX buffers.