|
16 | 16 | # Values that help determine the running conditions |
17 | 17 | number_of_data_producers = 2 |
18 | 18 | run_duration = 20 # seconds |
19 | | -data_rate_slowdown_factor = 10 |
| 19 | +data_rate_slowdown_factor = 10 # is this still used anywhere? (KAB, 28-Apr-2050) |
20 | 20 | ta_prescale = 100 |
21 | 21 |
|
22 | 22 | # Default values for validation parameters |
|
32 | 32 | "min_size_bytes": 7272, |
33 | 33 | "max_size_bytes": 14472, |
34 | 34 | } |
35 | | -wibeth_frag_multi_trig_params = { |
36 | | - "fragment_type_description": "WIBEth", |
37 | | - "fragment_type": "WIBEth", |
38 | | - "expected_fragment_count": number_of_data_producers, |
39 | | - "min_size_bytes": 7272, |
40 | | - "max_size_bytes": 14472, |
41 | | -} |
42 | 35 | tde_frag_params = { |
43 | 36 | "fragment_type_description": "TDEEth", |
44 | 37 | "fragment_type": "TDEEth", |
|
51 | 44 | # num frames = ro_win / tick diff = 977 |
52 | 45 | # fragment size = num frames * frame size = 461026 |
53 | 46 |
|
54 | | -pds_stream_frag_params = { |
55 | | - "fragment_type_description": "PDSStream", |
| 47 | +daphne_stream_frag_params = { |
| 48 | + "fragment_type_description": "DAPHNEStream", |
56 | 49 | "fragment_type": "DAPHNEStream", |
57 | 50 | "expected_fragment_count": number_of_data_producers, |
58 | 51 | "min_size_bytes": 72+461026-20*472, |
59 | 52 | "max_size_bytes": 72+461026+20*472, |
60 | 53 | } |
61 | | -pds_frag_params = { |
62 | | - "fragment_type_description": "PDS", |
| 54 | +daphne_frag_params = { |
| 55 | + "fragment_type_description": "DAPHNE", |
63 | 56 | "fragment_type": "DAPHNE", |
64 | 57 | "expected_fragment_count": number_of_data_producers, |
65 | | - "min_size_bytes": 435912, |
66 | | - "max_size_bytes": 1133256, |
67 | | -} # 20 x 21792; 52 x 21792 (+72) |
| 58 | + "min_size_bytes": 1936, |
| 59 | + "max_size_bytes": 120000, |
| 60 | + "frag_sizes_by_TC_type": {"kPrescale": {"min_size_bytes": 1936, "max_size_bytes": 32000}, |
| 61 | + "kRandom": {"min_size_bytes": 112000, "max_size_bytes": 118000}, |
| 62 | + "default": {"min_size_bytes": 1936, "max_size_bytes": 118000} } |
| 63 | +} |
68 | 64 |
|
69 | 65 | # sizes: 128 is for one TC with zero TAs inside it (72+56) |
70 | 66 | # 208 is for one TC with one TA inside it (72+56+80) |
|
97 | 93 | } |
98 | 94 | # sizes: 72 is for an empty TP fragment |
99 | 95 | # 144 is for a fragment with three TPs in it (72+24+24+24) |
100 | | -triggerprimitive_frag_params = { |
| 96 | +wibeth_triggerprimitive_frag_params = { |
101 | 97 | "fragment_type_description": "Trigger Primitive", |
102 | 98 | "fragment_type": "Trigger_Primitive", |
103 | | - "expected_fragment_count": 3, |
| 99 | + "expected_fragment_count": (1 * 3), # number of readout apps * 3 |
104 | 100 | "min_size_bytes": 72, |
105 | 101 | "max_size_bytes": 144, |
106 | 102 | } |
| 103 | +daphne_triggerprimitive_frag_params = { |
| 104 | + "fragment_type_description": "Trigger Primitive", |
| 105 | + "fragment_type": "Trigger_Primitive", |
| 106 | + "expected_fragment_count": 1, # number of readout apps |
| 107 | + "min_size_bytes": 96, |
| 108 | + "max_size_bytes": 4392, |
| 109 | +} |
107 | 110 | ignored_logfile_problems = { |
108 | 111 | "-controller": [ |
109 | 112 | "Worker with pid \\d+ was terminated due to signal 1", |
|
141 | 144 | ) |
142 | 145 | ) |
143 | 146 |
|
144 | | -tpg_conf = copy.deepcopy(conf_dict) |
145 | | -tpg_conf.tpg_enabled = True |
146 | | -tpg_conf.frame_file = ( |
| 147 | +wib_tpg_conf = copy.deepcopy(conf_dict) |
| 148 | +wib_tpg_conf.tpg_enabled = True |
| 149 | +wib_tpg_conf.frame_file = ( |
147 | 150 | "asset://?checksum=dd156b4895f1b06a06b6ff38e37bd798" # WIBEth All Zeros |
148 | 151 | ) |
149 | | -tpg_conf.config_substitutions.append( |
| 152 | +wib_tpg_conf.config_substitutions.append( |
150 | 153 | data_classes.config_substitution( |
151 | 154 | obj_class="TAMakerPrescaleAlgorithm", |
152 | 155 | obj_id="dummy-ta-maker", |
|
163 | 166 | tde_conf.frame_file = "asset://?checksum=dd156b4895f1b06a06b6ff38e37bd798" # WIBEth All Zeros |
164 | 167 | #tde_conf.frame_file = "asset://?checksum=759e5351436bead208cf4963932d6327" |
165 | 168 |
|
166 | | -pds_stream_conf = copy.deepcopy(conf_dict) |
167 | | -pds_stream_conf.dro_map_config.det_id = 2 # det_id = 2 for HD_PDS |
168 | | -pds_stream_conf.frame_file = "asset://?label=DAPHNEStream&subsystem=readout" |
| 169 | +daphne_stream_conf = copy.deepcopy(conf_dict) |
| 170 | +daphne_stream_conf.dro_map_config.det_id = 2 # det_id = 2 for HD_PDS |
| 171 | +daphne_stream_conf.frame_file = "asset://?label=DAPHNEStream&subsystem=readout" |
169 | 172 |
|
170 | | -pds_stream_conf.config_substitutions.append( |
| 173 | +daphne_stream_conf.config_substitutions.append( |
171 | 174 | data_classes.config_substitution( |
172 | 175 | obj_class="TCReadoutMap", |
173 | 176 | obj_id = "def-random-readout", |
|
178 | 181 | ) |
179 | 182 | ) |
180 | 183 |
|
181 | | -pds_conf = copy.deepcopy(conf_dict) |
182 | | -pds_conf.dro_map_config.det_id = 2 # det_id = 2 for HD_PDS |
183 | | -pds_conf.frame_file = "asset://?label=DAPHNE&subsystem=readout" |
184 | | -pds_conf.config_substitutions.append( |
| 184 | +daphne_conf = copy.deepcopy(conf_dict) |
| 185 | +daphne_conf.dro_map_config.det_id = 2 # det_id = 2 for HD_PDS |
| 186 | +daphne_conf.frame_file = "asset://?checksum=a8990a9eb3a505d4ded62dfdfa9e2681" |
| 187 | +daphne_conf.config_substitutions.append( |
185 | 188 | data_classes.config_substitution( |
186 | 189 | obj_class="TCReadoutMap", |
187 | 190 | obj_id = "def-random-readout", |
|
191 | 194 | }, |
192 | 195 | ) |
193 | 196 | ) |
194 | | -# pacman_conf = copy.deepcopy(conf_dict) |
195 | | -# pacman_conf.dro_map_config.det_id = 32 # det_id = 32 for NDLAr_TPC |
196 | | -# pacman_conf.frame_file == "asset://?label=PACMAN&subsystem=readout" |
197 | 197 |
|
198 | | -# mpd_conf = copy.deepcopy(conf_dict) |
199 | | -# mpd_conf.dro_map_config.det_id = 33 # det_id = 33 for NDLAr_PDS |
200 | | -# mpd_conf.frame_file = "asset://?label=MPD&subsystem=readout" |
| 198 | +daphne_tpg_conf = copy.deepcopy(daphne_conf) |
| 199 | +daphne_tpg_conf.tpg_enabled = True |
| 200 | +daphne_tpg_conf.config_substitutions.append( |
| 201 | + data_classes.config_substitution( |
| 202 | + obj_class="TAMakerPrescaleAlgorithm", |
| 203 | + obj_id="dummy-ta-maker", |
| 204 | + updates={"prescale": 750}, |
| 205 | + ) |
| 206 | +) |
201 | 207 |
|
202 | 208 |
|
203 | 209 | confgen_arguments = { |
204 | | - # "WIB1_System": wib1_conf, |
205 | 210 | "WIBEth_System": wibeth_conf, |
206 | | - "TPG_System": tpg_conf, |
207 | | - "PDS_Stream_System": pds_stream_conf, |
208 | | - # "PDS_System": pds_conf, |
209 | | - "TDEEth_System": tde_conf, |
210 | | - # "PACMAN_System": pacman_conf, |
211 | | - # "MPD_System": mpd_conf |
| 211 | + "WIBEth_TPG_System": wib_tpg_conf, |
| 212 | + "DAPHNE_Stream_System": daphne_stream_conf, |
| 213 | + "DAPHNE_System": daphne_conf, |
| 214 | + "DAPHNE_TPG_System": daphne_tpg_conf, |
| 215 | + "TDEEth_System": tde_conf |
212 | 216 | } |
213 | 217 |
|
214 | 218 | # The commands to run in nanorc, as a list |
|
217 | 221 | + [str(run_duration)] |
218 | 222 | + "disable-triggers wait 2 drain-dataflow stop-trigger-sources wait 2 stop scrap terminate".split() |
219 | 223 | ) |
| 224 | +# + "disable-triggers wait 5 drain-dataflow wait 2 stop-trigger-sources wait 2 stop scrap terminate".split() |
220 | 225 |
|
221 | 226 | # The tests themselves |
222 | 227 |
|
@@ -247,34 +252,46 @@ def test_log_files(run_nanorc): |
247 | 252 | def test_data_files(run_nanorc): |
248 | 253 | local_expected_event_count = expected_event_count |
249 | 254 | local_event_count_tolerance = expected_event_count_tolerance |
250 | | - fragment_check_list = [] |
| 255 | + fragment_check_list = [triggercandidate_frag_params] |
| 256 | + current_test = os.environ.get("PYTEST_CURRENT_TEST") |
| 257 | + if "DAPHNE_Stream" in current_test: |
| 258 | + fragment_check_list.append(daphne_stream_frag_params) |
| 259 | + elif "DAPHNE" in current_test: |
| 260 | + fragment_check_list.append(daphne_frag_params) |
| 261 | + elif "WIBEth" in current_test: |
| 262 | + fragment_check_list.append(wibeth_frag_params) |
| 263 | + elif "TDEEth" in current_test: |
| 264 | + fragment_check_list.append(tde_frag_params) |
251 | 265 | if run_nanorc.confgen_config.tpg_enabled: |
252 | | - local_expected_event_count += ( |
253 | | - (6250 / ta_prescale) |
254 | | - * number_of_data_producers |
255 | | - * run_duration |
256 | | - / 100 |
257 | | - ) |
258 | | - local_event_count_tolerance += ( |
259 | | - (250 / ta_prescale) |
260 | | - * number_of_data_producers |
261 | | - * run_duration |
262 | | - / 100 |
263 | | - ) |
264 | | - fragment_check_list.append(wibeth_frag_multi_trig_params) |
265 | 266 | fragment_check_list.append(triggeractivity_frag_params) |
266 | | - fragment_check_list.append(triggerprimitive_frag_params) |
267 | | - else: |
268 | | - fragment_check_list.append(triggercandidate_frag_params) |
269 | | - current_test = os.environ.get("PYTEST_CURRENT_TEST") |
270 | | - if "PDS_Stream" in current_test: |
271 | | - fragment_check_list.append(pds_stream_frag_params) |
272 | | - elif "PDS" in current_test: |
273 | | - fragment_check_list.append(pds_frag_params) |
274 | | - elif "WIBEth" in current_test: |
275 | | - fragment_check_list.append(wibeth_frag_params) |
276 | | - elif "TDEEth" in current_test: |
277 | | - fragment_check_list.append(tde_frag_params) |
| 267 | + if "WIBEth" in current_test: |
| 268 | + fragment_check_list.append(wibeth_triggerprimitive_frag_params) |
| 269 | + local_expected_event_count += ( |
| 270 | + (6250 / ta_prescale) |
| 271 | + * number_of_data_producers |
| 272 | + * run_duration |
| 273 | + / 100 |
| 274 | + ) |
| 275 | + local_event_count_tolerance += ( |
| 276 | + (250 / ta_prescale) |
| 277 | + * number_of_data_producers |
| 278 | + * run_duration |
| 279 | + / 100 |
| 280 | + ) |
| 281 | + if "DAPHNE" in current_test: |
| 282 | + fragment_check_list.append(daphne_triggerprimitive_frag_params) |
| 283 | + local_expected_event_count += ( |
| 284 | + (6250 / ta_prescale) |
| 285 | + * number_of_data_producers |
| 286 | + * run_duration * 3 |
| 287 | + / 200 |
| 288 | + ) |
| 289 | + local_event_count_tolerance += ( |
| 290 | + (250 / ta_prescale) |
| 291 | + * number_of_data_producers |
| 292 | + * run_duration * 6 |
| 293 | + / 250 |
| 294 | + ) |
278 | 295 |
|
279 | 296 | # Run some tests on the output data file |
280 | 297 | all_ok = True |
|
0 commit comments