otsdaq_components  v2_02_00
FSSRPurdueFirmware.h
1 #ifndef _ots_FSSRPurdueFirmware_h_
2 #define _ots_FSSRPurdueFirmware_h_
3 
4 #include <string>
5 #include "otsdaq-components/DAQHardware/FSSRFirmwareBase.h"
6 //#include "otsdaq-components/DAQHardware/FirmwareSequence.h"
7 //#include "otsdaq-components/DetectorConfiguration/ROCStream.h"
8 //#include "otsdaq-components/DAQHardware/OtsUDPFirmwareCore.h"
9 
10 namespace ots
11 {
12 
13 class FrontEndFirmwareBase;
14 
16 {
17 
18 public:
19  FSSRPurdueFirmware (std::string communicationFirmwareType, unsigned int communicationFirmwareVersion = -1, unsigned int applicationFirmwareVersion = -1);
20  virtual ~FSSRPurdueFirmware(void);
21  virtual void init(void);
22 
23 protected:
24 
25  /*
26  //FEW specific methods
27  std::string configureClocks(std::string source, double frequency);
28  std::string resetDetector (int channel=-1);
29  std::string enableTrigger (void);
30 
31  void readBurstDestinationIP(std::string& buffer);
32  void readBurstDestinationMAC(std::string& buffer);
33  void readBurstDestinationPort(std::string& buffer);
34 
35  void writeBurstDestinationIP (std::string& buffer, const uint64_t value);
36  void writeBurstDestinationMAC (std::string& buffer, const uint64_t value);
37  void writeBurstDestinationPort(std::string& buffer, const uint64_t value);
38 
39 
40  void makeDACSequence (FirmwareSequence<uint64_t>& sequence, unsigned int channel, const ROCStream& rocStream);
41  void makeMaskSequence (FirmwareSequence<uint64_t>& sequence, unsigned int channel, const ROCStream& rocStream);
42  void makeDACSequence (FirmwareSequence<uint32_t>& sequence, unsigned int channel, const ROCStream& rocStream);
43  void makeDACBuffer (std::string& buffer, unsigned int channel, const ROCStream& rocStream);
44  void makeDACBuffer (std::vector<std::string>& buffer, unsigned int channel, const ROCStream& rocStream);
45  void makeMaskSequence (FirmwareSequence<uint32_t>& sequence, unsigned int channel, const ROCStream& rocStream);
46  void makeMaskBuffer (std::string& buffer, unsigned int channel, const ROCStream& rocStream);
47  void setFrequencyFromClockState (std::string& buffer, double frequency);
48  bool isClockStateExternal (void);
49 
50  //FER specific methods
51  std::string resetBCO (void);
52  std::string startStream (bool channel0, bool channel1, bool channel2, bool channel3, bool channel4, bool channel5);
53  std::string stopStream (void);
54 
55 //protected:
56  void makeMaskSequence(FirmwareSequence<uint64_t>& sequence, unsigned int channel, const ROCStream& rocStream, const std::string& registerName);
57  void makeMaskSequence(FirmwareSequence<uint32_t>& sequence, unsigned int channel, const ROCStream& rocStream, const std::string& registerName);
58  void makeMaskBuffer (std::string& buffer, unsigned int channel, const ROCStream& rocStream, const std::string& registerName);
59 
60  void setCSRRegister (uint32_t total);
61  void writeCSRRegister (std::string& buffer);
62 
63  uint32_t stripCSRRegisterValue_;
64  //Set values for register STRIP_CSR (Strip Control Register)
65  void setPacketSizeStripCSR (uint32_t size);
66  void enableChannelsStripCSR (bool channel0, bool channel1, bool channel2, bool channel3, bool channel4, bool channel5);
67  void setExternalBCOClockSourceStripCSR(std::string clockSource);
68  void setHaltStripCSR (bool set);
69  void enableBCOStripCSR (bool enable);
70  void flushBuffersStripCSR (void);
71  void resetTriggerCounterStripCSR (std::string& buffer);
72  void resetBCOCounterStripCSR (void);
73  void enableTriggerStripCSR (bool enable);
74  void sendTriggerDataStripCSR (bool send);
75  void sendTriggerNumberStripCSR (bool send);
76  void sendBCOStripCSR (bool send);
77  void enableStreamStripCSR (bool enable);
78  void resetDCMStripCSR (bool clear);
79  uint32_t waitDCMResetStripCSR (void);
80  std::string readCSRRegister (void);
81 
82  uint32_t stripResetRegisterValue_;
83  //Set values for register STRIP_RESET (Strip Reset)
84  void resetStripResetRegisterValue(void)
85  {
86  stripResetRegisterValue_ = 0;
87  }
88  void resetDAC (void);
89  void resetLink (bool channel0, bool channel1, bool channel2, bool channel3, bool channel4, bool channel5);
90  void clearErrors (bool channel0, bool channel1, bool channel2, bool channel3, bool channel4, bool channel5);
91  void clearFIFO (bool channel0, bool channel1, bool channel2, bool channel3, bool channel4, bool channel5);
92  void resetChip (bool channel0, bool channel1, bool channel2, bool channel3, bool channel4, bool channel5);
93 
94  uint32_t stripBCODCMRegisterValue_;
95  void setFrequencyRatio (std::string& buffer, int numerator, int denominator);
96 
97  void configureStripTriggerUnbiased (std::string& buffer);
98  void configureTriggerInputs (std::string& buffer);
99 
100  uint32_t stripTriggerCSRRegisterValue_;
101  //Registers setters
102  void BCOOffset(uint32_t offset);
103  void selectSpyFIFO(uint32_t input);
104  void halt(bool halt);
105 
106 
107  std::string resetSlaveBCO(void);
108  */
109 };
110 
111 }
112 
113 #endif