Table of Contents

FEBV2 Firmware structure and requirements

One main idea is to keep the possibility to replace the Master FPGA with an LpGBT chip on the final design So we need to use:

A bonus will be to have a first version of the SEU mitigation but it's not compulsory at this stage.

Master FPGA needs

It is responsible of all communication, synchronisation and data formatting

GBT communication

Protocol

The underlying protocol is provided by the CERN IP

Messages

Backend to Frontend

The message structure is the following:

Frontend to Backend

The message structure is the following:

GBT synchronisation

No documentation found on GBT-FPGA, expected special data with 32 bits encoded (see CIC doc)

The GBT firmware should handle BC0 and RESYNC commands:

EPort TDC reception

I2C slow control to TDC

It should be simple but the GBT interface is not trivial.

Backup readout

DCC synchronisation

We need to implement the block getting the BC0 from the start of the window and propagating back a BUSY. One line is also dedicated for RESYNC (no firmware)

There is also a TRIGGER line that should be connected to one TDC channel, but no firmware is needed

Wiznet (Ethernet) communication

It's being implemented currently but not yet tested, 3 separated sockets mechanism

Each socket should have a block to decode incoming data to register and a block to encode outgoing buffer (packet structure)

FTDI (USB2) readout

Additional debug port , firmware can be inherited from SDHCAL (ILC) DIF boards. It's a low priority

TDC FPGA firmware

EPort TDC transmission

Data collection from all TDCs is done via a switch IP , a first version is being implemented on FEBV1.

The EPort IP should be part of the GBT-FPGA firmware from CERN and should be interfaced to the the switch.

BUSY is generated by an OR of all TDC channel (almost Full FIFO) and should be propagated to Master FPGA

I2C slow control communication

Pending block to the master FPGA one:

TDC blocks

Two parts:

Ongoing work on those blocks for a new version of FEBV1

PETIROC FSM

Standalone block that mitigate the RESET of the latch on PETIROC. Copy from FEBV1 firmware