]> jspc29.x-matter.uni-frankfurt.de Git - mvdsensorcontrol.git/commitdiff
init_system.pl activates/deactivates peripheral FPGAs based on <roc/> entries in...
authorMichael Wiebusch <m.wiebusch@gsi.de>
Mon, 4 May 2015 14:47:09 +0000 (16:47 +0200)
committerMichael Wiebusch <m.wiebusch@gsi.de>
Mon, 4 May 2015 14:47:09 +0000 (16:47 +0200)
tools/init_system.pl

index c3b5a194338303c970175bacb5e72264392c932d..6bc7e3ef5a1a84192f2870cff233f43916134348 100755 (executable)
@@ -81,43 +81,20 @@ run(DAQTOOLSPATH."/tools/loadregisterdb.pl ".CONFIGPATH."/network/register_confi
 
 trb_write(0xfffe,0x00c5,0x20ff);   #Timeouts
 
-if($system eq 'Vacuum') {
-  trb_write($ccu,0x00c0,0x00f1);
-  trb_write($ccu,0x00c1,0x00f1);
-  trb_write($ccu,0x00c3,0x00f1);
-#  trb_write($ccu,0x00c0,0x00e1);
-#  trb_write($ccu,0x00c1,0x00e1);
-#  trb_write($ccu,0x00c3,0x00ff);   # unused FPGAs: enable slowcontrol only
-  }
-if($system eq 'ProbeStation') {
-  trb_write($ccu,0x00c0,0x00f1);
-  trb_write($ccu,0x00c1,0x00f1);
-  trb_write($ccu,0x00c3,0x00f1);
-  }  
-  
-if($system eq 'ELnew') {
-  trb_write($ccu,0x00c0,0x00f1);
-  trb_write($ccu,0x00c1,0x00f1);
-  trb_write($ccu,0x00c3,0x00f1);
-  trb_write($ccu,0xa150,0x2cff); #pulser to frame rate
-  }
-if($system eq 'ELab') {
-
-#   trb_write($ccu,0x00c0,0x00ec);
-#   trb_write($ccu,0x00c1,0x00ec);
-#   trb_write($ccu,0x00c3,0x00fc); # only 0x00, 0x02, 0x03 active
+#Send arbiter start signal
+#trb_write($ccu,0xa000,0x00000001);
 
-#  trb_write($ccu,0x00c0,0x00f8);
-#  trb_write($ccu,0x00c1,0x00f8);
-#  trb_write($ccu,0x00c3,0x00f8); # only 0x03 active
 
-  trb_write($ccu,0x00c0,0x00f4);
-  trb_write($ccu,0x00c1,0x00f4);
-  trb_write($ccu,0x00c3,0x00f4); # only 0x02 active
-  }
 
-#Send arbiter start signal
-#trb_write($ccu,0xa000,0x00000001);
+# deactivate all peripheral FPGAs by default in the TrbNet hub
+# activate peripheral FPGAs only, when you find a <roc/> entry in system file
+my $hub_active_mask = 0;
+for my $addr (@roc){
+  $hub_active_mask |= 1<<($addr & 0xF); #last hex digit gives FPGA number
+}
+trb_write($ccu,0x00c0,0x00f0|$hub_active_mask);
+trb_write($ccu,0x00c1,0x00f0|$hub_active_mask);
+trb_write($ccu,0x00c3,0x00f0|$hub_active_mask);
 
 
 trb_write($_,0x8041,0x8d00) for @roc;