#include "BFU/BFR_ids.h"
Defines | |
| #define | BFR_C_SUCCESS 0 |
| Indicates the routine succeeded. | |
| #define | BFR_C_TOOMANY -1 |
| Attempt to allocate too many ro descriptors. | |
| #define | BFR_C_DUPLICATE -2 |
| Attempt to add an existing ro descriptor. | |
Typedefs | |
| typedef int(* | BFR_rdRtn )(void *rdPrm, int sequence, void *dst, int len) |
| The callback signature to add a user defined record to the input data. | |
| typedef _BFR_rop | BFR_rop |
| Typedef for struct _BFR_rop. | |
| typedef _BFR_roi | BFR_roi |
| Typedef for struct _BFR_roi. | |
Functions | |
| int | BFR_rop_sizeof (int rod_max) |
| Calculates the size of a BFR readout control structure which can hold rod_max readout descriptors. More... | |
| BFR_rop * | BFR_rop_get (int rod_max) |
| Allocates a BFR readout control structure which can hold rod_max readout descriptors. More... | |
| BFR_rop * | BFR_rop_init (BFR_rop *rop, unsigned int hdr_id, int rod_max, unsigned int tlr_id, int sum_cnt, int sum_size) |
| Initializes a previously allocated readout program. More... | |
| const BFR_rop * | BFR_rop_configure (unsigned int hdr_id, unsigned int ro_list, unsigned int tlr_id, int sum_cnt, int sum_size, const BFR_id *output_order, const BFR_id *input_order, const unsigned int *ivte_ids, const int *data_sizes, const unsigned int *tem_vmes, const int *data_fifos, const int *size_fifos, const BFR_rdRtn *rdRtns, void *const *rdPrms) |
| High level routine to construct a readout program. More... | |
| void | BFR_rop_print (const BFR_rop *rop) |
| Diagnostic routine to print the contents of an readout program. rod_max readout descriptors. More... | |
| int | BFR_rod_add (BFR_rop *rop, int input, BFR_id rid, unsigned int id, int size, unsigned int data_fifo, unsigned int size_fifo, BFR_rdRtn rdRtn, void *rdPrm) |
| Adds a readout descriptor to the readout program. More... | |
| BFR_roi * | BFR_roi_construct (const BFR_rop *rop) |
| Constructs a template readout image from an readout program. More... | |
| void | BFR_roi_print (const BFR_roi *roi) |
| Diagnostic print routine to display the contents of a readout image. More... | |
| int | BFR_roi_bind0 (BFR_roi *roi, int nread, unsigned int sequence) |
| Does the phase 0 of binding the readout image to a specific readout instance. More... | |
| int | BFR_roi_read0 (BFR_roi *roi) |
| Does phase 0 of reading out the event. More... | |
| int | BFR_roi_pend0 (BFR_roi *roi) |
| Waits for any asynchronous activity associated with the 0th phase of the readout to complete. More... | |
| int | BFR_roi_bind1 (BFR_roi *roi, struct _BFA_acb *acb) |
| Does the phase1 of binding the readout image to a specific readout instance. More... | |
| int | BFR_roi_read1 (BFR_roi *roi) |
| Does the first phase of reading out the event. More... | |
| int | BFR_roi_pend1 (BFR_roi *roi) |
| Waits for any asynchronous activity associated with the phase 1 of the readout to complete. More... | |
| int | BFR_roi_copy1 (BFR_roi *roi, struct _BFA_acb *acb) |
| Completes the output record by copying an indirectly read data into the output record. More... | |
| int | BFR_roi_finish (BFR_roi *roi, struct _BFA_acb *acb) |
| Performs any work needed after the event and all summary information has been read in. More... | |
| _BFU_fileDsc * | BFR_roi_evtDscGet (const BFR_roi *roi) |
| Returns a pointer to an event descriptor structure. More... | |
DESCRIPTION
-----------
There are 2 data structures being managed.
ROP - readout program ROI - readout image
ROP
---
The readout program contains all the static information about the readout. It depends only on what is being readout and the form of the output record. Specifically one needs to specify which hardware and software components are being used to assemble an output event. The caller is allowed to control both the gathering of the data from the hardware and its assembly into an output event.
While all the low level routines needed to construct the readout program are made public, the general user should find it sufficient to call BFR_rop_configure.
ROI
---
The readout image contains all the modular aspects of the readout. In particular, in addition to carrying along all the information of a ROP, it also carries prototypes to perform the hardware acquisition and an array of the sizes of any variable length data.
USAGE
-----
The general flow is
These first three calls are initialization calls In principle, one could get more than one ROI. That way one could continue to build up multiple readouts, before performing them.
In practice, I do not know whether this is a good idea or not. But from a modularity viewpoint, it seems right. I suspect that the right way to do this is to construct one ROI and keep appending to it, ie. perform multiple BFR_roi_read0's.
rop = BFR_rop_configure (ro_list, .... ); /- Specify input and output -/
roi = BFR_roi_construct (rop); /- Construct an ROI instance -/
mcb = BFA_get (pool_size, max); /- Get a memory pool -/
When it time to go read the events, do
BFR_roi_complete0 (roi, nread, nsequence, ...);
BFR_roi_read0 (roi); /- Performs the first phase of reading ... -/
/- specifically reads the lengths of any ... -/
/- variable size data ... -/
BFR_roi_pend0 (roi, ...); /- Wait till done ... -/
BFR_roi_complete1 (roi); /- Can now construct DMA list ... -/
/- since all sizes are now known -/
BFR_roi_pend1 (roi, ...); /- Wait till done -/
|
||||||||||||||||||||||||||||||||||||||||
|
Adds a readout descriptor to the readout program.
|
|
||||||||||||||||
|
Does the phase 0 of binding the readout image to a specific readout instance.
|
|
||||||||||||
|
Does the phase1 of binding the readout image to a specific readout instance.
|
|
|
Constructs a template readout image from an readout program.
|
|
||||||||||||
|
Completes the output record by copying an indirectly read data into the output record.
|
|
|
Returns a pointer to an event descriptor structure.
|
|
||||||||||||
|
Performs any work needed after the event and all summary information has been read in.
|
|
|
Waits for any asynchronous activity associated with the 0th phase of the readout to complete.
Now, under the truth in advertising, the only IO activity associated with this phase must be performed synchronously, but calling BFR_roi_pend0() gives this the same look and feel as the next phase of readout. |
|
|
Waits for any asynchronous activity associated with the phase 1 of the readout to complete.
|
|
|
Diagnostic print routine to display the contents of a readout image.
|
|
|
Does phase 0 of reading out the event.
Now, under the truth in advertising, the only IO activity associated with this phase must be performed synchronously, but calling BFR_roi_pend0() gives this the same look and feel as the next phase of readout. |
|
|
Does the first phase of reading out the event.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
High level routine to construct a readout program.
|
|
|
Allocates a BFR readout control structure which can hold rod_max readout descriptors.
This is merely a convenience routine. The user can control his own memory allocation by calling BFR_sizeof_rop() to get the size of the readout program, then using his favorite allocator to obtain the memory. |
|
||||||||||||||||||||||||||||
|
Initializes a previously allocated readout program.
|
|
|
Diagnostic routine to print the contents of an readout program. rod_max readout descriptors.
|
|
|
Calculates the size of a BFR readout control structure which can hold rod_max readout descriptors.
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002