1) What is the minimum number of threads required to run embedded ethernet applications:
Looking at the provided examples Test3.xc
Code: Select all
int main()
{
chan rx[1], tx[1];
par
{
on stdcore[2]:
{
int mac_address[2];
ethernet_getmac_otp((mac_address, char[]));
phy_init(clk_smi, clk_mii_ref,
#ifdef PORT_ETH_RST_N
p_mii_resetn,
#else
null,
#endif
smi,
mii);
ethernet_server(mii, clk_mii_ref, mac_address,
rx, 1,
tx, 1,
null,
null);
}
on stdcore[0] : demo(tx[0], rx[0]);
}
return 0;
}
Code: Select all
void ethernet_server(mii_interface_t &m,
clock clk_mii_ref,
int mac_address[],
chanend rx[],
int num_rx,
chanend tx[],
int num_tx,
smi_interface_t &?smi,
chanend ?connect_status)
{
streaming chan c;
init_mii_mem();
par {
// These thrads all communicate internally via shared memory
// packet queues
mii_rx_pins(m.p_mii_rxdv, m.p_mii_rxd, 0, c);
mii_tx_pins(m.p_mii_txd, 0);
ethernet_rx_server(rx, num_rx);
ethernet_tx_server(mac_address, tx, 1, num_tx, smi, null, connect_status);
one_port_filter(mac_address, c);
}
}
Thus Am I right in saying that embedded ethernet requires a minimum of 5 threads plus the embedded specific threads? or can it be done with less?
2) If I want to build an embedded app that uses TCP/IP over ethernet then how many threads do I need? looking at the examples it likes like I need minimum 1 more thread maybe 2, depending on usage?
3) If I need to use http (non industrial app) then I will need at least another thread, looking at the example provided in xmos_tcpip_1v0 i see:
Code: Select all
int main(void)
{
chan mac_rx[1], mac_tx[1], xtcp[1], connect_status;
par {
on stdcore[2]: uip_server(mac_rx[0], mac_tx[0],
xtcp, 1, ipconfig, connect_status);
on stdcore[2]: xhttpd(xtcp[0]);
on stdcore[2]:
{
int mac_address[2];
ethernet_getmac_otp((mac_address, char[]));
phy_init(clk_smi, clk_mii_ref,
#ifdef PORT_ETH_RST_N
p_mii_resetn,
#else
null,
#endif
smi,
mii);
ethernet_server(mii, clk_mii_ref, mac_address,
mac_rx, 1,
mac_tx, 1,
smi,
connect_status);
}
}
}
1 for TCPIP (uip_serever)
1 for xhttpd
and 5 for the ethernet server
Is this correct or am I missing something?
4) Given the the above running an embedded app on a G4 or even G2 isn't a problem, but what is possible on an L1?
Just running ethernet uses 5 of the threads leaving just 3 threads to run the embedded app. In fact at leas another thread is required for the comms over ethernet like TCP/IP or something else. But it indicates that running embedded ethernet apps is possible on an L1. Are there any other examples out there that you can share, please let me know.
5) If I need to build a simple http embedded app on an L1 is that possible, can I squeeze some of the threads together to leave enough room for a simple app? Anyone tried doing this? or am I completely insane?
regards
Al