====== Upgrade of Readout firmware ====== ===== Proposal ===== ==== Data Format ==== * Data are now output per TDC channel * The Trigger TDC is allways channel 0 * The mapping between TDC and PETIROC is direct: * Channel 1 of TDC $ \rightarrow $ Channel 0 of PETIROC * .. * Channel 24 of TDC $ \rightarrow $ Channel 23 of PETIROC * It allows to extend easily the number of channels and will only force to resolder adapter boards * The default clock is now 40 MHz so counts of BXID and Absolute BXID are in 25 ns. The absolute BXID is only reset at the first acquisition after Power On. The output of a FEB now consists of: * A Header packet : ^ Tag ^ Absolute BXID ^ GTC ^ 64 or 128 channels lengths^ | 2 bytes (BEBE)| 6 bytes (81 days) | 4 bytes | 64 or 128 bytes , # channels per TDC| It's a fixed length packet of 76 or 140 bytes. Then each NON EMPTY TDC is sending one packet * TDC packet ^Header^ Channel number ^ Number of Measurements ^ payload^ |2bytes B0B0 | 1 byte | ncx 1bytes | ncx $\times$ channel info | The channel info is 5 bytes: * BXID 3 bytes (40 MHz clock since **S**tart **O**f **A**cquisition front) * Coarse 1 byte (400 MHz count in the BXID) * fine 1 byte (fine TDC value 2.5 ns/256) ==== Finite State Machine ==== === Top Level === {{ :lyon_mai2018:toptdcreadout.png |}} === Acquisition === == ILC Mode == {{ :lyon_mai2018:acquisitiontdcilc.png |}} == Trigger Mode == On trigger the state machine is only modified before calling the readout FSM: {{ :lyon_mai2018:acquisitiontdcbeamtest.png |}} === Readout === {{ :lyon_mai2018:wiznetfsm.png |}}