Skip to content

Commit c555672

Browse files
committed
added support for RDH v7
1 parent ccb0840 commit c555672

File tree

3 files changed

+140
-3
lines changed

3 files changed

+140
-3
lines changed

doc/releaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,3 +510,4 @@ This file describes the main feature changes for each readout.exe released versi
510510
- equipment-CruEmulator: set TF trigger type (bit 11) on new TF. Used for dropEmptyHBFramesTriggerMask tests.
511511
- Updated configuration parameters:
512512
- added consumer-fileRecorder-*.dropEmptyHBFramesTriggerMask: when using dropEmptyHBFrames = 1, keep some empty HB frames with trigger type matching given (decimal) mask.
513+
- Added support for RDHv7. Readout already accepts data from equipments with v7, but still generates data (internal sw generator) with v6, for compatibility with current software downstream.

src/RAWDataHeader.h

Lines changed: 137 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ typedef struct _RAWDataHeaderV6 {
374374

375375
union {
376376
uint32_t word0 = 0xffff4006;
377-
// | | version 4
377+
// | | version 6
378378
// | header size 16x32 bit = 64 bytes
379379
struct {
380380
uint32_t version : 8; /// bit 0 to 7: header version
@@ -504,6 +504,142 @@ typedef struct _RAWDataHeaderV6 {
504504

505505
} RAWDataHeaderV6;
506506

507+
typedef struct _RAWDataHeaderV7 {
508+
// 32-bits words
509+
510+
union {
511+
uint32_t word0 = 0xffff4007;
512+
// | | version 7
513+
// | header size 16x32 bit = 64 bytes
514+
struct {
515+
uint32_t version : 8; /// bit 0 to 7: header version
516+
uint32_t headerSize : 8; /// bit 8 to 15: header size
517+
uint32_t feeId : 16; /// bit 16 to 31: FEE id
518+
};
519+
};
520+
521+
union {
522+
uint32_t word1 = 0x0000ffff;
523+
struct {
524+
uint32_t priorityBit : 8; /// bit 0 to 7: priority bit
525+
uint32_t systemId : 8; /// bit 8 to 15: system id
526+
uint32_t zero1 : 16; /// bit 16 to 31: reserved
527+
};
528+
};
529+
530+
union {
531+
uint32_t word2 = 0x0;
532+
struct {
533+
uint32_t offsetNextPacket : 16; /// bit 0 to 15: offset of next block
534+
uint32_t memorySize : 16; /// bit 16 to 31: size of block (in bytes) in memory
535+
};
536+
};
537+
538+
union {
539+
uint32_t word3 = 0xffffffff;
540+
struct {
541+
uint32_t linkId : 8; /// bit 0 to 7: link id (GBT channel number)
542+
uint32_t packetCounter : 8; /// bit 8 to 15: packet counter (increased at every packet received in the link)
543+
uint32_t cruId : 12; /// bit 16 to 27: CRU id
544+
uint32_t dpwId : 4; /// bit 28 to 31: data path wrapper id, used to identify one of the 2 CRU End Points
545+
};
546+
};
547+
548+
union {
549+
uint32_t word4 = 0x00000fff;
550+
struct {
551+
uint32_t triggerBC : 12; /// bit 0 to 11: TRG BC ID
552+
uint32_t zero4 : 20; /// bit 12 to 31: reserved
553+
};
554+
};
555+
556+
union {
557+
uint32_t word5 = 0xffffffff;
558+
struct {
559+
// there's a single orbit counter now
560+
union {
561+
uint32_t triggerOrbit; /// bit 0 to 31: orbit
562+
uint32_t heartbeatOrbit; /// bit 0 to 31: orbit
563+
};
564+
};
565+
};
566+
567+
union {
568+
uint32_t word6 = 0x0;
569+
struct {
570+
uint32_t dataFormat : 8; /// bit 0 to 7 : data format
571+
uint32_t zero6 : 24; /// bit 8 to 31: reserved
572+
};
573+
};
574+
575+
union {
576+
uint32_t word7 = 0x0;
577+
struct {
578+
uint32_t zero7; /// bit 0 to 31: reserved
579+
};
580+
};
581+
582+
union {
583+
uint32_t word8 = 0xffffffff;
584+
struct {
585+
uint32_t triggerType : 32; /// bit 0 to 31: trigger types
586+
};
587+
};
588+
589+
union {
590+
uint32_t word9 = 0x00ffffff;
591+
struct {
592+
uint32_t pagesCounter : 16; /// bit 0 to 15: pages counter
593+
uint32_t stopBit : 8; /// bit 16 to 23: stop bit
594+
uint32_t zero9 : 8; /// bit 24 to 31: reserved
595+
};
596+
};
597+
598+
union {
599+
uint32_t word10 = 0x0;
600+
struct {
601+
uint32_t zero10; /// bit 0 to 31: reserved
602+
};
603+
};
604+
605+
union {
606+
uint32_t word11 = 0x0;
607+
struct {
608+
uint32_t zero11; /// bit 0 to 31: reserved
609+
};
610+
};
611+
612+
union {
613+
uint32_t word12 = 0xffffffff;
614+
struct {
615+
uint32_t detectorField; /// bit 0 to 31: detector field
616+
};
617+
};
618+
619+
union {
620+
uint32_t word13 = 0x0000ffff;
621+
struct {
622+
uint16_t par; /// bit 0 to 15: PAR
623+
uint16_t zero13; /// bit 16 to 31: reserved
624+
};
625+
};
626+
627+
union {
628+
uint32_t word14 = 0x0;
629+
struct {
630+
uint32_t zero14; /// bit 0 to 31: reserved
631+
};
632+
};
633+
634+
union {
635+
uint32_t word15 = 0x0;
636+
struct {
637+
uint32_t zero15; /// bit 0 to 31: reserved
638+
};
639+
};
640+
641+
} RAWDataHeaderV7;
642+
507643
using RAWDataHeader = RAWDataHeaderV6;
508644

509645
// expecting 16*32bits = 64 bytes

src/RdhUtils.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ void RdhHandle::dumpRdh(long offset, bool singleLine)
6868
int RdhHandle::validateRdh(std::string& err)
6969
{
7070
int retCode = 0;
71-
// expecting RDH v5 or v6
72-
if ((getHeaderVersion() != 5) && (getHeaderVersion() != 6)) {
71+
// expecting RDH v5 or v6 or v7
72+
if ((getHeaderVersion() != 5) && (getHeaderVersion() != 6) && (getHeaderVersion() != 7)) {
7373
if (err.length()) err += ", ";
7474
err += "Wrong header version";
7575
retCode++;

0 commit comments

Comments
 (0)