26 #ifndef MODELS_ORCA_VIRTUAL_ETHERNET_INCLUDE_NETBRIDGE_HPP_ 27 #define MODELS_ORCA_VIRTUAL_ETHERNET_INCLUDE_NETBRIDGE_HPP_ 40 #ifndef NETSOCKET_CLIENT_ADDRESS 41 #define NETSOCKET_CLIENT_ADDRESS "127.0.0.1" 42 #pragma message "ip address for socket client undefined, default is localhost" 45 #ifndef NETSOCKET_CLIENT_PORT 46 #define NETSOCKET_CLIENT_PORT 5000 47 #pragma message "port number for socket client undefined, default is 5000" 50 #ifndef NETSOCKET_SERVER_ADDRESS 51 #define NETSOCKET_SERVER_ADDRESS "127.0.0.1" 52 #pragma message "ip address for socket server undefined, default is localhost" 55 #ifndef NETSOCKET_SERVER_PORT 56 #define NETSOCKET_SERVER_PORT 5001 57 #pragma message "port number for socket server undefined, default is 5001" 71 :
std::runtime_error(w) {}
85 int get_socket()
const;
87 std::string get_addr()
const;
89 int send(
const char *msg,
size_t size);
98 int get_socket()
const;
100 std::string get_addr()
const;
102 int recv(
char *msg,
size_t max_size);
103 int timed_recv(
char *msg,
size_t max_size,
int max_wait_ms);
119 #define RECV_BUFFER_LEN 128 120 #define SEND_BUFFER_LEN 128 122 #define HWBUFFER_LEN 16 161 #ifdef NETBRIDGE_ENABLE_LOG_INPUT 165 #ifdef NETBRIDGE_ENABLE_LOG_OUTPUT 166 uint32_t _trafficOut;
193 void LogWrite(std::string);
196 uint8_t* GetBuffer();
199 void udpToNocProcess();
200 void nocToUdpProcess();
203 static void* udpRecvThread(
void*);
222 #endif // MODELS_ORCA_VIRTUAL_ETHERNET_INCLUDE_NETBRIDGE_HPP_ The Signal class models a generic bus of width equals to the sizeof(T)
This class models a TimedModel.
std::ofstream output_debug
NetBridgeSendState _send_state
Signal< int8_t > * _signal_recv
uint32_t _flits_to_send_count
volatile int udpRecvThread_terminate
NetBridgeRecvState _recv_state
struct addrinfo * f_addrinfo
struct addrinfo * f_addrinfo
udp_client_server_runtime_error(const char *w)
std::ofstream output_uart
uint32_t _flits_to_recv_count