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) {
}