[subexp-daq] Question on COUNTER_DIFF in crate.c

Weber, Guenter Dr. g.weber at hi-jena.gsi.de
Fri Feb 16 01:50:30 CET 2024


Dear friends,


we are now trying to add a new module into NURDLIB. At the beginning, we just want to have a 'software version' of the module, so no hardware involved yet.


We are stuck with the following code in crate.c (line 1262 and following):


            diff_module = COUNTER_DIFF(*module->crate_counter,
                module->event_counter, module->this_minus_crate);
            /* TODO: Clean this. */
            shadow_counter.value =
                module->shadow.data_counter_value;
            shadow_counter.mask = module->event_counter.mask;
            diff_shadow = COUNTER_DIFF(*module->crate_counter,
                shadow_counter, module->this_minus_crate);


As we understand, the idea here is to check with a call of readout_dt if the module's internal counter agrees with the counter of the crate for the given module. Basicly when the crate thinks it has accessed the module n times, the module should report the same number of access attempts. Is this understanding correct?


If yes, how exactly should the module increment it's internal counter? If this is done on readout_dt, a mismatch between the crate and the internal counter occurs as soon as we stop the aquisition.


I can explain in more details, but maybe first you can explain to us what the whole idea behind this check is? To us it looks like also the dummy module implementation will have problems with it.




Thank you very much!




Best greetings

Günter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chalmers.se/pipermail/subexp-daq/attachments/20240216/f4481af8/attachment-0001.html>


More information about the subexp-daq mailing list