This is a short specification to help the firmware developer to integrate the DaqMux in his firmware.
The DaqMux was originally developed as an oscilloscope to transmit streams from the FPGA to software for debugging purposes. Then it started being used as a data streamer by the application to software, and it's configurations were exported to EPICS/software.
The DaqMux can perform the following functionalities
Figure 1 shows the DaqMux instantiated in the Common platform firmware in the application side.
Figure 1: Common platform firmware top-level
Table 1: DaqMux generics list and description
Generic name | default value | Description |
---|---|---|
TPD_G | 1 | Simulation variable; register clock to output delay in nanoseconds |
DECIMATOR_EN_G | True | Decimator enable |
WAVEFORM_TDATA_BYTES_G | 4 | Output lane width in bytes |
FRAME_BWIDTH_G | 10 | Power of two, which defines AXI stream transaction size in words (4 bytes)(i.e. when FRAME_BWIDTH_G = 12 → 210 x 4 = 4096 bytes) |
BAY_INDEX_G | - | Index of the DaqMux |
N_DATA_IN_G | 16 | Number of input data lanes |
N_DATA_OUT_G | 4 | Number of output data lanes |
Table 2: IO port list and description
Name | Direction | Clock domain | Width | Description |
---|---|---|---|---|
Clock logic | ||||
axiClk | Input | - | 1 | AXI Lite clock |
axiRst | Input | axiClk | 1 | AXI Lite reset |
devClk_i | Input | - | 1 | Development clock |
devRst_i | Input | Synced to devClk_i in DaqMux (for some reason) | 1 | Development logic reset |
wfClk_i | Input | - | Ouput lanes' clock | |
wfRst_i | Input | wfClk_i | Output lanes' reset | |
DaqMux control signals and timing information | ||||
trigHw_i | Input | Synced to devClk_i in DaqMux | 1 | Trigger signal to start the DaqMux streaming
|
trigCasc_i | Input | Synced to devClk_i in DaqMux | 1 | Cascaded trigger input. Can be used along with trigHw_i when enabled in the register file
|
trigCasc_o | Output | devClk_i | 1 | Output trigger signal connected to the SW Trigger Enable control register
|
armCasc_i | Input | Synced to devClk_i in DaqMux | 1 | Cascaded trigger Arm. Arms the trigger and prepares DaqMux for trigger arrival
|
armCasc_o | Output | - | 1 | Output cascade signal connected to the Arm HW Trigger control register
|
freezeHw_i | Input | Synced to devClk_i in DaqMux | 1 | Adds invalid flag to the streams that are forwarded, and they will be discarded in one of the posterior blocks in the pipeline
|
timeStamp_i | Input | Synced to devClk_i in DaqMux | 64 | Time stamp coming from the AMC carrier core |
bsa_i | Input | Synced to devClk_i in DaqMux | 128 | BSA information coming from the AMC carrier core |
dmod_i | Input | Synced to devClk_i in DaqMux | 192 | Dmod timing information coming from the AMC carrier core |
AXI Lite register memory mapped interface for reading and writing to register file | ||||
axilReadMaster | Input | axiClk | 1 | AXI Lite record containing Read Address channel
Read data channel
|
axilReadSlave | Output | axiClk | 1 | AXI Lite record containing Read Address channel
Read data channel
|
axilWriteMaster | Input | axiClk | 1 | AXI Lite record containing Write address channel
Write data channel
Write ack channel
|
axilWriteSlave | Output | axiClk | 1 | AXI Lite record containing Write address channel
Write data channel
Write ack channel
|
Input lane array - data valid based | ||||
sampleDataArr_i | Input | devClk_i | N_DATA_IN_G | Input data stream array of 32-bit words |
sampleValidVec_i | Input | devClk_i | N_DATA_IN_G | Input valids with each valid corresponding to the respective stream in that cycle |
linkReadyVec_i | Input | devClk_i | N_DATA_IN_G | Indicate that the stream source is ready. If is 0, the DaqMux sets the Stream Error control register to 1 |
Output lane array | ||||
rxAxisMasterArr_o | Output | wfClk_i | N_DATA_OUT_G | AXI compliant output data stream array of 32-bit words. Nonetheless, the type of rxAxisMasterArr_o is defined as follows in the AxiStreamPkg.vhd file
|
rxAxisSlaveArr_i | Input | wfClk_i | N_DATA_OUT_G | AXI streams data ready signals |
rxAxisCtrlArr_i | Input | wfClk_i | N_DATA_OUT_G | AXI stream control signals as follows
If pause is 1, the DaqMux will not start and error is set. |
Table 3: DaqMux register address mapping and description
Register name | Address | Access | Bits | Alias | Description |
---|---|---|---|---|---|
Control | 0x0 | RW | 0 | SW Trigger Enable | Triggers DAQ on all enabled channels. Must be set to 1, then set to 0 again. |
1 | Cascade Trigger enable | Enabling/disabling cascaded trigger
| |||
2 | Auto Rearm HW Trigger | Enabling/disabling hardware automatic trigger. If disabled it has to be rearmed by Arm Hw Trigger
| |||
3 | Arm HW Trigger | Arms the hardware trigger on rising edge. After trigger occurs the trigger has to be rearmed using this register. | |||
4 | Trigger Clear Status | Trigger status will be cleared (On the rising edge). | |||
5 | Daq Mode | Select the data acquisition mode ( Stream stops if Error occurs )
| |||
6 | Packet Header Enable | Add 128-bit header (otherwise only data will be inserted)(Applies only to Triggered mode only)
| |||
7 | SW Freeze Buffer | Freezes all enabled circular buffers | |||
8 | HW Freeze Buffer Enable | Enabling/disabling hardware freeze buffer request
| |||
Status | 0x1 | RO | 0 | Software Trigger Status | Software Trigger Status (Registered on first trigger until cleared by Trigger Clear Status - Control[4] ). |
1 | Cascade Trigger Status | Cascade Trigger Status (Registered on first trigger until cleared by Trigger Clear Status - Control[4] ) | |||
2 | HW Trigger Status | Hardware Trigger Status (Registered on first trigger until cleared by Trigger Clear Status - Control[4] ) | |||
3 | HW Trigger Armed Status | Hardware Trigger Armed Status (Registered on rising edge Arm HW Trigger - Control[3] - and cleared when hardware trigger occurs ) | |||
4 | Combined Trigger Status | Combined Trigger Status (Registered when trigger condition is met until cleared by Trigger Clear Status - Control[4] ) | |||
5 | Freeze Buffers Status | Freeze buffer occurred (Registered on first freeze until cleared by Trigger Clear Status - Control[4] ) | |||
Decimation | 0x2 | RW | 15:0 | Decimation Rate Divisor | Sample rate divider (Decimator):
|
DataSize | 0x3 | RW | Data Buffer Size | Number of 32-bit words to forward at each trigger (if enabled header will be included in the first 14 words of data). Minimum size is 14 (the size of the header). | |
TimeStamp | 0x4 | RO | 31:0 | Timestamp[31:0] | Timestamp [31:0] - secPastEpoch |
0x5 | RO | 31:0 | Timestamp[63:32] | Timestamp [63:32] - nsec | |
BSA | 0x6 | RO | 31:0 | bsa(0) | edefAvgDn |
0x7 | 31:0 | bsa(1) | edefMinor | ||
0x8 | 31:0 | bsa(2) | edefMajor | ||
0x9 | 31:0 | bsa(3) | edefInit | ||
TrigCount | 0xA | RO | 31:0 | Trigger Count | Counts valid data acquisition triggers |
DbgInputValid | 0xB | RO | 31:0 | Debug Input Valid | All DaqMux AXI input streams valid signals |
DbgLinkReady | 0xC | RO | 31:0 | Debug Link Ready | All DaqMux AXI input streams ready signals |
InputMuxSel | 0x10 | RW | 4:0 | Input Mux Select[0] | 0x1x: Stream x: Channel select Multiplexer 0 - Disabled, 1 - Test, 2 - Ch0, 3 - Ch1, 4 - Ch2 etc.(up to Ch29) Test mode will output counter data |
0x11 | 4:0 | Input Mux Select[1] | |||
0x12 | 4:0 | Input Mux Select[2] | |||
0x13 | 4:0 | Input Mux Select[3] | |||
0x14-0x1F | Not used | ||||
DaqStatus | 0x20-0x23 | RO | 0 | Stream Pause | Debug flag: Raw diagnostic stream control pause (Waveform engine bufferDone signal. When an AXI frame is completely written to DRAM, this bit is set) |
1 | Stream Ready | Debug flag: Raw diagnostic stream control Ready (Waveform engine FIFO output stream ready signal) | |||
2 | Stream Overflow | Debug flag: Raw diagnostic stream control Overflow (set to 0 in waveform engine) | |||
3 | Stream Error | Debug flag: Error during last Acquisition (Raw diagnostic stream control Ready or incoming data valid dropped) | |||
4 | Data source ready | Debug signal: The data source is ready. If not, DaqMux sets error signal to 1 | |||
5 | Stream Enable | Debug signal: Output stream enabled | |||
31:6 | Frame Count | Number of 4096 word frames sent | |||
024-0x2F | Not used | ||||
DataFormat | 0x30-0x33 | RW | 4:0 | Sign Bit Position | Indicating sign extension point (all bits after sign bit will be overwritten with sign) |
5 | Data Width | Data width 32-bit or 16-bit
| |||
6 | Sign enable | Signed/unsigned
| |||
7 | Decimation Averaging Enable | Decimation Averaging
|
The DaqMux has two data acquisition (Daq) modes: Trigger mode and continuous mode. You may think that continuous mode does not need a trigger, but both modes need a trigger to operate. A more appropriate description maybe automatic (continuous) and manual (trigger) modes. Read through the following section to dive further.
The
Trigger mode allows the user to also see a header in the beginning of each acquired packet.
Data Header structure