-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updates to reader --- mainly to fix iTPC fee_words=0 problem #688
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0d23b02
updates to reader --- mainly to fix iTPC fee_words=0 problem
jml985 314f90a
fixes for tb 400 issue
jml985 2c21a7f
Merge branch 'star-bnl:main' into main
jml985 49a0628
Merge remote-tracking branch 'origin/main' into om
jml985 5bcc439
get rid of dsmout shadowing
jml985 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -374,7 +374,8 @@ u_int *itpc23::ch_scan(u_int *start) | |
is_error = 1 ; | ||
run_errors++ ; | ||
if(mode || (online && run_errors<20)) { | ||
LOG(ERR,"%d: ch_scan %d:%d:%d: pkt %d, sampa %d:%d, words10 %d [0x%08X: 0x%08X 0x%08X], err 0x%X",rdo1,fee_ix,lane_ix, | ||
LOG(ERR,"%d: T %d: ch_scan %d:%d:%d: pkt %d, sampa %d:%d, words10 %d [0x%08X: 0x%08X 0x%08X], err 0x%X", | ||
rdo1,token,fee_ix,lane_ix, | ||
ch_ix, | ||
pkt,sampa_id,sampa_ch,words10, | ||
d[0],d[-1],d[1],err) ; | ||
|
@@ -417,7 +418,7 @@ u_int *itpc23::ch_scan(u_int *start) | |
err |= 0x2000000 ; | ||
run_errors++ ; | ||
if(mode || (online && run_errors<10)) { | ||
LOG(ERR,"%d: ch_scan %d:%d: bx %d, expect %d",rdo1,fee_ix,ch_ix,bx,bx_count) ; | ||
LOG(ERR,"%d: T %d: ch_scan %d:%d:%d bx %d, expect %d",rdo1,token,fee_ix,lane_ix,ch_ix,bx,bx_count) ; | ||
} | ||
} | ||
} | ||
|
@@ -529,7 +530,7 @@ u_int *itpc23::ch_scan(u_int *start) | |
seq[seq_ix].t_hi = tb_start + tb_cou - 1 ; | ||
seq[seq_ix].dta_p = (dd-d_start) ; // where is this sequence... | ||
seq[seq_ix].blob_id = 0 ; | ||
seq_ix++ ; | ||
//seq_ix++ ; | ||
|
||
//dd += tb_cou ; // this doesn't sound correct!!! | ||
|
||
|
@@ -538,6 +539,10 @@ u_int *itpc23::ch_scan(u_int *start) | |
if(unlikely(tb_start<=tb_last)) { | ||
run_errors++ ; | ||
if(mode || (online && run_errors<10))LOG(ERR,"%d: rp %d:%d: tb_start %d, tb_last %d",rdo1,row,pad,tb_start,tb_last) ; | ||
|
||
seq[seq_ix].t_lo = 400 ; | ||
seq[seq_ix].t_hi = 401 ; | ||
|
||
} | ||
|
||
|
||
|
@@ -546,9 +551,12 @@ u_int *itpc23::ch_scan(u_int *start) | |
if(unlikely(tb_last>500)) { | ||
run_errors++ ; | ||
if(mode || (online && run_errors<10)) LOG(ERR,"%d: rp %d:%d: tb_last %d [0x%08X,%d]",rdo1,row,pad,tb_last,d[i],i) ; | ||
} | ||
|
||
seq[seq_ix].t_lo = 400 ; | ||
seq[seq_ix].t_hi = 401 ; | ||
} | ||
|
||
seq_ix++ ; | ||
|
||
ix = 2 ; | ||
break ; | ||
|
@@ -670,7 +678,7 @@ u_int *itpc23::lane_scan(u_int *start) | |
// should be at start of lane 0xB.... | ||
if((d[0]&0xF0000000)!=0xB0000000) { // start of lane | ||
if((online && run_errors<10) || mode) { | ||
LOG(ERR,"%d: lane_scan %d:%d: unknown start 0x%08X [0x%08X 0x%08X]",rdo1,fee_ix,lane_ix,d[0],d[-1],d[1]) ; | ||
LOG(ERR,"%d: T %d: lane_scan %d:%d: unknown start 0x%08X [0x%08X 0x%08X]",rdo1,token,fee_ix,lane_ix,d[0],d[-1],d[1]) ; | ||
} | ||
|
||
if(d[0]==d[-1]) { | ||
|
@@ -703,7 +711,7 @@ u_int *itpc23::lane_scan(u_int *start) | |
if((d[0]&0xF0000000)!=0x70000000) { // end of lane | ||
err |= 0x400000 ; | ||
run_errors++ ; | ||
if((online && run_errors<20)|| mode) LOG(ERR,"%d: lane_scan %d:%d: unknown end 0x%08X",rdo1,fee_ix,lane_ix,d[0]) ; | ||
if((online && run_errors<20)|| mode) LOG(ERR,"%d: T %d: lane_scan %d:%d: unknown end 0x%08X",rdo1,token,fee_ix,lane_ix,d[0]) ; | ||
} | ||
|
||
d++ ; // skip 0x7... | ||
|
@@ -718,7 +726,7 @@ u_int *itpc23::fee_non_trgd(u_int *start) | |
int fee_words = 0 ; | ||
|
||
if(fee_evt_type != 0x02) { // no clue | ||
if(online || mode) LOG(ERR,"%d: fee_non_trgd %d: evt_type 0x%02X",rdo1,fee_ix,fee_evt_type) ; | ||
if(online || mode) LOG(ERR,"%d: T %d: fee_non_trgd %d: evt_type 0x%02X",rdo1,token,fee_ix,fee_evt_type) ; | ||
|
||
|
||
while(d<trl) { | ||
|
@@ -830,7 +838,7 @@ u_int *itpc23::fee_scan(u_int *start) | |
// we must be at 0x8.... | ||
if((d[0]&0xF0000000)!=0x80000000) { // start of fee | ||
err |= 0x10000 ; // oopsy -- what now!? | ||
if(online || mode) LOG(ERR,"%d: fee_scan %d: not start-of-FEE 0x%08X",rdo1,fee_ix,d[0]) ; | ||
if(online || mode) LOG(ERR,"%d: T %d: fee_scan %d: not start-of-FEE 0x%08X",rdo1,token,fee_ix,d[0]) ; | ||
} | ||
else { | ||
if(d[0]&0x00800000) { // from real FEE | ||
|
@@ -859,14 +867,14 @@ u_int *itpc23::fee_scan(u_int *start) | |
} | ||
} | ||
else { // non-physics trigger... typically send_config stuff | ||
LOG(WARN,"%d: non-physics fee_ix %d, padplane %d",rdo1,fee_ix,fee_pp) ; | ||
LOG(WARN,"%d: T %d: non-physics fee_ix %d, padplane %d",rdo1,token,fee_ix,fee_pp) ; | ||
d = fee_non_trgd(d) ; | ||
} | ||
|
||
|
||
if((d[0]&0xF0000000)!=0x40000000) { | ||
err |= 0x40000 ; // oopsy -- what now!? | ||
if(online || mode) LOG(ERR,"%d: fee_scan %d: not end-of-FEE 0x%08X",rdo1,fee_ix,d[0]) ; | ||
if(online || mode) LOG(ERR,"%d: T %d: fee_scan %d: not end-of-FEE 0x%08X",rdo1,token,fee_ix,d[0]) ; | ||
} | ||
else { | ||
if(d[0]&0x00800000) { | ||
|
@@ -1064,7 +1072,7 @@ int itpc23::rdo_scan(char *c_addr, int iwords) | |
|
||
|
||
int trg_cou = 0 ; | ||
|
||
int loc_err_cou = 0 ; | ||
|
||
switch(evt_type) { | ||
case 1 : // timer | ||
|
@@ -1074,6 +1082,7 @@ int itpc23::rdo_scan(char *c_addr, int iwords) | |
goto done ; | ||
case 2 : // trigger! | ||
evt_trgd++ ; | ||
f_stat.evt_cou++ ; | ||
break ; | ||
default : | ||
LOG(ERR,"%d: %d: unknown event type %d: 0x%08X",rdo1,evt,evt_type,d[1]) ; | ||
|
@@ -1140,12 +1149,30 @@ int itpc23::rdo_scan(char *c_addr, int iwords) | |
|
||
// LOG(TERR,"%d: fee_mask 0x%08X",rdo1,fee_mask) ; | ||
|
||
|
||
if(err) { | ||
if(mode || online) { | ||
LOG(ERR,"%d: T %d: error 0x%X before fee_scan??",rdo1,token,err) ; | ||
} | ||
} | ||
|
||
|
||
|
||
for(int i=0;i<16;i++) { | ||
if(fee_mask & (1<<i)) ; | ||
else continue ; | ||
|
||
fee_ix = i ; | ||
d = fee_scan(d) ; | ||
if(err) { | ||
// LOG first FEE which failed | ||
if(loc_err_cou==0) { | ||
if(mode || online) { | ||
LOG(ERR,"%d: T %d: error at FEE #%d (0x%X)",rdo1,token,i+1,err) ; | ||
} | ||
} | ||
loc_err_cou++ ; | ||
} | ||
if(d>=trl) break ; | ||
} | ||
|
||
|
@@ -1371,6 +1398,8 @@ itpc23::itpc23() | |
|
||
fmt = 0 ; | ||
|
||
fee_words = 0 ; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This initialization is for me the critical part as an uninitialized |
||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jeff and I have noted to Tonko that this local
fee_words
should perhaps not be local, but we believe this is not worth holding up this commit as even without any change to this line, this commit is an important step forward.