The common ATCA driver is an API that intermediates ATCACommon EPICS module and CPSW. It abstracts common ATCA registers and provides get and set functions to control them using CPSW. It also makes transparent all the peculiarities of CPSW.
The common ATCA package is responsible for the following:
The files in the package are as follows
The common ATCA package uses the common platform software package (establishes connections with hardware based on protocols and addresses described in YAML files). The API assumes that the CPSW YAML files were already read and parsed successfully. The API requires a path the denote where all the registers will reside.
The YAMLs necessary for the correct operation of the common ATCA API are shown as follows
Some of these YAMLs call one another, so the YAMLs that actually contain the registers are just some of them. The paths that are required for the registers are as follows
AmcCarrierCore/AxiVersion
AmcCarrierCore/AxiSysMonUltraScale
AmcCarrierCore/AmcCarrierBsi
AppTop/AppTopJesd(0/[0])
AppTop/AppTopJesd(1/[1])
AppTop/DaqMuxV2[0]
AppTop/DaqMuxV2[1]
AmcCarrierCore/AmcCarrierBsa/BsaWaveformEngine[0]/WaveformEngineBuffers
AmcCarrierCore/AmcCarrierBsa/BsaWaveformEngine[1]/WaveformEngineBuffers
All the registers and streams that will be accessed are in the previously mentioned paths. A summary of the used registers are as follows:
YAML file | Stream/Register name | Description | |
---|---|---|---|
1 | AxiVersion.yaml | UpTimeCnt | Number of seconds since last reset |
2 | BuildStamp | Time stamp of the FPGA build | |
3 | FpgaVersion | Version | |
4 | GitHash | Git hash of firmware project | |
5 | AxiSysMonUltraScale.yaml | Temperature | ADC temperature values |
6 | AmcCarrierBsi.yaml | EthUpTime | Uptime of ethernet in seconds |
7 | JesdRx.yaml 2 instantiations | StatusValidCnt[0] | Shows stability of JESD lanes. Counts number of JESD re-syncronisations |
8 | StatusValidCnt[1] | ||
9 | StatusValidCnt[2] | ||
10 | StatusValidCnt[3] | ||
11 | StatusValidCnt[4] | ||
12 | StatusValidCnt[5] | ||
13 | DaqMuxV2.yaml 2 instantiations | TriggerCascMask | covered in DaqMux documentation |
14 | TriggerHwAutoRearm | ||
15 | DaqMode | ||
16 | PacketHeaderEn | ||
17 | FreezeHwMask | ||
18 | DecimationRateDiv | ||
19 | DataBufferSize | ||
20 | TrigCount | ||
21 | DbgInputValid | ||
22 | DbgLinkReady | ||
23 | InputMuxSel[0/1/2/3] | ||
24 | StreamPause[0/1/2/3] | ||
25 | StreamReady[0/1/2/3] | ||
26 | StreamOverflow[0/1/2/3] | ||
27 | StreamError[0/1/2/3] | ||
28 | InputDataValid[0/1/2/3] | ||
29 | StreamEnabled[0/1/2/3] | ||
30 | FrameCnt[0/1/2/3] | ||
31 | FormatSignWidth[0/1/2/3] | ||
32 | FormatDataWidth[0/1/2/3] | ||
33 | FormatSign[0/1/2/3] | ||
34 | DecimationAveraging[0/1/2/3] | ||
35 | Timestamp[0/1] | ||
36 | TriggerDaq | ||
37 | ArmHwTrigger | ||
38 | FreezeBuffers | ||
39 | ClearTrigStatus | ||
40 | AxiStreamDmaRingWrite.yaml 2 instantiations | Initialize | covered in waveform engine documentation |
41 | StartAddr[0/1/2/3] | ||
42 | EndAddr[0/1/2/3] | ||
43 | WrAddr[0/1/2/3] | ||
44 | Enabled[0/1/2/3] | ||
45 | Mode[0/1/2/3] | ||
46 | MsgDest[0/1/2/3] | ||
47 | FramesAfterTrigger[0/1/2/3] | ||
48 | Status[0/1/2/3] | ||
49 | AmcCarrierCore.yaml | OutputConfig[0/1/2/3] | Crossbar configuration. Four outputs choosing from four inputs. Output and input enumeration is as follows:
|
50 | 000TopLevel.yaml | Streams (Stream0 - Stream7) | Stream names to be initialized |
This class is responsible for DaqMux 0 and 1 configurations, JESD Top (AMC) 0 and 1, Waveform engine, Build information, and temperature information.
The static function if the parent class ATCACommonFw allows the instantiation of API class. It seems to return an instantiation of the child class as follows:
ATCACommonFw IATCACommonFw::create(Path p) { return IEntryAdapt::check_interface<ATCACommonFwAdapt, DevImpl>(p); }
The code to instantiate the API is as follows
atcaCommon = IATCACommonFw::create(p_atcaCommon);
The stream can be created using the createStream method in the API. Streams can be instantiated separately by calling the CPSW stream creation function directly as follows
try { _stream[0] = IStream::create(p_root->findByName(stream0)); } catch (InvalidArgError &e) { // Don't print error if the stream name is empty, as the user didn't // want to create this channel anyway. } catch (CPSWError &e) { fprintf(stderr, "CPSW Error: %s, file: %s, line: %d\n", e.getInfo().c_str(), __FILE__, __LINE__); }
YAML string mapping
This class is responsible for configuring the timing cross bar. The timing cross bar is nothing more than four multiplexers configuring four outputs. The four outputs and the four inputs are as follows:
The UML diagram is shown as follows.
The functions available are simply to instantiate a crossbar, and to configure and read current configuration.
The package does not throw any exceptions. Nonetheless, CPSW throws CPSWError errors and the package propagates these exceptions. In these contexts the package prints to stderr. Upper layers should catch exceptions of type CPSWError.
The ATCACommon module integrates the common ATCA API with EPICS, and therefore allowing the control of the different components in EPICS.
The ATCACommon module is responsible for the following:
The files in the package are as follows
TBD
The CrossbarControlDriver instantiates the commonATCA API classCrossbarControlYaml. It also provides 2 methods: report and control . It is not clear why this class was not implemented in the commonATCA API or even if it is necessary at all. The CrossbarControlAsynDriver class on the other hand inherits from AsynDriver, and calls the CrossbarControlDriver with the proper parameters.
The ATCAcommonAsynDriver instantiates the lower level commonATCA API class called ATCACommonFw. The Asyn driver is then given access to all the relevant registers in the hardware and exports them as PVs in EPICS.
The DebugStreamAsynDriver is probably the most complex class of the ATCACommon module. A flow diagram showing the execution flow of this class is shown as follows
TBD
TBD