]> jspc29.x-matter.uni-frankfurt.de Git - trb3sc.git/commitdiff
updated compile script for editing constraints file with ringbuffer recognition
authorCahit <c.ugur@gsi.de>
Tue, 3 Nov 2015 09:08:05 +0000 (10:08 +0100)
committerCahit <c.ugur@gsi.de>
Tue, 3 Nov 2015 09:08:05 +0000 (10:08 +0100)
scripts/compile.pl
scripts/nodes_gsi_template.txt

index af920720eec713b4e23be35e4eb3992f7eabea1f..593ef414f94067e8b48b43e5d30047b7a1af0ba0 100755 (executable)
@@ -125,7 +125,53 @@ if($con==1 || $all==1){
     system("cat ../../trb3sc/tdc_release/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf");
     system("cat ../../trb3sc/tdc_release/tdc_constraints_64.lpf >> $WORKDIR/$TOPNAME.lpf");
     system("cat ../../trb3sc/tdc_release/unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf");
+
+    #change the Ring buffer name in the constraints file according to the config.vhd
+    my $fh = new FileHandle("<config.vhd");
+    my @a = <$fh>;
+    $fh -> close;
+    my $ringbuffersize = 5;
+    
+    foreach (@a)
+    {
+       if(/constant\s*RING_BUFFER_SIZE/)
+       {
+           my $tmp = $1 if $_ =~ /(:=.*;)/;
+           $ringbuffersize = $1 if $1 =~ /(\d+)/;
+       }
     }
+
+    my @newline;
+    $fh = new FileHandle("<$WORKDIR/$TOPNAME".".lpf");
+    @a = <$fh>;
+    $fh -> close;
+    
+    foreach (@a)
+    {
+       if ($ringbuffersize == 0) {
+           $_ =~ s/Buffer_128.The_Buffer/Buffer_32.The_Buffer/g;
+       }
+       elsif ($ringbuffersize == 1 || $ringbuffersize == 5) {
+           $_ =~ s/Buffer_128.The_Buffer/Buffer_64.The_Buffer/g;
+       }
+       elsif ($ringbuffersize == 2) {
+           $_ =~ s/Buffer_128.The_Buffer/Buffer_96.The_Buffer/g;
+       }
+       elsif ($ringbuffersize == 3 || $ringbuffersize == 7) {
+           $_ =~ s/Buffer_128.The_Buffer/Buffer_128.The_Buffer/g;
+       }
+       else {
+           print "unknown ringbuffer size... \n";
+           exit 129;
+       }
+
+       push(@newline,$_);
+    }
+    $fh = new FileHandle(">$WORKDIR/$TOPNAME".".lpf");
+    print $fh @newline;
+    $fh -> close;
+  }
+
   if($include_GBE) {
 
     }
index b009b90ee9ccbfa74085cfc68d0ebaecc7e57c58..3291e3644290c2c6223f72d4614feab212817eb2 100644 (file)
@@ -4,4 +4,4 @@
 SYSTEM = linux
 CORENUM = 32
 ENV = /u/cugur/depc363/bin/diamond_setup_x64.sh
-WORKDIR = /u/cugur/depc363/Projects/TDC_on_TRB3/trb3sc/template/workdir
+WORKDIR = /u/cugur/depc363/Projects/TDC_on_TRB3/trb3sc/tdctemplate/workdir