$feat .= "with multi-packet" if ($inclLow->{$addr} & 0x400000);
}
}
- $feat .= "\nHub: ".(($inclLow->{$addr}>>24)&0xf)." SFPs";
+ $feat .= "\nHub: ".(($inclLow->{$addr}>>24)&0xf)." SFPs" if (($inclLow->{$addr}>>24)&0xf);
}
if($table == 2) {
if($inclLow->{$addr}&0x8000) { # ||1 just because this not implemented yet in the test design..
if ($inclHigh->{$addr}>>12&0xF) {
$feat .= "\nInput monitor:";
my $d = trb_register_read($addr,0xdf8f) // trb_register_read($addr,0xdf8f);
- $feat .= " ".($d->{$addr}>>8&0x1F)." inputs";
- $feat .= ", single Fifo" if $d->{$addr}&0x8000;
- $feat .= ", indiv. Fifos" unless $d->{$addr}&0x8000;
+ if(($d->{$addr}>>8&0x1F)) {
+ $feat .= " ".($d->{$addr}>>8&0x1F)." inputs";
+ $feat .= ", single Fifo" if $d->{$addr}&0x8000;
+ $feat .= ", indiv. Fifos" unless $d->{$addr}&0x8000;
+ }
+ else {
+ $feat .= " none";
+ }
}
if(($inclHigh->{$addr}>>16&0xF) == 1 || ($inclHigh->{$addr}>>16&0xF) == 2) {
sub GetTDCInfo {
my ($addr,$info,$inp) = @_;
- my $d = trb_register_read($addr,0xc100);
my $feat = "";
- my $module = ($info>>16&0x3)+1;
- $feat .= " ".($d->{$addr}>>8&0xFF)." channels";
- $feat .= " read by ".$module." module(s)";
- $feat .= ", version ".(($d->{$addr}&0x0e000000)>>25).".".(($d->{$addr}&0x1e00000)>>21).".".(($d->{$addr}&0x1e0000)>>17);
- my $value;
- if($inp) {
- $value = $info&0xFF;
- if ($value==0) {$feat .=", input select by mux";}
- if ($value==1) {$feat .=", input 1-to-1";}
- if ($value==2) {$feat .=", on every second input";}
- if ($value==3) {$feat .=", on every fourth input";}
- if ($value==128) {$feat .=", input from 32pin";}
- if ($value==129) {$feat .=", input from 4conn";}
- if ($value==130) {$feat .=", input from onboard KEL";}
- if ($value==131) {$feat .=", input from ADA, w/ test signals";}
- if ($value==132) {$feat .=", input from ADA, every fourth pair";}
-
- $value = $info>>8&0xF;
- if ($value==0) {$feat .=", single edge";}
- if ($value==1) {$feat .=", dual edge in same channel";}
- if ($value==2) {$feat .=", dual edge in alternating channels";}
- if ($value==3) {$feat .=", dual edge same channel + stretcher";}
-
- $value = $info>>12&0x7;
- if ($value==0) {$feat .=", RingBuffer size: 12 words";}
- if ($value==1) {$feat .=", RingBuffer size: 44 words";}
- if ($value==2) {$feat .=", RingBuffer size: 76 words";}
- if ($value==3) {$feat .=", RingBuffer size: 108 words";}
- if ($value==7) {$feat .=", RingBuffer size: dynamic";}
- }
-
+
+ if(($info>>8&0xF) == 5) { #MDC TDC
+ my $d = trb_register_read($addr,0xc020);
+ $feat .= "clocked TDC";
+ $feat .= ", ".($d->{$addr}>>0&0xFF)." channels";
+ $feat .= ", ".($d->{$addr}>>8&0xFF)." buffer depth";
+ if($d->{$addr}>>16&0xFF == 1) {
+ $feat .= ", both edges in same word";
+ }
+
+ }
+ else {
+ my $module = ($info>>16&0x3)+1;
+ my $d = trb_register_read($addr,0xc100);
+ $feat .= " ".($d->{$addr}>>8&0xFF)." channels";
+ $feat .= " read by ".$module." module(s)";
+ $feat .= ", version ".(($d->{$addr}&0x0e000000)>>25).".".(($d->{$addr}&0x1e00000)>>21).".".(($d->{$addr}&0x1e0000)>>17);
+ my $value;
+ if($inp) {
+ $value = $info&0xFF;
+ if ($value==0) {$feat .=", input select by mux";}
+ if ($value==1) {$feat .=", input 1-to-1";}
+ if ($value==2) {$feat .=", on every second input";}
+ if ($value==3) {$feat .=", on every fourth input";}
+ if ($value==128) {$feat .=", input from 32pin";}
+ if ($value==129) {$feat .=", input from 4conn";}
+ if ($value==130) {$feat .=", input from onboard KEL";}
+ if ($value==131) {$feat .=", input from ADA, w/ test signals";}
+ if ($value==132) {$feat .=", input from ADA, every fourth pair";}
+
+ $value = $info>>8&0xF;
+ if ($value==0) {$feat .=", single edge";}
+ if ($value==1) {$feat .=", dual edge in same channel";}
+ if ($value==2) {$feat .=", dual edge in alternating channels";}
+ if ($value==3) {$feat .=", dual edge same channel + stretcher";}
+
+ $value = $info>>12&0x7;
+ if ($value==0) {$feat .=", RingBuffer size: 12 words";}
+ if ($value==1) {$feat .=", RingBuffer size: 44 words";}
+ if ($value==2) {$feat .=", RingBuffer size: 76 words";}
+ if ($value==3) {$feat .=", RingBuffer size: 108 words";}
+ if ($value==7) {$feat .=", RingBuffer size: dynamic";}
+ }
+ }
return $feat;
}