$treeview $search $mathjax $extrastylesheet
otsdaq_components
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_FSSRPurdueFirmware_h_ 00002 #define _ots_FSSRPurdueFirmware_h_ 00003 00004 #include <string> 00005 #include "otsdaq-components/DAQHardware/FSSRFirmwareBase.h" 00006 //#include "otsdaq-components/DAQHardware/FirmwareSequence.h" 00007 //#include "otsdaq-components/DetectorConfiguration/ROCStream.h" 00008 //#include "otsdaq-components/DAQHardware/OtsUDPFirmwareCore.h" 00009 00010 namespace ots 00011 { 00012 class FrontEndFirmwareBase; 00013 00014 class FSSRPurdueFirmware : public FSSRFirmwareBase 00015 { 00016 public: 00017 FSSRPurdueFirmware(std::string communicationFirmwareType, 00018 unsigned int communicationFirmwareVersion = -1, 00019 unsigned int applicationFirmwareVersion = -1); 00020 virtual ~FSSRPurdueFirmware(void); 00021 virtual void init(void); 00022 00023 protected: 00024 /* 00025 //FEW specific methods 00026 std::string configureClocks(std::string source, double frequency); 00027 std::string resetDetector (int channel=-1); 00028 std::string enableTrigger (void); 00029 00030 void readBurstDestinationIP(std::string& buffer); 00031 void readBurstDestinationMAC(std::string& buffer); 00032 void readBurstDestinationPort(std::string& buffer); 00033 00034 void writeBurstDestinationIP (std::string& buffer, const uint64_t value); 00035 void writeBurstDestinationMAC (std::string& buffer, const uint64_t value); 00036 void writeBurstDestinationPort(std::string& buffer, const uint64_t value); 00037 00038 00039 void makeDACSequence (FirmwareSequence<uint64_t>& sequence, unsigned 00040 int channel, const ROCStream& rocStream); void makeMaskSequence 00041 (FirmwareSequence<uint64_t>& sequence, unsigned int channel, const ROCStream& rocStream); 00042 void makeDACSequence (FirmwareSequence<uint32_t>& sequence, unsigned 00043 int channel, const ROCStream& rocStream); void makeDACBuffer (std::string& 00044 buffer, unsigned int channel, const ROCStream& rocStream); void makeDACBuffer 00045 (std::vector<std::string>& buffer, unsigned int channel, const ROCStream& rocStream); void 00046 makeMaskSequence (FirmwareSequence<uint32_t>& sequence, unsigned int 00047 channel, const ROCStream& rocStream); 00048 void makeMaskBuffer (std::string& buffer, unsigned int channel, const 00049 ROCStream& rocStream); void setFrequencyFromClockState (std::string& buffer, 00050 double frequency); bool isClockStateExternal (void); 00051 00052 //FER specific methods 00053 std::string resetBCO (void); 00054 std::string startStream (bool channel0, bool channel1, bool channel2, bool 00055 channel3, bool channel4, bool channel5); std::string stopStream (void); 00056 00057 //protected: 00058 void makeMaskSequence(FirmwareSequence<uint64_t>& sequence, unsigned int channel, 00059 const ROCStream& rocStream, const std::string& registerName); void 00060 makeMaskSequence(FirmwareSequence<uint32_t>& sequence, unsigned int channel, const 00061 ROCStream& rocStream, const std::string& registerName); void makeMaskBuffer (std::string& 00062 buffer, unsigned int channel, const ROCStream& rocStream, const std::string& 00063 registerName); 00064 00065 void setCSRRegister (uint32_t total); 00066 void writeCSRRegister (std::string& buffer); 00067 00068 uint32_t stripCSRRegisterValue_; 00069 //Set values for register STRIP_CSR (Strip Control Register) 00070 void setPacketSizeStripCSR (uint32_t size); 00071 void enableChannelsStripCSR (bool channel0, bool channel1, bool channel2, 00072 bool channel3, bool channel4, bool channel5); void 00073 setExternalBCOClockSourceStripCSR(std::string clockSource); void setHaltStripCSR 00074 (bool set); void enableBCOStripCSR (bool enable); void flushBuffersStripCSR 00075 (void); void resetTriggerCounterStripCSR (std::string& buffer); void 00076 resetBCOCounterStripCSR (void); void enableTriggerStripCSR (bool 00077 enable); void sendTriggerDataStripCSR (bool send); void sendTriggerNumberStripCSR 00078 (bool send); void sendBCOStripCSR (bool send); void enableStreamStripCSR 00079 (bool enable); void resetDCMStripCSR (bool clear); uint32_t 00080 waitDCMResetStripCSR (void); std::string readCSRRegister (void); 00081 00082 uint32_t stripResetRegisterValue_; 00083 //Set values for register STRIP_RESET (Strip Reset) 00084 void resetStripResetRegisterValue(void) 00085 { 00086 stripResetRegisterValue_ = 0; 00087 } 00088 void resetDAC (void); 00089 void resetLink (bool channel0, bool channel1, bool channel2, bool 00090 channel3, bool channel4, bool channel5); void clearErrors (bool channel0, 00091 bool channel1, bool channel2, bool channel3, bool channel4, bool channel5); void clearFIFO 00092 (bool channel0, bool channel1, bool channel2, bool channel3, bool channel4, bool 00093 channel5); void resetChip (bool channel0, bool channel1, bool channel2, 00094 bool channel3, bool channel4, bool channel5); 00095 00096 uint32_t stripBCODCMRegisterValue_; 00097 void setFrequencyRatio (std::string& buffer, int numerator, int 00098 denominator); 00099 00100 void configureStripTriggerUnbiased (std::string& buffer); 00101 void configureTriggerInputs (std::string& buffer); 00102 00103 uint32_t stripTriggerCSRRegisterValue_; 00104 //Registers setters 00105 void BCOOffset(uint32_t offset); 00106 void selectSpyFIFO(uint32_t input); 00107 void halt(bool halt); 00108 00109 00110 std::string resetSlaveBCO(void); 00111 */ 00112 }; 00113 } 00114 00115 #endif