ICP  1
dae3_policy.h
Go to the documentation of this file.
1 #ifndef DAE3_POLICY_H
2 #define DAE3_POLICY_H
3 
4 #include "dae_policy.h"
5 
7 {
8 protected:
9 
10 // new cards - firmware version in one 32 bit register
11 static const int FIRMVERS = 0x7FFFC;
12 static const uint32_t CARDSPACE = 0x28000000;
13 
14 // old cards - firmware version split into two 16 bit registers
15 //#define FIRMVERS0 0x7FFF8 // firmware version register (low 16 bit, RO)
16 //#define FIRMVERS1 0x7FFFC // firmware version register (high 16 bit, RO)
17 public:
18  virtual ~DAE3CardPolicy() { }
19  static const int CRATE_MOD = 100;
20  static const std::string card_policy_name;
21  static const std::string card_type;
22  static unsigned long makeAddress(int position, unsigned long address)
23  {
24  if ( position % CRATE_MOD >= 3 )
25  {
26  return 0xffffffff; // invalid
27  }
28  if ( (0 == address % 4) && (address < CARDSPACE) )
29  {
30  return address + (position % CRATE_MOD) * CARDSPACE;
31  }
32  else
33  {
34  throw std::runtime_error("invalid dae3 address");
35  }
36  }
37  static unsigned long cardFromAddress(unsigned long address)
38  {
39  return address / CARDSPACE;
40  }
41  static unsigned long baseAddress(unsigned long address)
42  {
43  return address % CARDSPACE;
44  }
45 };
46 
47 
49 {
50 // Detector Card
51 // register adresses
52 protected:
53 
54 static const unused_t DCTAC = UNUSED_REGISTER;
55 
56 public:
57 static const std::string det_card_policy_name;
58 static const unsigned DCRUNMEMCLEAR = 0x40000;
59 static const unsigned DCEVNTMD = 0x40010;
60 
61 protected:
62 
63 static const unsigned DCFCSMD = 0x40014;
64 
68 static const unsigned DCOPMODE = 0x40018;
69 
70 static const unsigned DCTCGTBL = 0x284;
71 static const unsigned DCTCGLUT = 0x20000000;
73 static const unsigned DCDESCRX = 0x280;
74 static const unsigned DCPOSLUT = 0x22000000;
75 static const unsigned DCFRAMEMEM = 0x24000000;
76 static const unsigned DCVETOENABLE = 0x40080;
77 static const unsigned DCVETOFLAG = 0x00174;
78 static const unsigned DCPERSIZE0 = 0x0027c;
79 static const unsigned DCPERSIZE1 = 0x0027c;
80 static const unsigned DCPERCNT0 = 0x00300;
81 static const unsigned DCPERCNT1 = 0x00300;
82 static const unsigned DCTOTCNTS = 0x00018;
83 //static const unsigned DCTOTCNTS = 0x2800001C;///< total counts on detector card (32 bits, read only) @todo 0x001C as well upper bits
84 
85 
92 static const unsigned DCNXFRMR = 0x00028;
93 
101 static const unsigned DCNXMEMWR = 0x00020;
102 
105 static const unsigned DCNMEMWR = 0x00024;
106 
116 static const unsigned DCADDLRR = 0x0002C;
117 
118 static const unsigned DCFSDEL0 = 0x00200;
119 static const unsigned DCFSDEL1 = 0x00200;
120 
121 static const unsigned DCMUONSTEP = 0x00288;
122 
123 // TCG lookup 80000 to BFFFC
124 
125 // sizes
126 //static const unsigned DCMAX 16 // maxximum detector card number
127 //static const unsigned DIMMAX 16 // maxximum number of DIMs
128 //static const unsigned POSMAX 0x1000 // number of positions per DIM
129 //static const unsigned DCTCSIZE 0x1000 // maxximum number of time channels
130 //static const unsigned DCDETSIZE 0x1000 // maxximum number of detectors
131 //static const unsigned DCPPFMSIZE 0x10000 // PPFM size (32-bit words)
132 //static const unsigned DCHISSIZE 0x1000000 // size of histogram memory (32-bit words)
133 
134 
135 static const unsigned DCTCGLUTSIZE = (64*1024);
136  // TCG access register bits (DCTAC 0x40000)
137 static const unsigned DCTTCGLUT = 0x00200000;
138 static const unsigned DCTPOSLUT = 0x00400000;
139 static const unsigned DCTDESCR = 0x02000000;
140 static const unsigned DCTHISCLE = 0x80000000;
141 static const unsigned DCTTOTCNTSCLE = 0x40000000;
142 
143 static const unsigned DCMEMSTART = 0x0;
144 static const unsigned DCMEMEND = 0x1FFFFFFF;
145 
146 
147 static const unsigned DCPOSMAX = 4096;
148 static const unsigned DCDIMMAX = 16;
149 static const unsigned DCPOSLUTSIZE = (DCDIMMAX*DCPOSMAX);
150 static const unsigned DCMAXSPECPOSLUT = 65535;
151 
152 static const unsigned DCPOSLUTMASK = 0xffffffff;
153 
154 // note: poslut is 16bit
155 public:
156 static const unsigned DAESPECMAX = 800000;
157 
158 };
159 
161 
163 {
164 public:
165  static const std::string policy_name;
169 
170 public:
171  virtual ~DAE3Policy() { }
172 };
173 
174 #endif /* DAE3_POLICY_H */
static const unsigned DCTCGLUTSIZE
number of 4 bytes words
Definition: dae3_policy.h:135
static const unsigned DCTPOSLUT
enable POSLUT
Definition: dae3_policy.h:138
static const unsigned DCTTOTCNTSCLE
assert and de-assert to clear total counts register
Definition: dae3_policy.h:141
static const unused_t DCTAC
TCG access control.
Definition: dae3_policy.h:54
static const unsigned DCPOSLUTMASK
all 32bits of poslut is valid
Definition: dae3_policy.h:152
static const unsigned DCFRAMEMEM
frame memory
Definition: dae3_policy.h:75
static const unsigned DCNXMEMWR
Definition: dae3_policy.h:101
static const uint32_t CARDSPACE
space allocated to a card
Definition: dae3_policy.h:12
static const unsigned DCMEMSTART
start address of histogram/run memory
Definition: dae3_policy.h:143
static const unused_t DCDESCR
spectrum size (tmax)
Definition: dae3_policy.h:72
static const unsigned DCPERCNT0
period counter (number of period) lower bits
Definition: dae3_policy.h:80
static const unsigned DCEVNTMD
event mode register
Definition: dae3_policy.h:59
DAE3EnvPeriodPolicy env_t
Definition: dae3_policy.h:168
unused_t
Definition: dae_policy.h:4
static const std::string card_type
Definition: dae3_policy.h:21
static const int FIRMVERS
firmware version back end FPGA
Definition: dae3_policy.h:11
static const unsigned DCTOTCNTS
total counts on detector card (32 bits, read only)
Definition: dae3_policy.h:82
static unsigned long cardFromAddress(unsigned long address)
Definition: dae3_policy.h:37
static const unsigned DCNMEMWR
Definition: dae3_policy.h:105
static const unsigned DCOPMODE
Definition: dae3_policy.h:68
static const std::string card_policy_name
Definition: dae3_policy.h:20
static const unsigned DCDIMMAX
max number of DAE1 modules
Definition: dae3_policy.h:148
static const unsigned DCRUNMEMCLEAR
run memory clear
Definition: dae3_policy.h:58
static const unsigned DCPERCNT1
period counter (number of period) higher bits, only 6 bits relevant
Definition: dae3_policy.h:81
static const std::string policy_name
Definition: dae3_policy.h:165
static const unsigned DCPERSIZE0
size of a period in memory in 32 bit words (lower bit)
Definition: dae3_policy.h:78
static const unsigned DCPOSLUT
position look up table
Definition: dae3_policy.h:74
static const unsigned DCTCGTBL
TCG time bin limit.
Definition: dae3_policy.h:70
static const unsigned DCTCGLUT
time channel look up table
Definition: dae3_policy.h:71
static const unsigned DCTDESCR
enable descriptor register
Definition: dae3_policy.h:139
static const unsigned DCTTCGLUT
enable TCGLUT
Definition: dae3_policy.h:137
static const unsigned DCNXFRMR
Definition: dae3_policy.h:92
static const std::string det_card_policy_name
Definition: dae3_policy.h:57
static const unsigned DCTHISCLE
histogram memory clear
Definition: dae3_policy.h:140
static const unsigned DCMUONSTEP
muon step size register (in nanoseconds - 0 means 0.5ns)
Definition: dae3_policy.h:121
static const unsigned DCADDLRR
Definition: dae3_policy.h:116
static const unsigned DAESPECMAX
should be same as ISISCRPT_MAX_DETECTOR
Definition: dae3_policy.h:156
virtual ~DAE3CardPolicy()
Definition: dae3_policy.h:18
static const unsigned DCFCSMD
focus mode register
Definition: dae3_policy.h:63
static const unsigned DCFSDEL0
frame sync delay bits 0-15
Definition: dae3_policy.h:118
static const unsigned DCDESCRX
spectrum size (tmax) for cards with FSDELAY - do not use DCDESCR
Definition: dae3_policy.h:73
static unsigned long makeAddress(int position, unsigned long address)
Definition: dae3_policy.h:22
static const int CRATE_MOD
should be same as DAE2CardPolicy::CRATE_MOD
Definition: dae3_policy.h:19
DAE3DetCardPolicy det_t
Definition: dae3_policy.h:167
static unsigned long baseAddress(unsigned long address)
Definition: dae3_policy.h:41
static const unsigned DCPOSLUTSIZE
number of 4 byte words
Definition: dae3_policy.h:149
static const unsigned DCMEMEND
end of histogram/run memory
Definition: dae3_policy.h:144
static const unsigned DCPERSIZE1
size of a period in memory in 32 bit words) (higher bit, 6 bits relevant)
Definition: dae3_policy.h:79
static const unsigned DCFSDEL1
frame sync delay bits 16-17
Definition: dae3_policy.h:119
static const unsigned DCPOSMAX
max number of DAE1 module positions
Definition: dae3_policy.h:147
static const unsigned DCVETOENABLE
veto enable register, 1=enable, bit 16=dim(0), bit 17=dim(1) etc for fifo veto. Others: bit 15 = fram...
Definition: dae3_policy.h:76
DAE3CardPolicy card_t
Definition: dae3_policy.h:166
static const unsigned DCMAXSPECPOSLUT
max spectrun number POSLUT can refet to (16bits)
Definition: dae3_policy.h:150
virtual ~DAE3Policy()
Definition: dae3_policy.h:171
static const unsigned DCVETOFLAG
set to 1 if veto occurs, bit 16 = dim(0), bit 17 =dim(1) etc for fifo veto only. Others: bit 15 = fra...
Definition: dae3_policy.h:77