Skip to content

Calculate LCB config and trickle elinks not relative to LCBcmd

The LCB config and trickle elinks are found as +-1 from the LCB command elink:

for (uint32_t el : lcb_elinks) {
  // FELIX Phase 2 FW spec (v1.007) Table 8.30
  trickle_elinks.push_back( el+1 );
  config_elinks.push_back( el-1 );
}

But some of our staves have the electric line of the LCBcmd elink physically swapped with the R3L1 command line. Which means that it is shifted by +3 in the chip config json with respect to the spec.

Let's find the config and trickle elinks as an "absolute" address: find the optical link & the segment offsets from the tx LCB cmd elink, and add +0 and +2 to that:

for (uint32_t el : lcb_elinks) {
  // FELIX Phase 2 FW spec (v1.007)
  // 8.5.9 ITK STRIPS LCB ENCODER
  // Table 8.32
  uint32_t n_link = el / 0x40;
  uint32_t n_segment = (el - n_link*0x40) / 5;
  config_elinks  .push_back( n_link*0x40 + n_segment*5 + 0 );
  trickle_elinks .push_back( n_link*0x40 + n_segment*5 + 2 );
}

Applied only in:

modified:   StarFelixTriggerLoop.cpp
Edited by Alex Toldaiev

Merge request reports