
Marking local functions: Serdes_SsModeConfigure wait_prst_deassert wait_prst_assert Serdes_InitSpeedDuplex


Marking externally visible functions: Serdes_Init


Marking externally visible variables: initSeqSuccesSer1 initSeqSuccesSer0


Reclaiming functions:
Reclaiming variables:
Clearing address taken flags:
Symbol table:

serdes_pcs_speed_select/40 (serdes_pcs_speed_select) @0724e460
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_InitSpeedDuplex/22 
  Calls: 
serdes_pcs_set_hd/39 (serdes_pcs_set_hd) @0724e1c0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_InitSpeedDuplex/22 
  Calls: 
serdes_pcs_set_fd/38 (serdes_pcs_set_fd) @0724eee0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_InitSpeedDuplex/22 
  Calls: 
serdes_pcs_an_disable/37 (serdes_pcs_an_disable) @0724ea80
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 
  Calls: 
serdes_pcs_mii_bus_control_enable/36 (serdes_pcs_mii_bus_control_enable) @0724e9a0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 
  Calls: 
serdes_pma_loopback_disable/35 (serdes_pma_loopback_disable) @0724e8c0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 
  Calls: 
serdes_pcs_reset_finalize/34 (serdes_pcs_reset_finalize) @0724e7e0
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_Init/26 Serdes_Init/26 
  Calls: 
serdes_pcs_reset_issue/33 (serdes_pcs_reset_issue) @0724e700
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_Init/26 Serdes_Init/26 
  Calls: 
serdes_pcs_pma_init_gen2/32 (serdes_pcs_pma_init_gen2) @0724e620
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_Init/26 Serdes_Init/26 
  Calls: 
serdes_pma_loopback_enable/31 (serdes_pma_loopback_enable) @0724e540
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 
  Calls: 
serdes_pcs_wait_for_power_good/30 (serdes_pcs_wait_for_power_good) @0724e380
  Type: function
  Visibility: external public
  References: 
  Referring: 
  Availability: not_available
  Function flags: optimize_size
  Called by: Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 
  Calls: 
Eth_43_PFE_Config/29 (Eth_43_PFE_Config) @072584c8
  Type: variable
  Body removed by symtab_remove_unreachable_nodes
  Visibility: external public
  References: 
  Referring: Serdes_Init/26 (addr)
  Availability: not_available
  Varpool flags: read-only
*.LC1/28 (*.LC1) @07233438
  Type: variable definition analyzed
  Visibility: prevailing_def_ironly artificial
  References: 
  Referring: Serdes_Init/26 (read)
  Availability: available
  Varpool flags: initialized read-only const-value-known
*.LC0/27 (*.LC0) @072333a8
  Type: variable definition analyzed
  Visibility: prevailing_def_ironly artificial
  References: 
  Referring: Serdes_Init/26 (read)
  Availability: available
  Varpool flags: initialized read-only const-value-known
Serdes_Init/26 (Serdes_Init) @071e4e00
  Type: function definition analyzed
  Visibility: externally_visible public
  References: *.LC0/27 (read)*.LC1/28 (read)Eth_43_PFE_Config/29 (addr)initSeqSuccesSer0/20 (write)initSeqSuccesSer0/20 (write)initSeqSuccesSer0/20 (read)initSeqSuccesSer1/21 (write)initSeqSuccesSer1/21 (write)initSeqSuccesSer1/21 (read)initSeqSuccesSer0/20 (read)initSeqSuccesSer0/20 (write)initSeqSuccesSer1/21 (read)initSeqSuccesSer1/21 (write)initSeqSuccesSer0/20 (read)initSeqSuccesSer1/21 (read)
  Referring: 
  Availability: available
  Function flags: body optimize_size
  Called by: 
  Calls: Serdes_InitSpeedDuplex/22 Serdes_InitSpeedDuplex/22 serdes_pcs_an_disable/37 serdes_pcs_an_disable/37 serdes_pcs_mii_bus_control_enable/36 serdes_pcs_mii_bus_control_enable/36 serdes_pma_loopback_disable/35 serdes_pma_loopback_disable/35 Serdes_InitSpeedDuplex/22 Serdes_InitSpeedDuplex/22 serdes_pcs_an_disable/37 serdes_pcs_an_disable/37 serdes_pcs_mii_bus_control_enable/36 serdes_pcs_mii_bus_control_enable/36 serdes_pma_loopback_disable/35 serdes_pma_loopback_disable/35 serdes_pcs_reset_finalize/34 serdes_pcs_reset_finalize/34 serdes_pcs_reset_issue/33 serdes_pcs_pma_init_gen2/32 serdes_pma_loopback_enable/31 serdes_pma_loopback_enable/31 serdes_pcs_wait_for_power_good/30 serdes_pcs_wait_for_power_good/30 serdes_pcs_reset_issue/33 serdes_pcs_pma_init_gen2/32 serdes_pma_loopback_enable/31 serdes_pma_loopback_enable/31 serdes_pcs_wait_for_power_good/30 serdes_pcs_wait_for_power_good/30 Serdes_SsModeConfigure/25 
Serdes_SsModeConfigure/25 (Serdes_SsModeConfigure) @071e4b60
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: Serdes_Init/26 
  Calls: wait_prst_deassert/24 wait_prst_deassert/24 wait_prst_assert/23 wait_prst_assert/23 wait_prst_deassert/24 wait_prst_deassert/24 wait_prst_assert/23 wait_prst_assert/23 
wait_prst_deassert/24 (wait_prst_deassert) @071e48c0
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: Serdes_SsModeConfigure/25 Serdes_SsModeConfigure/25 Serdes_SsModeConfigure/25 Serdes_SsModeConfigure/25 
  Calls: 
wait_prst_assert/23 (wait_prst_assert) @071e4620
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: Serdes_SsModeConfigure/25 Serdes_SsModeConfigure/25 Serdes_SsModeConfigure/25 Serdes_SsModeConfigure/25 
  Calls: 
Serdes_InitSpeedDuplex/22 (Serdes_InitSpeedDuplex) @071e4380
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  References: 
  Referring: 
  Availability: local
  Function flags: body local optimize_size
  Called by: Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 Serdes_Init/26 
  Calls: serdes_pcs_speed_select/40 serdes_pcs_set_hd/39 serdes_pcs_set_fd/38 
initSeqSuccesSer1/21 (initSeqSuccesSer1) @071deab0
  Type: variable definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: Serdes_Init/26 (write)Serdes_Init/26 (write)Serdes_Init/26 (read)Serdes_Init/26 (read)Serdes_Init/26 (write)Serdes_Init/26 (read)
  Availability: available
  Varpool flags: initialized
initSeqSuccesSer0/20 (initSeqSuccesSer0) @071dea20
  Type: variable definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: Serdes_Init/26 (write)Serdes_Init/26 (write)Serdes_Init/26 (read)Serdes_Init/26 (read)Serdes_Init/26 (write)Serdes_Init/26 (read)
  Availability: available
  Varpool flags: initialized
Serdes_Init (const struct Eth_43_PFE_ConfigType * CfgPtr)
{
  pfe_emac_duplex_t pcsDuplex[4];
  pfe_emac_speed_t pcsSpeed[4];
  uint8 u8CtrlCount;
  uint32 serdesInitFlags[2];
  const struct Eth_43_PFE_ConfigType * Eth_43_PFE_CfgPtr;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  serdesInitFlags = {};
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pcsSpeed = *.LC0;
  # DEBUG BEGIN_STMT
  pcsDuplex = *.LC1;
  # DEBUG BEGIN_STMT
  Eth_43_PFE_CfgPtr = &Eth_43_PFE_Config;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = serdesInitFlags[0];
  _2 = _1 | 1024;
  serdesInitFlags[0] = _2;
  # DEBUG BEGIN_STMT
  _3 = serdesInitFlags[0];
  _4 = _3 | 262144;
  serdesInitFlags[0] = _4;
  # DEBUG BEGIN_STMT
  _5 = serdesInitFlags[1];
  _6 = _5 | 263168;
  serdesInitFlags[1] = _6;
  # DEBUG BEGIN_STMT
  u8CtrlCount = 0;
  goto <bb 14>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _7 = (int) u8CtrlCount;
  _8 = Eth_43_PFE_CfgPtr->pController[_7];
  _9 = _8->EthCtrlMiiType;
  if (_9 == 4)
    goto <bb 4>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _10 = (int) u8CtrlCount;
  _11 = Eth_43_PFE_CfgPtr->pController[_10];
  _12 = _11->EthCtrlHwPort;
  _13 = _12 + 3;
  _14 = *_13;
  if (_14 == 48)
    goto <bb 5>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _15 = (int) u8CtrlCount;
  _16 = Eth_43_PFE_CfgPtr->pController[_15];
  _17 = _16->EthCtrlSpeed;
  if (_17 == 4)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  _18 = serdesInitFlags[1];
  _19 = _18 | 517;
  serdesInitFlags[1] = _19;
  goto <bb 8>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  _20 = serdesInitFlags[1];
  _21 = _20 | 257;
  serdesInitFlags[1] = _21;

  <bb 8> :
  # DEBUG BEGIN_STMT
  _22 = serdesInitFlags[1];
  _23 = _22 & 4294966271;
  serdesInitFlags[1] = _23;
  # DEBUG BEGIN_STMT
  _24 = (int) u8CtrlCount;
  _25 = Eth_43_PFE_CfgPtr->pController[_24];
  _26 = _25->EthCtrlSpeed;
  pcsSpeed[2] = _26;
  # DEBUG BEGIN_STMT
  _27 = (int) u8CtrlCount;
  _28 = Eth_43_PFE_CfgPtr->pController[_27];
  _29 = _28->EthCtrlDuplex;
  pcsDuplex[2] = _29;

  <bb 9> :
  # DEBUG BEGIN_STMT
  _30 = (int) u8CtrlCount;
  _31 = Eth_43_PFE_CfgPtr->pController[_30];
  _32 = _31->EthCtrlHwPort;
  _33 = _32 + 3;
  _34 = *_33;
  if (_34 == 49)
    goto <bb 10>; [INV]
  else
    goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _35 = serdesInitFlags[1];
  _36 = _35 | 65537;
  serdesInitFlags[1] = _36;
  # DEBUG BEGIN_STMT
  _37 = serdesInitFlags[1];
  _38 = _37 & 4294705151;
  serdesInitFlags[1] = _38;
  # DEBUG BEGIN_STMT
  _39 = (int) u8CtrlCount;
  _40 = Eth_43_PFE_CfgPtr->pController[_39];
  _41 = _40->EthCtrlSpeed;
  pcsSpeed[3] = _41;
  # DEBUG BEGIN_STMT
  _42 = (int) u8CtrlCount;
  _43 = Eth_43_PFE_CfgPtr->pController[_42];
  _44 = _43->EthCtrlDuplex;
  pcsDuplex[3] = _44;

  <bb 11> :
  # DEBUG BEGIN_STMT
  _45 = (int) u8CtrlCount;
  _46 = Eth_43_PFE_CfgPtr->pController[_45];
  _47 = _46->EthCtrlHwPort;
  _48 = _47 + 3;
  _49 = *_48;
  if (_49 == 50)
    goto <bb 12>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  _50 = serdesInitFlags[0];
  _51 = _50 | 65537;
  serdesInitFlags[0] = _51;
  # DEBUG BEGIN_STMT
  _52 = serdesInitFlags[0];
  _53 = _52 & 4294705151;
  serdesInitFlags[0] = _53;
  # DEBUG BEGIN_STMT
  _54 = (int) u8CtrlCount;
  _55 = Eth_43_PFE_CfgPtr->pController[_54];
  _56 = _55->EthCtrlSpeed;
  pcsSpeed[1] = _56;
  # DEBUG BEGIN_STMT
  _57 = (int) u8CtrlCount;
  _58 = Eth_43_PFE_CfgPtr->pController[_57];
  _59 = _58->EthCtrlDuplex;
  pcsDuplex[1] = _59;

  <bb 13> :
  # DEBUG BEGIN_STMT
  u8CtrlCount.0_60 = u8CtrlCount;
  u8CtrlCount = u8CtrlCount.0_60 + 1;

  <bb 14> :
  # DEBUG BEGIN_STMT
  if (u8CtrlCount <= 2)
    goto <bb 3>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 15> :
  # DEBUG BEGIN_STMT
  _61 = serdesInitFlags[0];
  _62 = _61 | 2097152;
  serdesInitFlags[0] = _62;
  # DEBUG BEGIN_STMT
  _63 = serdesInitFlags[1];
  _64 = _63 | 2097152;
  serdesInitFlags[1] = _64;
  # DEBUG BEGIN_STMT
  _65 = serdesInitFlags[0];
  _66 = serdesInitFlags[1];
  Serdes_SsModeConfigure (3, _65, _66);
  # DEBUG BEGIN_STMT
  _67 = serdesInitFlags[0];
  _68 = _67 & 1048576;
  if (_68 == 0)
    goto <bb 16>; [INV]
  else
    goto <bb 19>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  _69 = serdes_pcs_wait_for_power_good (1077936128B, 0);
  if (_69 == 0)
    goto <bb 17>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 17> :
  # DEBUG BEGIN_STMT
  _70 = serdes_pcs_wait_for_power_good (1077936128B, 1);
  if (_70 == 0)
    goto <bb 18>; [INV]
  else
    goto <bb 20>; [INV]

  <bb 18> :
  # DEBUG BEGIN_STMT
  initSeqSuccesSer0 = 0;
  goto <bb 20>; [INV]

  <bb 19> :
  # DEBUG BEGIN_STMT
  initSeqSuccesSer0 = 0;

  <bb 20> :
  # DEBUG BEGIN_STMT
  initSeqSuccesSer0.1_71 = initSeqSuccesSer0;
  if (initSeqSuccesSer0.1_71 == 0)
    goto <bb 21>; [INV]
  else
    goto <bb 22>; [INV]

  <bb 21> :
  # DEBUG BEGIN_STMT
  serdes_pma_loopback_enable (1077936128B, 0);
  # DEBUG BEGIN_STMT
  serdes_pma_loopback_enable (1077936128B, 1);
  # DEBUG BEGIN_STMT
  _72 = serdesInitFlags[0];
  serdes_pcs_pma_init_gen2 (1077936128B, 1, _72);
  # DEBUG BEGIN_STMT
  serdes_pcs_reset_issue (1077936128B, 0, 1);

  <bb 22> :
  # DEBUG BEGIN_STMT
  _73 = serdesInitFlags[1];
  _74 = _73 & 1048576;
  if (_74 == 0)
    goto <bb 23>; [INV]
  else
    goto <bb 26>; [INV]

  <bb 23> :
  # DEBUG BEGIN_STMT
  _75 = serdes_pcs_wait_for_power_good (1141899264B, 0);
  if (_75 == 0)
    goto <bb 24>; [INV]
  else
    goto <bb 27>; [INV]

  <bb 24> :
  # DEBUG BEGIN_STMT
  _76 = serdes_pcs_wait_for_power_good (1141899264B, 1);
  if (_76 == 0)
    goto <bb 25>; [INV]
  else
    goto <bb 27>; [INV]

  <bb 25> :
  # DEBUG BEGIN_STMT
  initSeqSuccesSer1 = 0;
  goto <bb 27>; [INV]

  <bb 26> :
  # DEBUG BEGIN_STMT
  initSeqSuccesSer1 = 0;

  <bb 27> :
  # DEBUG BEGIN_STMT
  initSeqSuccesSer1.2_77 = initSeqSuccesSer1;
  if (initSeqSuccesSer1.2_77 == 0)
    goto <bb 28>; [INV]
  else
    goto <bb 29>; [INV]

  <bb 28> :
  # DEBUG BEGIN_STMT
  serdes_pma_loopback_enable (1141899264B, 0);
  # DEBUG BEGIN_STMT
  serdes_pma_loopback_enable (1141899264B, 1);
  # DEBUG BEGIN_STMT
  _78 = serdesInitFlags[1];
  serdes_pcs_pma_init_gen2 (1141899264B, 1, _78);
  # DEBUG BEGIN_STMT
  serdes_pcs_reset_issue (1141899264B, 0, 1);

  <bb 29> :
  # DEBUG BEGIN_STMT
  initSeqSuccesSer0.3_79 = initSeqSuccesSer0;
  if (initSeqSuccesSer0.3_79 == 0)
    goto <bb 30>; [INV]
  else
    goto <bb 32>; [INV]

  <bb 30> :
  _80 = serdesInitFlags[0];
  _81 = _80 & 263168;
  if (_81 != 263168)
    goto <bb 31>; [INV]
  else
    goto <bb 32>; [INV]

  <bb 31> :
  # DEBUG BEGIN_STMT
  _82 = serdes_pcs_reset_finalize (1077936128B, 0, 1);
  initSeqSuccesSer0 = _82;

  <bb 32> :
  # DEBUG BEGIN_STMT
  initSeqSuccesSer1.4_83 = initSeqSuccesSer1;
  if (initSeqSuccesSer1.4_83 == 0)
    goto <bb 33>; [INV]
  else
    goto <bb 35>; [INV]

  <bb 33> :
  _84 = serdesInitFlags[1];
  _85 = _84 & 263168;
  if (_85 != 263168)
    goto <bb 34>; [INV]
  else
    goto <bb 35>; [INV]

  <bb 34> :
  # DEBUG BEGIN_STMT
  _86 = serdes_pcs_reset_finalize (1141899264B, 0, 1);
  initSeqSuccesSer1 = _86;

  <bb 35> :
  # DEBUG BEGIN_STMT
  initSeqSuccesSer0.5_87 = initSeqSuccesSer0;
  if (initSeqSuccesSer0.5_87 == 0)
    goto <bb 36>; [INV]
  else
    goto <bb 41>; [INV]

  <bb 36> :
  # DEBUG BEGIN_STMT
  _88 = serdesInitFlags[0];
  _89 = _88 & 1024;
  if (_89 == 0)
    goto <bb 37>; [INV]
  else
    goto <bb 38>; [INV]

  <bb 37> :
  # DEBUG BEGIN_STMT
  serdes_pma_loopback_disable (1077936128B, 0);

  <bb 38> :
  # DEBUG BEGIN_STMT
  _90 = serdesInitFlags[0];
  _91 = _90 & 262144;
  if (_91 == 0)
    goto <bb 39>; [INV]
  else
    goto <bb 40>; [INV]

  <bb 39> :
  # DEBUG BEGIN_STMT
  serdes_pma_loopback_disable (1077936128B, 1);

  <bb 40> :
  # DEBUG BEGIN_STMT
  serdes_pcs_mii_bus_control_enable (1077936128B, 0);
  # DEBUG BEGIN_STMT
  serdes_pcs_mii_bus_control_enable (1077936128B, 1);
  # DEBUG BEGIN_STMT
  serdes_pcs_an_disable (1077936128B, 0);
  # DEBUG BEGIN_STMT
  serdes_pcs_an_disable (1077936128B, 1);
  # DEBUG BEGIN_STMT
  _92 = pcsSpeed[0];
  _93 = pcsDuplex[0];
  Serdes_InitSpeedDuplex (1077936128B, 0, _92, _93);
  # DEBUG BEGIN_STMT
  _94 = pcsSpeed[1];
  _95 = pcsDuplex[1];
  Serdes_InitSpeedDuplex (1077936128B, 1, _94, _95);

  <bb 41> :
  # DEBUG BEGIN_STMT
  initSeqSuccesSer1.6_96 = initSeqSuccesSer1;
  if (initSeqSuccesSer1.6_96 == 0)
    goto <bb 42>; [INV]
  else
    goto <bb 47>; [INV]

  <bb 42> :
  # DEBUG BEGIN_STMT
  _97 = serdesInitFlags[1];
  _98 = _97 & 1024;
  if (_98 == 0)
    goto <bb 43>; [INV]
  else
    goto <bb 44>; [INV]

  <bb 43> :
  # DEBUG BEGIN_STMT
  serdes_pma_loopback_disable (1141899264B, 0);

  <bb 44> :
  # DEBUG BEGIN_STMT
  _99 = serdesInitFlags[1];
  _100 = _99 & 262144;
  if (_100 == 0)
    goto <bb 45>; [INV]
  else
    goto <bb 46>; [INV]

  <bb 45> :
  # DEBUG BEGIN_STMT
  serdes_pma_loopback_disable (1141899264B, 1);

  <bb 46> :
  # DEBUG BEGIN_STMT
  serdes_pcs_mii_bus_control_enable (1141899264B, 0);
  # DEBUG BEGIN_STMT
  serdes_pcs_mii_bus_control_enable (1141899264B, 1);
  # DEBUG BEGIN_STMT
  serdes_pcs_an_disable (1141899264B, 0);
  # DEBUG BEGIN_STMT
  serdes_pcs_an_disable (1141899264B, 1);
  # DEBUG BEGIN_STMT
  _101 = pcsSpeed[2];
  _102 = pcsDuplex[2];
  Serdes_InitSpeedDuplex (1141899264B, 0, _101, _102);
  # DEBUG BEGIN_STMT
  _103 = pcsSpeed[3];
  _104 = pcsDuplex[3];
  Serdes_InitSpeedDuplex (1141899264B, 1, _103, _104);

  <bb 47> :
  serdesInitFlags = {CLOBBER};
  pcsSpeed = {CLOBBER};
  pcsDuplex = {CLOBBER};
  return;

}


Serdes_SsModeConfigure (uint8 mode, uint32 intclks0, uint32 intclks1)
{
  volatile uint32 wait;
  uint32 config1;
  uint32 config0;

  <bb 2> :
  # DEBUG BEGIN_STMT
  config0 = 0;
  # DEBUG BEGIN_STMT
  config1 = 0;
  # DEBUG BEGIN_STMT
  wait = 80000;
  # DEBUG BEGIN_STMT
  config0 = (uint32) mode;
  # DEBUG BEGIN_STMT
  config1 = (uint32) mode;
  # DEBUG BEGIN_STMT
  _1 = intclks0 & 1048576;
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  config0 = config0 | 8388608;

  <bb 4> :
  # DEBUG BEGIN_STMT
  _2 = intclks1 & 1048576;
  if (_2 != 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  config1 = config1 | 8388608;

  <bb 6> :
  # DEBUG BEGIN_STMT
  wait_prst_assert (4);
  # DEBUG BEGIN_STMT
  wait_prst_assert (5);
  # DEBUG BEGIN_STMT
  _3 = 1078460656B;
  *_3 = config0;
  # DEBUG BEGIN_STMT
  wait = 100;
  # DEBUG BEGIN_STMT

  <bb 7> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  wait.7_4 = wait;
  wait.8_5 = wait.7_4;
  _6 = wait.8_5 + 4294967295;
  wait = _6;
  if (wait.8_5 != 0)
    goto <bb 7>; [INV]
  else
    goto <bb 8>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  wait_prst_deassert (4);
  # DEBUG BEGIN_STMT
  wait_prst_deassert (5);
  # DEBUG BEGIN_STMT
  wait_prst_assert (16);
  # DEBUG BEGIN_STMT
  wait_prst_assert (17);
  # DEBUG BEGIN_STMT
  _7 = 1142423792B;
  *_7 = config1;
  # DEBUG BEGIN_STMT
  wait = 100;
  # DEBUG BEGIN_STMT

  <bb 9> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  wait.9_8 = wait;
  wait.10_9 = wait.9_8;
  _10 = wait.10_9 + 4294967295;
  wait = _10;
  if (wait.10_9 != 0)
    goto <bb 9>; [INV]
  else
    goto <bb 10>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  wait_prst_deassert (16);
  # DEBUG BEGIN_STMT
  wait_prst_deassert (17);
  return;

}


wait_prst_deassert (int prst_reg)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = 1074233408B;
  _2 = *_1;
  _3 = 1 << prst_reg;
  _4 = ~_3;
  _5 = 1074233408B;
  _6 = _2 & _4;
  *_5 = _6;
  # DEBUG BEGIN_STMT

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _7 = 1074233664B;
  _8 = *_7;
  _9 = 1 << prst_reg;
  _10 = _8 & _9;
  if (_10 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  return;

}


wait_prst_assert (int prst_reg)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = 1074233408B;
  _2 = *_1;
  _3 = 1 << prst_reg;
  _4 = 1074233408B;
  _5 = _2 | _3;
  *_4 = _5;
  # DEBUG BEGIN_STMT

  <bb 3> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _6 = 1074233664B;
  _7 = *_6;
  _8 = 1 << prst_reg;
  _9 = _7 & _8;
  _10 = 1 << prst_reg;
  if (_9 != _10)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 4> :
  return;

}


Serdes_InitSpeedDuplex (void * serdes_base, uint32 pcs, pfe_emac_speed_t speed, pfe_emac_duplex_t duplex)
{
  uint32 speedSelect;

  <bb 2> :
  # DEBUG BEGIN_STMT
  speedSelect = 0;
  # DEBUG BEGIN_STMT
  if (duplex == 2)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  serdes_pcs_set_fd (serdes_base, pcs);
  goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  serdes_pcs_set_hd (serdes_base, pcs);

  <bb 5> :
  # DEBUG BEGIN_STMT
  if (speed == 1)
    goto <bb 6>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  speedSelect = 100;
  goto <bb 10>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  if (speed == 2)
    goto <bb 8>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 8> :
  # DEBUG BEGIN_STMT
  speedSelect = 10;
  goto <bb 10>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  speedSelect = 1;

  <bb 10> :
  # DEBUG BEGIN_STMT
  serdes_pcs_speed_select (serdes_base, pcs, speedSelect);
  return;

}


