5 #include "fcs_trg_base.h"
6 #include "fcs_ecal_epd_mask.h"
19 static int or_reduce(
int d8)
25 void fcs_trg_base::stage_3_tonko_202101(
link_t s2[], u_short *dsm)
36 for(
int i=0;i<8;i++) {
37 out_n |= (or_reduce(s2[0].d[i]) || or_reduce(s2[1].d[i]))<<i ;
38 out_s |= (or_reduce(s2[2].d[i]) || or_reduce(s2[3].d[i]))<<i ;
41 big_or = s2[0].d[7] & 0x80 ;
42 big_or |= s2[1].d[7] & 0x80 ;
43 big_or |= s2[2].d[7] & 0x80 ;
44 big_or |= s2[3].d[7] & 0x80 ;
46 if(big_or) big_or = 1 ;
49 n_or = s2[0].d[7] & 0x80 ;
50 n_or |= s2[1].d[7] & 0x80 ;
51 s_or = s2[2].d[7] & 0x80 ;
52 s_or |= s2[3].d[7] & 0x80 ;
59 out_n |= (s_or<<2)|(n_or<<1)|big_or ;
62 int sel = (stage_params[3][0]>>1)&0x7 ;
66 *dsm = (out_s<<8)|out_n ;
69 *dsm = stage_params[3][1] ;
77 for(
int i=0;i<8;i++) {
78 printf(
"%d: 0x%X 0x%X 0x%X 0x%X\n",i,s2[0].d[i],s2[1].d[i],s2[2].d[i],s2[3].d[i]) ;
80 printf(
" sel is %d, dsm is 0x%04X\n",sel,*dsm) ;