GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSE / V2-0-1 > lsew / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LSEW_ctx.h File Reference

Captures the quasi-static context context. More...

#include "LSF/LSF_cpu.h"
#include "LSF/LSF_mode.h"
#include "LSF/LSF_origin.h"
#include "LSE/LSE_ids.h"
#include "LSE/LSE_did.h"
#include "LSE/LSE_etxCtb.h"
#include "LSE/LSEW_ctxPub.h"
#include "EDS/EDS_endianness.h"

Classes

struct  _LSEW_ctxIds
 Contains the LSF identifiers of all standards context contributors. More...
struct  _LSEW_ctxHdr_bf
 Holds information needed of the 2nd word of the ETX context contribution, bit field representation. More...
struct  _LSEW_ctxHdr_us
 Holds information needed of the 2nd word of the ETX context contribution, as two unsigned short integers. More...
union  _LSEW_ctxHdr
 Holds information needed of the 2nd word of the ETX context contribution, union of all the representations. More...
struct  _LSEW_ctxPvt
 The private part of the context. More...
struct  _LSEW_ctx
 Holds information needed to fill in the initial time and counter context record. More...

Typedefs

typedef struct
_LSEW_ctxIds 
LSEW_ctxIds
 Typedef for LSEW_ctxIds.
typedef struct
_LSEW_ctxHdr_bf 
LSEW_ctxHdr_bf
 Typedef for struct _LSEW_ctxHdr_bf.
typedef struct
_LSEW_ctxHdr_us 
LSEW_ctxHdr_us
 Typedef for struct _LSEW_ctxHdr_us.
typedef union
_LSEW_ctxHdr 
LSEW_ctxHdr
 Typedef for union _LSEW_ctxHdr.
typedef struct
_LSEW_ctxPvt 
LSEW_ctxPvt
 Typedef for struct _LSEW_ctxPvt.
typedef struct _LSEW_ctx LSEW_ctx
 Typedef for struct _LSEW_ctx.

Functions

void LSEW_ctxInit (LSEW_ctx *ctx, LSF_CPU_K cpu, LSF_ORIGIN_K origin)
 !!! KLUDGE - None of the stuff following belongs here (except the INIT)
void LSEW_ctxRunStart (LSEW_ctx *ctx, unsigned int runId, unsigned int startTime, LSF_MODE_K mode)
 Sets the context for a new run.
void LSEW_ctxModeChange (LSEW_ctx *ctx, LSF_MODE_K mode)
 Changes the current data-taking mode.
unsigned int * LSEW_ctxOpenAdd (LSEW_ctx *ctx, unsigned int *cur, unsigned int len32, unsigned int reason, unsigned int sequence, const EBF_gem *gem)
 Updates the Time/Counter context structure and inserts the the start of the appropriate (full or abbreviated) LSE_etxCtb contribution into the event datagram.
unsigned int * LSEW_ctxUpdateAdd (LSEW_ctx *ctx, unsigned int *cur, unsigned int len32, unsigned int sequence, const EBF_gem *gem)
 Updates the Time/Counter context structure and inserts an Time contribution in the data stream if necessary.
unsigned int * LSEW_ctxCloseAdd (LSEW_ctx *ctx, unsigned int *cur, unsigned int len32, unsigned int reason)
 Called when an event datagram is filled, it completes the opening LSE_etxCtb contribution by filling in the bridge field from the specified context.


Detailed Description

Captures the quasi-static context context.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: LSEW_ctx.h,v 1.9 2006/09/13 19:46:15 russell Exp $

Typedef Documentation

LSEW_ctxHdr_bf

Typedef for struct _LSEW_ctxHdr_bf.

This word is the second word of the contribution header for the LSE_etx records. The 16-bit opaque field has been divided in 2 4-bit fields and 1 8-bit reserved field

  1. A reason why the packet was opened
  2. A reason why the packet was closed
  3. 4-bits reserved

LSEW_ctxHdr_us

Typedef for struct _LSEW_ctxHdr_us.

This word is the second word of the contribution header for the LSE_etx records. The 16-bit opaque field has been divided in 2 4-bit fields and one 8 bit field

  1. A reason why the packet was opened
  2. A reason why the packet was closed
  3. 8-bits reserved

In this structure the opaque word is represented as a single 16-bit field.

LSEW_ctxIds

Typedef for LSEW_ctxIds.

Since contributor ids are private to a datagram, the user must have a way to define these IDs. That is, they cannot be hardcoded into the utility code.

LSEW_ctxPvt

Typedef for struct _LSEW_ctxPvt.

This piece concerns only the internal details of managing the standard context. It is never exported.


Function Documentation

unsigned int* LSEW_ctxCloseAdd ( LSEW_ctx ctx,
unsigned int *  cur,
unsigned int  len32,
unsigned int  reason 
)

Called when an event datagram is filled, it completes the opening LSE_etxCtb contribution by filling in the bridge field from the specified context.

Returns:
Pointer to the end of the datagram. If insufficient space remains to put the closing information in, it will be omitted. Currently this is a philosophical point, because there is no such information.
Parameters:
cur The current fill point in the event datagram.
len32 The number of 32-bit words available.
ctx The context structure.
reason One of an enumerated list of reasons why this datagram is being closed.
This routine currently only completes the LSE_etxCtb contribution by filling in the closing reason. It adds no new data of its own, so it merely returns cur.

void LSEW_ctxInit ( LSEW_ctx ctx,
LSF_CPU_K  cpu,
LSF_ORIGIN_K  origin 
)

!!! KLUDGE - None of the stuff following belongs here (except the INIT)

!!! KLUDGE - None of the stuff following belongs here (except the INIT)

Parameters:
ctx The Timer/Counter context structure to initialize
cpu The CPU producing this data
origin The originating data source (the LAT, GLEAM, etc)

void LSEW_ctxModeChange ( LSEW_ctx ctx,
LSF_MODE_K  mode 
)

Changes the current data-taking mode.

Parameters:
ctx The destination context
mode The new data-taking mode
This routine does two things
  1. Sets the new data-taking mode
  2. Bumps the mode sequence number to indicate an update

unsigned int* LSEW_ctxOpenAdd ( LSEW_ctx ctx,
unsigned int *  cur,
unsigned int  len32,
unsigned int  reason,
unsigned int  sequence,
const EBF_gem *  gem 
)

Updates the Time/Counter context structure and inserts the the start of the appropriate (full or abbreviated) LSE_etxCtb contribution into the event datagram.

Returns:
The next write pointer or NULL if there is insufficient space. This later condition is considered a specification error; the caller did not provide a big enough buffer to handle even the opening contribution.
Parameters:
ctx The context structure
cur The current write pointer
len32 The number of 32-bit words that are available
reason One of an enumerated list describing why the datagram is being opened.
sequence The sequence number of the next event. If the MSB of this value is set, no updating of extended counters is done. The caller may wish to by-pass this updating because it was already done. For example, this happens in the case of event failing to fit into the previous datagram. Here the update has already occurred.
gem The GEM data record of the next event

void LSEW_ctxRunStart ( LSEW_ctx ctx,
unsigned int  runId,
unsigned int  startTime,
LSF_MODE_K  mode 
)

Sets the context for a new run.

Parameters:
ctx The destination context
runId The run identifier
startTime The run start time rounded to the nearest second
mode The running mode

unsigned int* LSEW_ctxUpdateAdd ( LSEW_ctx ctx,
unsigned int *  cur,
unsigned int  len32,
unsigned int  sequence,
const EBF_gem *  gem 
)

Updates the Time/Counter context structure and inserts an Time contribution in the data stream if necessary.

Returns:
The next write pointer or NULL if there was insufficient space
Parameters:
ctx The context structure
cur The current write pointer
len32 The number of 32-bit words available.
sequence The sequence number of the next event
gem The GEM data record of the next event


Generated on Mon Jul 26 13:00:53 2010 by  doxygen 1.5.3