289fbb3e2f6f327a7720d6703bb24ebece51a1c7
[riscv-isa-sim.git] / riscv / remote_bitbang.h
1 #ifndef REMOTE_BITBANG_H
2 #define REMOTE_BITBANG_H
3
4 #include <stdint.h>
5
6 #include "jtag_dtm.h"
7
8 class remote_bitbang_t
9 {
10 public:
11 // Create a new server, listening for connections from localhost on the given
12 // port.
13 remote_bitbang_t(uint16_t port, jtag_dtm_t *tap);
14
15 // Do a bit of work.
16 void tick();
17
18 private:
19 jtag_dtm_t *tap;
20
21 int socket_fd;
22 int client_fd;
23
24 // Check for a client connecting, and accept if there is one.
25 void accept();
26 // Execute any commands the client has for us.
27 void execute_commands();
28 };
29
30 #endif