format receiver

This commit is contained in:
Erik Frojdh
2020-05-05 10:04:52 +02:00
parent 3618f6e5d3
commit e599bb7c24
35 changed files with 4642 additions and 4530 deletions

146
slsReceiverSoftware/src/Fifo.h Executable file → Normal file
View File

@ -9,102 +9,100 @@
*@short constructs the fifo structure
*/
#include "sls_detector_defs.h"
#include "logger.h"
#include "sls_detector_defs.h"
#include "CircularFifo.h"
class Fifo : private virtual slsDetectorDefs {
public:
/**
* Constructor
* Calls CreateFifos that creates fifos and allocates memory
* @param ind self index
* @param fifoItemSize size of each fifo item
* @param depth fifo depth
*/
Fifo(int ind, uint32_t fifoItemSize, uint32_t depth);
/**
* Destructor
*/
~Fifo();
public:
/**
* Constructor
* Calls CreateFifos that creates fifos and allocates memory
* @param ind self index
* @param fifoItemSize size of each fifo item
* @param depth fifo depth
*/
Fifo(int ind, uint32_t fifoItemSize, uint32_t depth);
/**
* Frees the bound address by pushing into fifoFree
*/
void FreeAddress(char*& address);
/**
* Destructor
*/
~Fifo();
/**
* Pops free address from fifoFree
*/
void GetNewAddress(char*& address);
/**
* Frees the bound address by pushing into fifoFree
*/
void FreeAddress(char *&address);
/**
* Pushes bound address into fifoBound
*/
void PushAddress(char*& address);
/**
* Pops free address from fifoFree
*/
void GetNewAddress(char *&address);
/**
* Pops bound address from fifoBound to process data
*/
void PopAddress(char*& address);
/**
* Pushes bound address into fifoBound
*/
void PushAddress(char *&address);
/**
* Pushes bound address into fifoStream
*/
void PushAddressToStream(char*& address);
/**
* Pops bound address from fifoBound to process data
*/
void PopAddress(char *&address);
/**
* Pops bound address from fifoStream to stream data
*/
void PopAddressToStream(char*& address);
/**
* Pushes bound address into fifoStream
*/
void PushAddressToStream(char *&address);
/**
* Get Maximum Level filled in Fifo Bound
* and reset this value for next intake
*/
int GetMaxLevelForFifoBound();
/**
* Pops bound address from fifoStream to stream data
*/
void PopAddressToStream(char *&address);
/**
* Get Minimum Level filled in Fifo Free
* and reset this value to max for next intake
*/
int GetMinLevelForFifoFree();
/**
* Get Maximum Level filled in Fifo Bound
* and reset this value for next intake
*/
int GetMaxLevelForFifoBound();
private:
/**
* Get Minimum Level filled in Fifo Free
* and reset this value to max for next intake
*/
int GetMinLevelForFifoFree();
/**
* Create Fifos, allocate memory & push addresses into fifo
* @param fifoItemSize size of each fifo item
*/
void CreateFifos(uint32_t fifoItemSize);
private:
/**
* Create Fifos, allocate memory & push addresses into fifo
* @param fifoItemSize size of each fifo item
*/
void CreateFifos(uint32_t fifoItemSize);
/**
* Destroy Fifos and deallocate memory
*/
void DestroyFifos();
/**
* Destroy Fifos and deallocate memory
*/
void DestroyFifos();
/** Self Index */
int index;
/** Self Index */
int index;
/** Memory allocated, whose addresses are pushed into the fifos */
char *memory;
/** Memory allocated, whose addresses are pushed into the fifos */
char* memory;
/** Circular Fifo pointing to addresses of bound data in memory */
CircularFifo<char> *fifoBound;
/** Circular Fifo pointing to addresses of bound data in memory */
CircularFifo<char>* fifoBound;
/** Circular Fifo pointing to addresses of freed data in memory */
CircularFifo<char> *fifoFree;
/** Circular Fifo pointing to addresses of freed data in memory */
CircularFifo<char>* fifoFree;
/** Circular Fifo pointing to addresses of to be streamed data in memory */
CircularFifo<char> *fifoStream;
/** Circular Fifo pointing to addresses of to be streamed data in memory */
CircularFifo<char>* fifoStream;
/** Fifo depth set */
int fifoDepth;
/** Fifo depth set */
int fifoDepth;
volatile int status_fifoBound;
volatile int status_fifoFree;
volatile int status_fifoBound;
volatile int status_fifoFree;
};