From 62ca54bb3ac3c7b96d675c4434cf20309eea9e63 Mon Sep 17 00:00:00 2001 From: Cahit Date: Tue, 3 Nov 2015 10:08:05 +0100 Subject: [PATCH] updated compile script for editing constraints file with ringbuffer recognition --- scripts/compile.pl | 46 ++++++++++++++++++++++++++++++++++ scripts/nodes_gsi_template.txt | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/scripts/compile.pl b/scripts/compile.pl index af92072..593ef41 100755 --- a/scripts/compile.pl +++ b/scripts/compile.pl @@ -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("; + $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) { } diff --git a/scripts/nodes_gsi_template.txt b/scripts/nodes_gsi_template.txt index b009b90..3291e36 100644 --- a/scripts/nodes_gsi_template.txt +++ b/scripts/nodes_gsi_template.txt @@ -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 -- 2.43.0