16 storeThresholdWords(uint64_t twoWords,
25 programBytes[
channel][0] = lowWord;
26 programBytes[
channel][1] = highWord;
28 for (
int bit = 0;
bit < 32; ++
bit) {
29 thresholdRegisters[
channel][
bit] = ((lowWord >>
bit) & 1U) != 0U;
30 thresholdRegisters[
channel][
bit + 32] = ((highWord >>
bit) & 1U) != 0U;
64 uint32_t right_bit = 0x1;
70 data(
"set_main_control") >> data.dbhex() >>
m_main_control >> data.dbdec();
71 data(
"set_main_count") >> data.dbhex() >>
m_main_count >> data.dbdec();
72 data(
"set_main_status") >> data.dbhex() >>
m_main_status >> data.dbdec();
75 data(
"set_pipe_i0_edge") >> data.dbhex() >>
m_pipe_i0_edge >> data.dbdec();
77 data(
"set_pipe_i0_shape") >> data.dbhex() >>
m_pipe_i0_shape >> data.dbdec();
82 data(
"set_pipe_i1_edge") >> data.dbhex() >>
m_pipe_i1_edge >> data.dbdec();
84 data(
"set_pipe_i1_shape") >> data.dbhex() >>
m_pipe_i1_shape >> data.dbdec();
89 data(
"set_pipe_j0_edge") >> data.dbhex() >>
m_pipe_j0_edge >> data.dbdec();
91 data(
"set_pipe_j0_shape") >> data.dbhex() >>
m_pipe_j0_shape >> data.dbdec();
96 data(
"set_pipe_j1_edge") >> data.dbhex() >>
m_pipe_j1_edge >> data.dbdec();
98 data(
"set_pipe_j1_shape") >> data.dbhex() >>
m_pipe_j1_shape >> data.dbdec();
128 data(
"set_trig_ovl_sx_reg") >> data.dbhex() >>
m_overlap2 >> data.dbdec();
129 data(
"set_trig_ovl_dx_reg") >> data.dbhex() >>
m_overlap1 >> data.dbdec();
130 data(
"set_trig_edge_reg") >> data.dbhex() >>
m_trig_edge_reg >> data.dbdec();
142 data(
"set_l1c_pre") >> data.dbhex() >>
m_l1c_pre >> data.dbdec();
143 data(
"set_bcc_pre") >> data.dbhex() >>
m_bcc_pre >> data.dbdec();
150 if (data(
"set_trig_thr0_thr_reg_00")) {
151 for (
int i = 0; i < 32; ++i) {
154 data >> data.dbhex() >> twowords >> data.dbdec();
156 data >> ignore >> data.dbhex() >> twowords >> data.dbdec();
164 if (data(
"set_trig_thr1_thr_reg_00")) {
166 for (
int i = 0; i < 32; ++i) {
168 data >> data.dbhex() >> twowords >> data.dbdec();
170 data >> ignore >> data.dbhex() >> twowords >> data.dbdec();
179 if (data(
"set_trig_thr2_thr_reg_00")) {
181 for (
int i = 0; i < 32; ++i) {
183 data >> data.dbhex() >> twowords >> data.dbdec();
185 data >> ignore >> data.dbhex() >> twowords >> data.dbdec();
197 for (
int i = 1; i <= 3; ++i) {
200 if (data(
"th #", i) && data(
"maj_reg") >> majority) {
203 uint32_t first_word = 0;
204 uint32_t second_word = 0;
208 while (data(
"th") >> th >>
"thr_reg" >> ch >> data.dbhex() >> first_word >> second_word >> data.dbdec()) {
209 if (th < 1)
return false;
213 for (
int bit = 0; bit < 32; ++bit) {
223 data(
"overlap1") >> data.dbhex() >>
m_overlap1 >> data.dbdec();
224 data(
"overlap2") >> data.dbhex() >>
m_overlap2 >> data.dbdec();
242 for (
int bit = 0; bit < 32; ++bit) {
250 if (source >= 3 || dest >= 3)
return;
251 if (source == dest)
return;
257 for (
int bit = 0; bit < 32; ++bit) {
265 if (th >= 3)
return false;
274 unsigned int no_coincidence = 183;
278 for (
int th = 2; th >= 0; --th) {
283 if (th == 0) stream << (char)no_coincidence;
std::ostream & operator<<(std::ostream &stream, const CMAprogram &program)
static constexpr int confirm_channels
static constexpr int pivot_channels
uint64_t m_trig_thr2_mask_1_j_ge1_reg
bool m_threshold_registers[3][CMAparameters::pivot_channels][CMAparameters::confirm_channels]
uint64_t m_trig_thr1_mask_1_j_eq2_reg
uint32_t m_pipe_i0_mask0_trig
uint32_t m_pipe_i0_mask0_in
uint32_t m_trig_local_direc_j
uint32_t m_trig_shape_k_reg
uint64_t m_pipe_j1_mask0_readout
uint32_t m_pipe_i1_mask0_in
uint32_t m_trig_thr0_mask_1_i_ge1_reg
uint32_t m_pipe_i0_mask0_readout
uint8_t m_trig_declu_i1_clsize
uint64_t m_pipe_j0_mask0_in
uint8_t m_readout_buffer_hireg
uint32_t m_pipe_i1_mask0_readout
uint8_t m_trig_declu_j1_clsize
uint64_t m_trig_thr0_mask_1_j_eq2_reg
uint8_t m_trig_thr0_maj_reg
uint16_t m_readout_buffer_empty
uint32_t m_trig_k_readout
uint32_t m_pipe_j1_ipb_regdepth
uint8_t m_trig_declu_j0_clsize
uint16_t m_pipe_i1_ipb_regdepth
uint8_t m_readout_buffer_lowreg
uint8_t m_trig_declu_i0_clsize
uint8_t m_trig_thr2_maj_reg
uint16_t m_readout_buffer_full
void open_threshold(int th)
uint32_t m_pipe_j0_ipb_regdepth
uint16_t m_readout_buffer_almost_empty
uint16_t m_readout_buffer_almost_full
bool hasProgrammed(unsigned int th) const
uint64_t m_trig_thr1_mask_1_j_ge1_reg
uint64_t m_pipe_j1_mask0_trig
uint32_t m_trig_thr1_mask_1_i_eq2_reg
uint32_t m_trig_thr2_mask_1_i_eq2_reg
uint32_t m_pipe_i1_mask0_trig
uint64_t m_pipe_j0_mask0_readout
uint64_t m_trig_thr0_mask_1_j_ge1_reg
uint32_t m_trig_local_direc_i
uint32_t m_trig_thr2_mask_1_i_ge1_reg
uint64_t m_trig_thr2_mask_1_j_eq2_reg
uint32_t m_trig_thr1_mask_1_i_ge1_reg
uint8_t m_readout_buffer_latreg
uint64_t m_pipe_j1_mask0_in
uint16_t m_pipe_i0_ipb_regdepth
uint16_t m_readout_buffer_half_full
uint8_t m_trig_thr1_maj_reg
uint32_t m_trig_thr0_mask_1_i_eq2_reg
uint8_t m_readout_serializer_dslink
uint64_t m_pipe_j0_mask0_trig
uint32_t m_program_bytes[3][CMAparameters::pivot_channels][2]
constexpr unsigned int bit(int n)