Fakernet is a fast FPGA-based TCP/IP data source with UDP control channels.
The FPGA board needs a PHY interface.
No special kernel/OS drivers are needed.
The network connection to a controlling computer uses ordinary Ethernet equipment.
Typical use case: data acquisition.
See README (included with download).
A short slide-show presentation.
Another short slide-show presentation.
Testing with a Arty A7-35 board (100 Mbps).
NTP server with a Arty A7-35 board and GPS.
0.5 ns signal sampler with a Arty A7-35 board.
Direct LMD data generation for DAQ or analysis consumption.
Testing with a ALINX AX7101 board (1 Gbps).
entity fakernet_module is generic (-- Size of output (TCP) data buffer data_bufsize_addrbits : natural); port (clk : in std_logic; -- Config cfg_macaddr : in std_logic_vector (47 downto 0); cfg_ipaddr : in std_logic_vector (31 downto 0); -- Input network traffic in_word : in std_logic_vector(15 downto 0); in_got_word : in std_logic; in_new_packet : in std_logic; -- Output network traffic out_word : out std_logic_vector(15 downto 0); out_ena : out std_logic; out_payload : out std_logic; out_taken : in std_logic; -- Register access interface (UDP access) reg_addr : out std_logic_vector(24 downto 0); reg_data_wr : out std_logic_vector(31 downto 0); reg_data_rd : in std_logic_vector(31 downto 0); reg_write : out std_logic; reg_read : out std_logic; reg_done : in std_logic; reg_cnt : out std_logic_vector(3 downto 0); -- Data input interface (for TCP stream) data_word : in std_logic_vector(31 downto 0); data_offset : in std_logic_vector; data_write : in std_logic; data_commit_len: in std_logic_vector; data_commit : in std_logic; data_free : out std_logic; tcp_reset : out std_logic; -- Signals to drive RTT estimate and timeouts slow_clock_tick : in std_logic; timeout_tick : in std_logic; ); end;
/* Establish UDP connection. */ struct fnet_ctrl_client * fnet_ctrl_connect(const char *server, int reliable); /* Close connection. */ int fnet_ctrl_close(struct fnet_ctrl_client *client); /* Retrieve pointers to prepare UDP register access. */ void fnet_ctrl_get_send_recv_bufs(struct fnet_ctrl_client *client, fakernet_reg_acc_item **send, fakernet_reg_acc_item **recv); /* Perform UDP register access. */ int fnet_ctrl_send_recv_regacc(struct fnet_ctrl_client *client, int num_items); /* Reset TCP connection (done via UDP). */ int fnet_ctrl_reset_tcp(struct fnet_ctrl_client *client);
fd = socket(TCP); connect(fd, ip4_addr); for ( ; ; ) read(fd, buffer, n);
Last modified: Sun Dec 18 23:25:18 CET 2022