ICP  1
dae2_policy.h
Go to the documentation of this file.
1 #ifndef DAE2_POLICY_H
2 #define DAE2_POLICY_H
3 
4 #include "dae_policy.h"
5 
7 {
8 protected:
9 // new cards - firmware version in one 32 bit register
10  static const int FIRMVERS = 0x7FFFC;
11  static const unsigned CARDSHIFT = 28;
12 
13 // old cards - firmware version split into two 16 bit registers
14 //#define FIRMVERS0 0x7FFF8 // firmware version register (low 16 bit, RO)
15 //#define FIRMVERS1 0x7FFFC // firmware version register (high 16 bit, RO)
16 public:
17  static const int CRATE_MOD = 100; //< should be same as #DAE3CardPolicy::CRATE_MOD
18  static const std::string card_policy_name;
19  static const std::string card_type;
20 
21  virtual ~DAE2CardPolicy() { }
22  static unsigned long makeAddress(int position, unsigned long address)
23  {
24  return address | ( (position % CRATE_MOD) << CARDSHIFT );
25  }
26  static unsigned long cardFromAddress(unsigned long address)
27  {
28  return address >> CARDSHIFT;
29  }
30  static unsigned long baseAddress(unsigned long address)
31  {
32  unsigned mask = (1 << CARDSHIFT) - 1;
33  return address & mask; // remove card bits
34  }
35 };
36 
38 {
39 // Detector Card
40 // register adresses
41 protected:
42 static const unsigned DCTAC = 0x40000;
43 
44 public:
45  static const std::string det_card_policy_name;
47 static const unsigned DCEVNTMD = 0x40010;
48 
49 protected:
50 
51 static const unsigned DCFCSMD = 0x40014;
52 
56 static const unsigned DCOPMODE = 0x40018;
57 
58 static const unsigned DCTCGTBL = 0x40084;
59 static const unsigned DCTCGLUT = 0x80000;
60 static const unsigned DCDESCR = 0xC0000;
61 static const unsigned DCDESCRX = 0x40080;
62 static const unsigned DCPOSLUT = 0xC0000;
63 static const unsigned DCVETOENABLE = 0x00000;
64 static const unsigned DCVETOFLAG = 0x00004;
65 static const unsigned DCPERSIZE0 = 0x00008;
66 static const unsigned DCPERSIZE1 = 0x0000C;
67 static const unsigned DCPERCNT0 = 0x00010;
68 static const unsigned DCPERCNT1 = 0x00014;
69 static const unsigned DCTOTCNTS = 0x00018;
70 
71 
78 static const unsigned DCNXFRMR = 0x00028;
79 
87 static const unsigned DCNXMEMWR = 0x00020;
88 
91 static const unsigned DCNMEMWR = 0x00024;
92 
102 static const unsigned DCADDLRR = 0x0002C;
103 
104 static const unsigned DCFSDEL0 = 0x00040;
105 static const unsigned DCFSDEL1 = 0x00044;
106 
107 static const unsigned DCMUONSTEP = 0x00100;
108 
109 // TCG lookup 80000 to BFFFC
110 
111 // sizes
112 //static const unsigned DCMAX 16 // maxximum detector card number
113 //static const unsigned DIMMAX 16 // maxximum number of DIMs
114 //static const unsigned POSMAX 0x1000 // number of positions per DIM
115 //static const unsigned DCTCSIZE 0x1000 // maxximum number of time channels
116 //static const unsigned DCDETSIZE 0x1000 // maxximum number of detectors
117 //static const unsigned DCPPFMSIZE 0x10000 // PPFM size (32-bit words)
118 //static const unsigned DCHISSIZE 0x1000000 // size of histogram memory (32-bit words)
119 
120 
121 static const unsigned DCTCGLUTSIZE = (64*1024);
122  // TCG access register bits (DCTAC 0x40000)
123 static const unsigned DCTTCGLUT = 0x00200000;
124 static const unsigned DCTPOSLUT = 0x00400000;
125 static const unsigned DCTDESCR = 0x02000000;
126 static const unsigned DCTHISCLE = 0x80000000;
127 static const unsigned DCTTOTCNTSCLE = 0x40000000;
128 
129 static const unsigned DCMEMSTART = 0x08000000;
130 static const unsigned DCMEMEND = 0x0FFFFFFF;
131 
132 
133 static const unsigned DCPOSMAX = 4096;
134 static const unsigned DCDIMMAX = 16;
135 static const unsigned DCPOSLUTSIZE = (DCDIMMAX*DCPOSMAX);
136 static const unsigned DCMAXSPECPOSLUT = 65535;
137 
138 static const unsigned DCPOSLUTMASK = 0xffff;
139 
140 // note: poslut is 16bit
141 public:
142 static const unsigned DAESPECMAX = 800000;
143 
144 };
145 
146 #include "env_period_registers.h"
147 
149 {
150 public:
151  static const std::string policy_name;
155 
156 public:
157  virtual ~DAE2Policy() { }
158 };
159 
160 #endif /* DAE2_POLICY_H */
static const std::string policy_name
Definition: dae2_policy.h:151
static const unsigned DCFSDEL1
frame sync delay bits 16-17
Definition: dae2_policy.h:105
static const std::string card_type
Definition: dae2_policy.h:19
static const unsigned CARDSHIFT
how many
Definition: dae2_policy.h:11
static const unsigned DCNXMEMWR
Definition: dae2_policy.h:87
static const unsigned DCTTOTCNTSCLE
assert and de-assert to clear total counts register
Definition: dae2_policy.h:127
unused_t
Definition: dae_policy.h:4
DAE2DetCardPolicy det_t
Definition: dae2_policy.h:153
static const unsigned DCPOSLUTMASK
poslut is 32bit aligned, but 16 bit words
Definition: dae2_policy.h:138
static const unsigned DCDIMMAX
max number of DAE1 modules
Definition: dae2_policy.h:134
static const int CRATE_MOD
Definition: dae2_policy.h:17
static unsigned long baseAddress(unsigned long address)
Definition: dae2_policy.h:30
static unsigned long cardFromAddress(unsigned long address)
Definition: dae2_policy.h:26
static const unsigned DCTCGTBL
TCG time bin limit.
Definition: dae2_policy.h:58
static const unsigned DCNMEMWR
Definition: dae2_policy.h:91
static const unsigned DCPOSMAX
max number of DAE1 module positions
Definition: dae2_policy.h:133
static const unsigned DCOPMODE
Definition: dae2_policy.h:56
static const unsigned DCMEMEND
end of histogram memory
Definition: dae2_policy.h:130
static const unsigned DAESPECMAX
should be same as ISISCRPT_MAX_DETECTOR
Definition: dae2_policy.h:142
static const unsigned DCPERCNT0
period counter (number of period) lower bits
Definition: dae2_policy.h:67
static const unsigned DCMAXSPECPOSLUT
max spectrun number POSLUT can refet to (16bits)
Definition: dae2_policy.h:136
static const std::string det_card_policy_name
Definition: dae2_policy.h:45
static const unsigned DCDESCRX
spectrum size (tmax) for cards with FSDELAY - do not use DCDESCR
Definition: dae2_policy.h:61
static const unsigned DCMEMSTART
start address of histogram memory
Definition: dae2_policy.h:129
static const std::string card_policy_name
Definition: dae2_policy.h:18
static const unsigned DCADDLRR
Definition: dae2_policy.h:102
static const int FIRMVERS
firmware version register (32 bit, RO)
Definition: dae2_policy.h:10
static const unsigned DCTOTCNTS
total counts on detector card (32 bits, read only)
Definition: dae2_policy.h:69
static const unsigned DCNXFRMR
Definition: dae2_policy.h:78
static const unsigned DCMUONSTEP
muon step size register (in nanoseconds - 0 means 0.5ns)
Definition: dae2_policy.h:107
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: dae2_policy.h:64
static const unsigned DCPERSIZE1
size of a period in memory in 32 bit words) (higher bit, 6 bits relevant)
Definition: dae2_policy.h:66
static const unsigned DCTPOSLUT
enable POSLUT
Definition: dae2_policy.h:124
static const unsigned DCPOSLUT
position look up table
Definition: dae2_policy.h:62
virtual ~DAE2CardPolicy()
Definition: dae2_policy.h:21
DAE2CardPolicy card_t
Definition: dae2_policy.h:152
static const unsigned DCTHISCLE
histogram memory clear
Definition: dae2_policy.h:126
static const unsigned DCFSDEL0
frame sync delay bits 0-15
Definition: dae2_policy.h:104
static const unsigned DCEVNTMD
event mode register
Definition: dae2_policy.h:47
static unsigned long makeAddress(int position, unsigned long address)
Definition: dae2_policy.h:22
static const unsigned DCTTCGLUT
enable TCGLUT
Definition: dae2_policy.h:123
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: dae2_policy.h:63
static const unsigned DCPERCNT1
period counter (number of period) higher bits, only 6 bits relevant
Definition: dae2_policy.h:68
virtual ~DAE2Policy()
Definition: dae2_policy.h:157
static const unsigned DCTDESCR
enable descriptor register
Definition: dae2_policy.h:125
static const unsigned DCFCSMD
focus mode register
Definition: dae2_policy.h:51
static const unsigned DCTAC
TCG access control.
Definition: dae2_policy.h:42
static const unsigned DCTCGLUT
time channel look up table
Definition: dae2_policy.h:59
static const unsigned DCDESCR
spectrum size (tmax)
Definition: dae2_policy.h:60
static const unsigned DCPERSIZE0
size of a period in memory in 32 bit words (lower bit)
Definition: dae2_policy.h:65
static const unused_t DCRUNMEMCLEAR
run memory clear
Definition: dae2_policy.h:46
static const unsigned DCPOSLUTSIZE
number of 4 byte words
Definition: dae2_policy.h:135
static const unsigned DCTCGLUTSIZE
number of 4 bytes words
Definition: dae2_policy.h:121
DAE2EnvPeriodPolicy env_t
Definition: dae2_policy.h:154