Skip to content

Commit

Permalink
Merge pull request #41 from tntakahashi/main
Browse files Browse the repository at this point in the history
merge dqm of syry0993 23e5f70
  • Loading branch information
Tomonori Takahashi authored Mar 19, 2023
2 parents 875d0f7 + 9f70bda commit a639776
Show file tree
Hide file tree
Showing 5 changed files with 459 additions and 263 deletions.
105 changes: 52 additions & 53 deletions AmQStrTdcData.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,69 @@

namespace AmQStrTdc::Data {

// namespace HrTdc{

struct Word {
struct Word {
uint8_t d[8];
};
};

struct Bits {
struct Bits {
union {
uint8_t d[8];

struct {
uint64_t raw : 64;
};

// common
struct {
uint64_t com_rsv : 58; // [57:0]
uint64_t head : 6; // [63:58]
};

// tdc
struct {
uint64_t tdc : 29; // [28:0]
uint64_t tot : 22; // [50:29]
uint64_t ch : 7; // [57:51]
uint64_t dtype : 2; // [63:58]
};

// heartbeat
struct {
uint64_t hb_rsv : 24; //[23:0]
uint64_t hbframe : 16; //[39:24]
uint64_t hbspilln : 8; //[47:40]
uint64_t hbflag : 10; //[57:48]
uint64_t htype : 6; //[63:58]
};

// spill
struct {
uint64_t sp_rsv : 24; //[23:0]
uint64_t hbfrco : 16; //[39:24]
uint64_t spilln : 8; //[47:40]
uint64_t spflag : 10; //[57:48]
uint64_t stype : 6; //[63:58]
};
uint8_t d[8];

struct {
uint64_t raw : 64;
};

// common
struct {
uint64_t com_rsv : 58; // [57:0]
uint64_t head : 6; // [63:58]
};

// lrtdc
struct {
uint64_t zero_t1 : 24;
uint64_t tdc : 19; // [42:24]
uint64_t tot : 8; // [50:43]
uint64_t ch : 7; // [57:51]
uint64_t dtype : 6; // [63:58]
};

// hrtdc
struct {
uint64_t hrtdc : 29; // [28:0]
uint64_t hrtot : 22; // [50:29]
uint64_t hrch : 7; // [57:51]
uint64_t hrdtype : 6; // [63:58]
};

// heartbeat
struct {
uint64_t zero_h : 24;
uint64_t hbframe : 16; //[39,24]
uint64_t hbspilln : 8; //[47,40]
uint64_t hbflag : 10; //[57,48]
uint64_t htype : 6; //[63,58]
};

// spill
struct {
uint64_t zero_s : 24;
uint64_t hbfrco : 16; //[39,24]
uint64_t spilln : 8; //[47,40]
uint64_t spflag : 10; //[57,48]
uint64_t stype : 6; //[63,58]
};

};
};
};

enum HeadTypes {
enum HeadTypes {
Data = 0x0B,
Heartbeat = 0x1C,
// ErrorRecovery = 0xE,
SpillOn = 0x18,
SpillEnd = 0x14
};

// enum DataTypes {
// LeadingEdge = 0b00,
// BusyStart = 0b01,
// BusyEnd = 0b10
// };

// } //namespce HrTdc
};

} // nemacspace AmQStrTdc::Data

Expand Down
Loading

0 comments on commit a639776

Please sign in to comment.