I've taken the webserver demo and attempted to graft it into AN00199_gigabit_ethernet_demo on my xCORE-200 MC AUDIO board. The basic steps were: copy the supporting files & functions from the webserver demo, and change main to what's shown below.
It works, but serving the files are *extremely* slow. The button & switch images, which are 7k bytes or so, take about 5 seconds to load (I can actually watch the images load from top to bottom like in the old days with modems.) The data rate seems to be something like
7000bytes * 6images * 10 bits/byte = 420000 bits/second, which is about 0.42% utilization of the 100MBPS link.
Any idea why it's so slow?
I didn't see a webserver example for the RGMII, so I don't know if I got the initialization calls right or not.
Thanks!
-Caleb
Code: Select all
int main()
{
chan c_xtcp[1];
chan gpio_control, gpio_results;
ethernet_cfg_if i_cfg[NUM_CFG_CLIENTS];
ethernet_rx_if i_rx[NUM_ETH_CLIENTS];
ethernet_tx_if i_tx[NUM_ETH_CLIENTS];
streaming chan c_rgmii_cfg;
smi_if i_smi;
par {
on tile[1]: rgmii_ethernet_mac(i_rx, NUM_ETH_CLIENTS,
i_tx, NUM_ETH_CLIENTS,
null, null,
c_rgmii_cfg,
rgmii_ports,
ETHERNET_DISABLE_SHAPER);
on tile[1].core[0]: rgmii_ethernet_mac_config(i_cfg, NUM_CFG_CLIENTS, c_rgmii_cfg);
on tile[1].core[0]: ar8035_phy_driver(i_smi, i_cfg[CFG_TO_PHY_DRIVER]);
on tile[1].core[0]: my_gpio_process(gpio_control, gpio_results);
on tile[1]: smi(i_smi, p_smi_mdio, p_smi_mdc);
// TCP component
on tile[0]: xtcp(c_xtcp, 1,
null,
i_cfg[0],
i_rx[0],
i_tx[0],
null,
0,
null,
otp_ports,
ipconfig);
/* This function runs in a separate core and handles the TCP events
* i.e the HTTP connections from the above TCP server task
* through the channel 'c_xtcp[0]'
*/
on tile[0]: http_handler(c_xtcp[0]);
// on tile[0]: icmp_server(i_cfg[CFG_TO_ICMP],
// i_rx[ETH_TO_ICMP], i_tx[ETH_TO_ICMP],
// ip_address, otp_ports);
}
return 0;
}