lib_ethernet and ET_LOAD_STORE

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
CousinItt
Respected Member
Posts: 361
Joined: Wed May 31, 2017 6:55 pm

lib_ethernet and ET_LOAD_STORE

Post by CousinItt »

Hi all,

I'm having problems with random ET_LOAD_STORE faults in lib_ethernet, the 3 Aug 18 rev (3.4.0rc2 I think) from Github. Having searched for similar problems here, I've tried tinkering with the build options for the library.

Dropping the optimization level to 2 in the following line seems to fix it.

Code: Select all

MODULE_XCC_FLAGS = $(XCC_FLAGS) -g -O3 -mno-dual-issue
The following line I've left untouched.

Code: Select all

XCC_FLAGS_mii_master.xc = $(XCC_FLAGS) -O3 -fschedule -g0 -mno-dual-issue
Is anyone aware of any problems in making this change?

By the way I'm fairly sure this isn't a hardware problem. It's an XMOS eXplorerKIT and I've checked the supply voltages.

[edit] Also I'm still using xTIMEcomposer 14.3.3 on Windows.

Thanks


User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

What xMII mode are you using? RGMII, MII real time, or MII lite?
User avatar
CousinItt
Respected Member
Posts: 361
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

The code for the ethernet tile follows the example in AN00199 fairly closely, using RGMII.

BTW the example uses the -Os switch for the application code on that tile (similar to below), whereas I'm using -O2.

Code: Select all

void tile_9_tasks
(
   server ethernet_rx_if i_rx[n_eth],
   server ethernet_tx_if i_tx[n_eth],
   static const unsigned n_eth,
   server eth_cfg_proxy_if prif
)
{
   ethernet_cfg_if i_cfg[NUM_CFG_CLIENTS];
   streaming chan c_rgmii_cfg;
   smi_if i_smi;

   par
   {
      rgmii_ethernet_mac(i_rx, n_eth, i_tx, n_eth, null, null, c_rgmii_cfg, rgmii_ports, ETHERNET_DISABLE_SHAPER);
      smi(i_smi, p_smi_mdio, p_smi_mdc);
      [[combine]]
      par
      {
         rgmii_ethernet_mac_config(i_cfg, NUM_CFG_CLIENTS, c_rgmii_cfg);
         ar8035_phy_driver(i_smi, i_cfg[CFG_TO_PHY_DRIVER]);
         eth_config_proxy(i_cfg[CFG_TO_IP], prif);
      }
   }
}
User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

I can't help but wonder if it's in your ethernet config proxy? Or is that proven elsewhere? I suppose it would be interesting to try running without SMI (and force the link up in software). You have lots of the same interface stuff running on the same core.
User avatar
CousinItt
Respected Member
Posts: 361
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

Hi akp,

I don't think it's the proxy. It's fairly innocuous and inactive once initial configuration is complete. Code is included below. The only reason it's there is to work around a problem with xc. See https://www.xcore.com/viewtopic.php?p=36862

I don't know enough about SMI to replace it at the moment, and I'm not sure it's worth the investment if the -O2 switch works. Please see the code and app note for the AN00199 example. This has a very similar setup, apart from using direct core assignment for the combinable rgmii_ethernet_mac_config and ar8035_phy_driver in main, whereas I use [[combine]] with a nested par and include the combinable proxy with them.

Any other thoughts? Thanks for your input so far.

Code: Select all

[[combinable]]
void eth_config_proxy
(
   client ethernet_cfg_if cfg_if,
   server eth_cfg_proxy_if prif
)
{
   // just echo particular requests...
   while(1)
   {
      select
      {
         case prif.set_macaddr(size_t ifnum, uint8_t mac_address[MACADDR_NUM_BYTES]):

            uint8_t macad[MACADDR_NUM_BYTES];

            for(unsigned i; i < MACADDR_NUM_BYTES; i++)
            {
               macad[i] = mac_address[i];
            }

            cfg_if.set_macaddr(ifnum, macad);
            break;

         case prif.add_macaddr_filter(size_t client_num, int is_hp, ethernet_macaddr_filter_t entry)
               -> ethernet_macaddr_filter_result_t result:
            result = cfg_if.add_macaddr_filter(client_num, is_hp, entry);
            break;

         case prif.add_ethertype_filter(size_t client_num, uint16_t ethertype):
            cfg_if.add_ethertype_filter(client_num, ethertype);
            break;
      }
   }
}
User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

Yeah I suppose I didn't read your post, I thought you were still having problems with the exception at -O2. There shouldn't be any big trouble using -O2 I wouldn't think. The high speed stuff is all assembly anyway.
User avatar
CousinItt
Respected Member
Posts: 361
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

OK thanks. When I have a bit of time I might also check the effect of using the original switches for the library but adding the no-dual-issue switch for the non-library code on that tile.