MCS to FHS
The interface from the MCS to the FHS is largely in the form of communication between Tango devices running on either side.
Command Sequence
InitSysParam Sequence
The sequence diagram below shows the main sequence of calls in MCS to initialize the system parameters.
AssignResources Sequence
The sequence diagram below shows the main sequence of calls in MCS to assign dish resources to a subarray.
ReleaseResources Sequence
The sequence diagram below shows the main sequence of calls in MCS to release dish resources from a subarray.
Note: the RemoveAllReceptors command has the same code flow, the only difference being that it takes in no argument and instead releases all assigned dish resources.
Configure Scan Sequence
MCS currently supports Correlation observing mode. All modes have their own specific schema for the ConfigureScan input JSON-formatted string.
All Observing Modes
The sequence diagram below shows the main sequence of calls in MCS to configure a scan.
Correlation (CORR)
The sequence diagram below shows details of calls to configure a FSP for a CORR scan.
Pulsar Search Timing (PST)
The sequence diagram below shows details of calls to configure a FSP for a PST scan.
TODO .. .. uml:: ../../diagrams/configure-scan-pst-fsp-hps.puml
Abort Sequence
The sequence diagram below shows the main sequence of calls in MCS to Abort from a correlation/pst scan. Return calls are not shown.
TODO .. .. uml:: ../../diagrams/abort-command.puml
ObsReset Sequence
The sequence diagram below shows the main sequence of calls in MCS to return to IDLE via the ObsReset command for a correlation/pst scan. Return calls are not shown.
TODO .. .. uml:: ../../diagrams/obsreset-command.puml
Restart Sequence
The sequence diagram below shows the main sequence of calls in MCS to return to EMPTY via the Restart command for a correlation/pst scan. Return calls are not shown.
TODO .. .. uml:: ../../diagrams/restart-command.puml
Synchronizing HBM Corner Turner Initial Write Timestamp
The initial write timestamp values published by all the High Bandwidth Memory (HBM) Corner Turner FHS devices will be captured by the MCS FSP Tango device. In turn, once it has received the first initial write timestamp value, the MCS device will propagate it back down to the FHS FSP devices to synchronize the corner turners across all FPGAs in the FSP Unit, ensuring all outputs by all FSP Unit FPGAs are aligned to generate with the same initial timestamp.
This synchronization procedure must occur every time the FSP Unit transitions from having no input data from any VCCs to having at least one active input signal from one VCC.
The overall behaviour of the Corner Turners (CT) is as follows:
Expected operation of the corner turners is that once at least 1 VCC has data flowing, then all FGPAs will have data flowing; normal operation is that as long as at least 1 VCC continues to send data to the FSP, all corner turners will get data (it could be different VCCs from different scans) and no re-initialization is required
Data will stop flowing when all VCCs stop sending data. Once data starts flowing again as above, all corner turners need to be re-initialized
MCS Sequence for Initializing the Corner Turners:
When FSP receives the command SetObsMode
If the obs mode is changing from IDLE to CORR, the FSP subscribes to the first_write_timestamp on every FHS FSP CORR Controller (x8)
If the obs mode is changing from CORR to IDLE the FSP unsubscribes to the first_write_timestamp on every FHS FSP CORR Controller (x8)
MCS receives change events for first_write_timestamp and uses the first such event to start the initialization process (MCS does not wait for an event from each FPGA).
Once MCS detects that the CTs need to be initialized, a configure corner turner command is sent containing
first_read_timestamp
MCS will set first_read_timestamp to be first_write_timestamp; any adjustments to the first_write_timestamp (such as adding the read_threshold to reduce the amount of flagged data going to SDP) will be done in the FHS FSP top level controller
If MCS encounters DevFailed error while trying to Configure a specific FHS FSP Corr’s Corner Turner, MCS will attempt to retry configuring the Corner Turner 2 more times using the same initial timestamp given in the initial configuration attempt.
Synchronizing FSP Output Time Sequence
Every FSP producing output for a Subarray must have the same time to start producing products. The FHS FSP software will use the first output time to drop data received before this time.
The Mid.CBF Subarray will coordinate the first output time across all FSPs that the Subarray is using for a scan. This first output time will be based on the time the data started flowing for the scan, as determined and provided by the FHS FSP Corr top level controller.
For correlation, each Mid.CBF Subarray communicates with a single FSPCorrSubarray Tango device for each FSP that it is using for the scan. Each FSPCorrSubarray Tango device communicates with up to 8 FHS FSP top level controllers. In this design, this communication hierarchy is maintained.
The sequence diagram below shows the sequence of calls in MCS to synchronize the FSP Output Time for Subarray 1.
subarray1ScanStartTime is one of 16 subarray<1-16>ScanStartTime attributes found in FHS FSP Corr that corresponds to one of the 16 Subarray that can be assigned to FHS FSP Corr. MCS FSPCorrSubarray subscribes the FHS FSP Corr subarray<1-16>ScanStartTime that corresponds to the FSPCorrSubarray’s assigned Subarray.