/* ===================================================================== * Container for the FEC Data block to configure one FEC. This can be * Board Controller registers plus (if needed) the registers of 8 Altros * on the FEC. The structure is: * * 1) FEE_CONFIGURE for FEC and BC block, parameter = number of words * 2) HW_Address * 3) Checksum * * 4) Payload: Data for 1 FEC (Board Controller and 8 Altros) * * 5) FEE_VERIFICATION (FEC Block) * 6) CE_CMD_TAILER - End of FEE_VERIFICATION * * 7) FEE_CONFIGURE_END - End of FEE_CONFIGURE * 8) HW_Address, same as above * 9) CE_CMD_TAILER - End of FEE_CONFIGURE_END * * 10) CE_CMD_TAILER - End of FEE_CONFIGURE * ===================================================================== */ /* * Author: C. Lippmann, Christian.Lippmann@cern.ch */ #ifndef FECCONTAINER_H #define FECCONTAINER_H #include "AltroContainer.h" #include #include #include using namespace std; class FecContainer{ public: FecContainer(); FecContainer(uint32_t hardwareAddress); ~FecContainer(); void setHardwareAddress(uint32_t hardwareAddress) { fHardwareAddress = hardwareAddress; }; void setVerification(bool verif) { fVerif = verif; }; uint32_t getHardwareAddress() { return fHardwareAddress; }; bool getVerification() { return fVerif; }; bool getAltroInstructionStore() { return fStore; }; void setAltroInstructionStore(bool store = true); void setReadResult(bool read = true); uint32_t getCheckSum() { return fCheckSum; }; bool getReadResult() { return fRead; }; uint32_t *getDataBlock(); uint32_t size() { return fPayload.size(); }; vector::iterator begin() { return fPayload.begin(); }; vector::iterator end() { return fPayload.end(); }; void finalize(); void reset(); bool empty(); void fillBc(uint32_t data); void fillBc(uint64_t data); void fillBc(uint32_t data, bool addTailer); void fillBc(uint64_t data, bool addTailer); void fillAltro(uint32_t altro, uint32_t data); void fillAltro(uint32_t altro, uint64_t data); private: void CalculateCheckSum(); RCUControlEngine fRCUce; // RCU Control Engine RCUCommandCoder fRCU; // RCUCommandCoder AltroContainer fAltro[8]; vector fPayload; uint32_t fHardwareAddress; uint32_t fConfigId; uint32_t fCheckSum; bool fVerif; bool fStore; bool fRead; uint32_t fMaxSize; uint32_t fSizeCounter; }; #endif // FECCONTAINER_H