55 |
$ .false.) then |
$ .false.) then |
56 |
C++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
C++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
57 |
C--------------------------------------compressed mode |
C--------------------------------------compressed mode |
58 |
if(debug)print*,'DSP #',DSPn,' --> compressed ' |
if(debug.eq.1)print*,'DSP #',DSPn,' --> compressed ' |
59 |
is = 0 |
is = 0 |
60 |
il = 0 |
il = 0 |
61 |
prec_ind = 0 |
prec_ind = 0 |
64 |
if( idata.gt.NWORDMAX )goto 335 !end to end |
if( idata.gt.NWORDMAX )goto 335 !end to end |
65 |
nword_DSP = nword_DSP +1 |
nword_DSP = nword_DSP +1 |
66 |
if( nword_DSP.gt.datalength(iv) )then |
if( nword_DSP.gt.datalength(iv) )then |
67 |
if( debug )print*,'filladc --> missing end-of-ladder', |
if( debug.eq.1 ) |
68 |
|
$ print*,'filladc --> missing end-of-ladder', |
69 |
$ ' in COMPRESSED mode - DSP ',DSPn |
$ ' in COMPRESSED mode - DSP ',DSPn |
70 |
if(debug)print*,'datalength = ',datalength(iv) |
if(debug.eq.1) |
71 |
|
$ print*,'datalength = ',datalength(iv) |
72 |
iflag=1 |
iflag=1 |
73 |
c GOOD1(DSPn) = 10 |
c GOOD1(DSPn) = 10 |
74 |
c GOOD1(DSPn) = GOOD1(DSPn) + 2**4 |
c GOOD1(DSPn) = GOOD1(DSPn) + 2**4 |
82 |
call compdecode(word,flag,tipo,info,errflag) |
call compdecode(word,flag,tipo,info,errflag) |
83 |
|
|
84 |
if(errflag.ne.0.) then |
if(errflag.ne.0.) then |
85 |
if(debug)print*,'filladc --> ERROR on compdecode' |
if(debug.eq.1)print*,'filladc --> ERROR on compdecode' |
86 |
iflag=1 |
iflag=1 |
87 |
c GOOD1(DSPn) = 10 |
c GOOD1(DSPn) = 10 |
88 |
c GOOD1(DSPn) = GOOD1(DSPn) + 2**4 |
c GOOD1(DSPn) = GOOD1(DSPn) + 2**4 |
94 |
if(flag.eq.1) then ! flag: fine messaggio (ladder) |
if(flag.eq.1) then ! flag: fine messaggio (ladder) |
95 |
|
|
96 |
if(info.ne.1.and.info.ne.2.and.info.ne.3) then |
if(info.ne.1.and.info.ne.2.and.info.ne.3) then |
97 |
if(debug)print*, |
if(debug.eq.1)print*, |
98 |
$ 'filladc --> wrong end-of-ladder ' |
$ 'filladc --> wrong end-of-ladder ' |
99 |
$ //'in COMPRESSED mode' |
$ //'in COMPRESSED mode' |
100 |
if(debug)print*, |
if(debug.eq.1)print*, |
101 |
$ ' info(=ladder) ',info,' type ',tipo |
$ ' info(=ladder) ',info,' type ',tipo |
102 |
iflag=1 |
iflag=1 |
103 |
c GOOD1(DSPn) = 10 |
c GOOD1(DSPn) = 10 |
153 |
if(iaddr.ge.is+1.and.iaddr.le.3072) then |
if(iaddr.ge.is+1.and.iaddr.le.3072) then |
154 |
|
|
155 |
if(is.eq.0.or.is.eq.1024.or.is.eq.2048)then |
if(is.eq.0.or.is.eq.1024.or.is.eq.2048)then |
156 |
if(debug)print*,'filladc -->' |
if(debug.eq.1)print*,'filladc -->' |
157 |
$ ,' previous transmitted strip ',is |
$ ,' previous transmitted strip ',is |
158 |
$ ,' - missing first ADC value' |
$ ,' - missing first ADC value' |
159 |
iflag=1 |
iflag=1 |
199 |
is = iaddr |
is = iaddr |
200 |
prec_ind = 1 |
prec_ind = 1 |
201 |
else |
else |
202 |
if(debug)print*,'filladc --> address '// |
if(debug.eq.1)print*,'filladc --> address '// |
203 |
$ 'out of range - iaddr,is',iaddr,is |
$ 'out of range - iaddr,is',iaddr,is |
204 |
iflag=1 |
iflag=1 |
205 |
c GOOD1(DSPn) = 10 |
c GOOD1(DSPn) = 10 |
213 |
if(prec_ind.eq.0) is=is+1 |
if(prec_ind.eq.0) is=is+1 |
214 |
if(info.ge.0.and.info.le.4095) then |
if(info.ge.0.and.info.le.4095) then |
215 |
if(is.gt.3072)then |
if(is.gt.3072)then |
216 |
if(debug)print*, |
if(debug.eq.1)print*, |
217 |
$ 'filladc --> strip out of range - DSPn,is' |
$ 'filladc --> strip out of range - DSPn,is' |
218 |
$ ,DSPn,is |
$ ,DSPn,is |
219 |
iflag=1 |
iflag=1 |
238 |
|
|
239 |
oldVAL=newVAL |
oldVAL=newVAL |
240 |
else |
else |
241 |
if(debug) |
if(debug.eq.1) |
242 |
$ print*,'filladc --> datum out of range - info' |
$ print*,'filladc --> datum out of range - info' |
243 |
$ ,info |
$ ,info |
244 |
iflag=1 |
iflag=1 |
268 |
C++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
C++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
269 |
C--------------------------------------------full mode |
C--------------------------------------------full mode |
270 |
|
|
271 |
if(debug)print*,'DSP #',DSPn,' --> full ' |
if(debug.eq.1)print*,'DSP #',DSPn,' --> full ' |
272 |
|
|
273 |
do i=1,3 !loop over ladder |
do i=1,3 !loop over ladder |
274 |
do j=1,1024 !loop over strips |
do j=1,1024 !loop over strips |
276 |
if( idata.gt.NWORDMAX )goto 335 !go to end |
if( idata.gt.NWORDMAX )goto 335 !go to end |
277 |
nword_DSP = nword_DSP +1 |
nword_DSP = nword_DSP +1 |
278 |
if( nword_DSP.gt.datalength(iv) )then |
if( nword_DSP.gt.datalength(iv) )then |
279 |
if( debug ) |
if( debug.eq.1 ) |
280 |
$ print*,'filladc --> missing end-of-ladder', |
$ print*,'filladc --> missing end-of-ladder', |
281 |
$ ' in FULL mode - DSP ',DSPn |
$ ' in FULL mode - DSP ',DSPn |
282 |
if(debug)print*,'datalength = ',datalength |
if(debug.eq.1)print*,'datalength = ',datalength |
283 |
goto 334 !next view |
goto 334 !next view |
284 |
endif |
endif |
285 |
is=j+1024*(i-1) |
is=j+1024*(i-1) |
304 |
if( idata.gt.NWORDMAX )goto 335 !go to end |
if( idata.gt.NWORDMAX )goto 335 !go to end |
305 |
nword_DSP = nword_DSP +1 |
nword_DSP = nword_DSP +1 |
306 |
if( nword_DSP.gt.datalength(iv) )then |
if( nword_DSP.gt.datalength(iv) )then |
307 |
if( debug ) |
if( debug.eq.1 ) |
308 |
$ print*,'filladc --> missing end-of-ladder', |
$ print*,'filladc --> missing end-of-ladder', |
309 |
$ ' in FULL mode - DSP ',DSPn |
$ ' in FULL mode - DSP ',DSPn |
310 |
if(debug)print*,'datalength = ',datalength |
if(debug.eq.1)print*,'datalength = ',datalength |
311 |
goto 334 !next view |
goto 334 !next view |
312 |
endif |
endif |
313 |
if(datatracker(idata).ne.ior(z'1800',i+3)) then |
if(datatracker(idata).ne.ior(z'1800',i+3)) then |
314 |
if(debug) |
if(debug.eq.1) |
315 |
$ print*,'filladc --> ', |
$ print*,'filladc --> ', |
316 |
$ 'wrong end-of-ladder in FULL mode' |
$ 'wrong end-of-ladder in FULL mode' |
317 |
if(debug) |
if(debug.eq.1) |
318 |
$ print*,' word ',datatracker(idata) |
$ print*,' word ',datatracker(idata) |
319 |
if(debug) |
if(debug.eq.1) |
320 |
$ print*,' should be ',ior(z'1800',i+3) |
$ print*,' should be ',ior(z'1800',i+3) |
321 |
iflag=1 |
iflag=1 |
322 |
c GOOD1(DSPn) = 10 |
c GOOD1(DSPn) = 10 |
328 |
endif |
endif |
329 |
goto 334 |
goto 334 |
330 |
333 continue |
333 continue |
331 |
if(debug)print*,'filladc --> ',iv |
if(debug.eq.1)print*,'filladc --> ',iv |
332 |
$ ,'^ DSP packet missing or corrupted: ' |
$ ,'^ DSP packet missing or corrupted: ' |
333 |
$ ,'DSPn, datalength(iv) => ' |
$ ,'DSPn, datalength(iv) => ' |
334 |
$ ,DSPn,datalength(iv) |
$ ,DSPn,datalength(iv) |
336 |
enddo |
enddo |
337 |
goto 336 |
goto 336 |
338 |
335 continue |
335 continue |
339 |
if(debug)print*,'filladc --> reached end of buffer:', |
if(debug.eq.1)print*,'filladc --> reached end of buffer:', |
340 |
$ ' datatracker(',NWORDMAX,')' |
$ ' datatracker(',NWORDMAX,')' |
341 |
|
|
342 |
336 continue |
336 continue |