From 34aaa0d9f6d57897af6d0a2dde884b288fd4db94 Mon Sep 17 00:00:00 2001 From: Cahit Date: Thu, 28 Jan 2016 15:26:14 +0100 Subject: [PATCH] brought wasa project up-to-date with last TDC version and tidied up the project directory --- wasa/compile_constraints.pl | 21 -- wasa/compile_periph_gsi.pl | 330 ------------------------------- wasa/compile_wasa_gsi_synonly.pl | 154 --------------- wasa/config.vhd | 4 +- wasa/config_compile_gsi.pl | 2 +- wasa/tdc_release | 2 +- 6 files changed, 4 insertions(+), 509 deletions(-) delete mode 100755 wasa/compile_constraints.pl delete mode 100755 wasa/compile_periph_gsi.pl delete mode 100755 wasa/compile_wasa_gsi_synonly.pl diff --git a/wasa/compile_constraints.pl b/wasa/compile_constraints.pl deleted file mode 100755 index 769081c..0000000 --- a/wasa/compile_constraints.pl +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - -my $TOPNAME = "trb3_periph_padiwa"; #Name of top-level entity - -#create full lpf file -system("cp ../base/$TOPNAME.lpf diamond/trb3_periph.lpf"); -system("cat tdc_release/trbnet_constraints.lpf >> diamond/trb3_periph.lpf"); -system("cat tdc_release/tdc_constraints_64.lpf >> diamond/trb3_periph.lpf"); -system("cat tdc_release/unimportant_lines_constraints.lpf >> diamond/trb3_periph.lpf"); -system("cat unimportant_lines_constraints.lpf >> diamond/trb3_periph.lpf"); - - -#$TOPNAME = "panda_dirc_wasa"; #Name of top-level entity - -##create full lpf file -#system("cp ../base/".$TOPNAME."1.lpf workdir/$TOPNAME.lpf"); -#system("cat ".$TOPNAME."_constraints.lpf >> workdir/$TOPNAME.lpf"); - diff --git a/wasa/compile_periph_gsi.pl b/wasa/compile_periph_gsi.pl deleted file mode 100755 index 4c47373..0000000 --- a/wasa/compile_periph_gsi.pl +++ /dev/null @@ -1,330 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; -use FileHandle; -use Getopt::Long; -use Term::ANSIColor qw(:constants); - -################################################################################### -#Settings for this project -my $TOPNAME = "trb3_periph_padiwa"; #Name of top-level entity -my $lattice_path = '/opt/lattice/diamond/3.4_x64/'; -my $lattice_bin_path = "$lattice_path/bin/lin64"; # note the lin/lin64 at the end, no isfgpa needed -my $synplify_path = '/opt/synplicity/J-2014.09-SP2'; -my $lm_license_file_for_synplify = "27000\@lxcad01.gsi.de"; -my $lm_license_file_for_par = "1702\@hadeb05.gsi.de"; -my $synplify_locale_workaround = "en_US\@UTF-8"; -################################################################################### - -################################################################################### -#Options for the script -my $help = ""; -my $isMultiPar = 0; # set it to zero for single par run on the local machine -my $nrNodes = 0; # set it to one for single par run on the local machine -my $all = 1; -my $syn = 0; -my $map = 0; -my $par = 0; -my $timing = 0; -my $bitgen = 0; - -my $result = GetOptions ( - "h|help" => \$help, - "m|mpar=i" => \$nrNodes, - "a|all" => \$all, - "s|syn" => \$syn, - "mp|map" => \$map, - "p|par" => \$par, - "t|timing" => \$timing, - "b|bitgen" => \$bitgen, - ); - -if($help) { - print "Usage: compile_priph_gsi.de \n\n"; - print "-h --help\tPrints the usage manual.\n"; - print "-a --all\tRun all compile script. By default the script is going to run the whole process.\n"; - print "-s --syn\tRun synthesis part of the compile script.\n"; - print "-mp --map\tRun map part of the compile script.\n"; - print "-p --par\tRun par part of the compile script.\n"; - print "-t --timing\tRun timing analysis part of the compile script.\n"; - print "-b --bitgen\tRun bit generation part of the compile script.\n"; - print "-m --mpar\tSwitch for multi par. \"-m \" (Default = off)\n"; - print "\t\tThe node list file name has to be edited in the script. (Default = nodes_lxhadeb07.txt)\n"; - print "\n"; - exit; -} - -if ($nrNodes!=0){ - $isMultiPar=1; -} -if ($syn!=0 || $map!=0 || $par!=0 || $timing!=0 || $bitgen!=0){ - $all=0; -} -################################################################################### - - -# source the standard lattice environment -$ENV{bindir}="$lattice_bin_path"; -open my $SOURCE, "bash -c '. $lattice_bin_path/diamond_env >& /dev/null; env'|" or - die "Can't fork: $!"; -while (<$SOURCE>) { - if (/^(.*)=(.*)/) { - $ENV{$1} = ${2} ; - } -} -close $SOURCE; - - - -$ENV{'PAR_DESIGN_NAME'}=$TOPNAME; -$ENV{'SYNPLIFY'}=$synplify_path; -$ENV{'LC_ALL'}="en_US\@UTF-8"; -$ENV{'SYN_DISABLE_RAINBOW_DONGLE'}=1; -$ENV{'LM_LICENSE_FILE'}=$lm_license_file_for_synplify; - - -my $FAMILYNAME="LatticeECP3"; -my $DEVICENAME="LFE3-150EA"; -my $PACKAGE="FPBGA672"; -my $SPEEDGRADE="8"; - -my $WORKDIR = "workdir"; -unless(-d $WORKDIR) { - mkdir $WORKDIR or die "can't create workdir '$WORKDIR': $!"; -} - -system("ln -sfT $lattice_path $WORKDIR/lattice-diamond"); - -#create full lpf file -print GREEN, "Generating constraints file...\n\n", RESET; -system("cp ../base/$TOPNAME.lpf $WORKDIR/$TOPNAME.lpf"); -system("cat tdc_release/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat tdc_release/tdc_constraints_script.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat tdc_release/unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); - -#copy delay line to project folder -system("cp tdc_release/Adder_304.ngo $WORKDIR/"); - -#generate timestamp -my $t=time; -my $fh = new FileHandle(">version.vhd"); -die "could not open file" if (! defined $fh); -print $fh <close; - -system("env| grep LM_"); -my $r = ""; -my $c = ""; -my @a = (); -my $tpmap = $TOPNAME . "_map" ; - -chdir $WORKDIR; -if($syn==1 || $all==1){ - print GREEN, "Starting synthesis process...\n\n", RESET; - $c="$synplify_path/bin/synplify_premier_dp -batch ../$TOPNAME.prj"; - $r=execute($c, "do_not_exit" ); - - $fh = new FileHandle("<$TOPNAME".".srr"); - @a = <$fh>; - $fh -> close; - - foreach (@a) - { - if(/\@E:/) - { - print "\n"; - $c="cat $TOPNAME.srr | egrep --color \"\@E:\""; - system($c); - print RED, "ERROR in the log file $TOPNAME.srr Exiting...\n\n", RESET; - exit 129; - } - } -} - - - -$ENV{'LM_LICENSE_FILE'}=$lm_license_file_for_par; - -if($map==1 || $all==1){ - print GREEN, "Starting mapping process...\n\n", RESET; - - $c=qq| edif2ngd -path "../" -path "." -l $FAMILYNAME -d $DEVICENAME "$TOPNAME.edf" "$TOPNAME.ngo" |; - execute($c); - - $c=qq|edfupdate -t "$TOPNAME.tcy" -w "$TOPNAME.ngo" -m "$TOPNAME.ngo" "$TOPNAME.ngx"|; - execute($c); - - $c=qq|ngdbuild -a $FAMILYNAME -d $DEVICENAME -p "$lattice_path/ispfpga/ep5c00/data" -dt "$TOPNAME.ngo" "$TOPNAME.ngd"|; - execute($c); - - $c=qq|map -retime -split_node -a $FAMILYNAME -p $DEVICENAME -t $PACKAGE -s $SPEEDGRADE "$TOPNAME.ngd" -pr "$TOPNAME.prf" -o "$tpmap.ncd" -mp "$TOPNAME.mrp" "$TOPNAME.lpf"|; - execute($c); - - $c=qq|htmlrpt -mrp $TOPNAME.mrp $TOPNAME|; - execute($c); - - $fh = new FileHandle("<$TOPNAME"."_mrp.html"); - @a = <$fh>; - $fh -> close; - my $i=1; - my $print=0; - foreach (@a) - { - if(/WARNING/|$print) - { - if((grep /WARNING - map: There are semantic errors in the preference file/, $_) & ($i == 1)) - { - last; - } - elsif(grep /WARNING - map: There are semantic errors in the preference file/, $_) - { - print RED, "There are errors in the constraints file. Better have a look...\n\n", RESET; - sleep(5); # ERROR -> sleep is effective before the print - last; - } - elsif ($i == 1) - { - print RED,"\n\n", RESET; - print RED,"#################################################\n", RESET; - print RED,"CONSTRAINTS ERRORS\n", RESET; - print RED,"#################################################\n\n", RESET; - } - $print=1; - if(grep /WARNING.*UGROUP/, $_) - { - print RED, $_, RESET; - } - elsif(grep /FC|hitBuf|ff_en/, $_) - { - print YELLOW, $_, RESET; - } - else - { - print $_; - } - $i++; - } - } -} - -if($par==1 || $all==1){ - print GREEN, "Starting placement process...\n\n", RESET; - - system("rm $TOPNAME.ncd"); - if ($isMultiPar) - { - $c=qq|LC_ALL=en_US.UTF-8; par -m ../nodes_lxhadeb07.txt -n $nrNodes -w -i 15 -l 5 -y -s 8 -t 1 -c 1 -e 2 -exp parCDP=1:parCDR=1:parPlcInLimit=0:parPlcInNeighborSize=1:parPathBased=ON:parHold=1:parHoldLimit=10000:paruseNBR=1 $tpmap.ncd $TOPNAME.dir $TOPNAME.prf;|; - execute($c); - - # find and copy the .ncd file which has met the timing constraints - $fh = new FileHandle("<$TOPNAME".".par"); - my @a = <$fh>; - my $isSuccess = 0; - $fh -> close; - my $i=1; - foreach (@a) - { - my @line = split(/\s+/, $_); - - if(@line && ($line[2] =~ m/^[0-9]+$/) && ($line[4] =~ m/^[0-9]+$/)) - { - if(($line[2] == 0) && ($line[4] == 0)) - { - print GREEN, "Copying $line[0].ncd file to workdir\n", RESET; - my $c="cp $TOPNAME.dir/$line[0].ncd $TOPNAME.ncd"; - system($c); - print "\n\n"; - $isSuccess = 1; - last; - } - } - } - - if (!$isSuccess){ - print RED, "\n\n", RESET; - print RED, "#################################################\n", RESET; - print RED, "# !!!PAR not succesfull!!! #\n", RESET; - print RED, "#################################################\n\n", RESET; - exit 129; - } - } - else - { - $c=qq|par -w -i 15 -l 5 -y -s 8 -t 1 -c 1 -e 2 -exp parCDP=1:parCDR=1:parPlcInLimit=0:parPlcInNeighborSize=1:parPathBased=ON:parHold=1:parHoldLimit=10000:paruseNBR=1 $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - execute($c); - my $c="cp $TOPNAME.dir/5_1.ncd $TOPNAME.ncd"; - system($c); - } - my $c="cat $TOPNAME.par"; - system($c); - -} - - -if($timing==1 || $all==1){ - print GREEN, "Generating timing report...\n\n", RESET; - - # IOR IO Timing Report - $c=qq|iotiming -s "$TOPNAME.ncd" "$TOPNAME.prf"|; - execute($c); - - # TWR Timing Report - $c=qq|trce -c -v 65 -o "$TOPNAME.twr.setup" "$TOPNAME.ncd" "$TOPNAME.prf"|; - execute($c); - - $c=qq|trce -hld -c -v 65 -o "$TOPNAME.twr.hold" "$TOPNAME.ncd" "$TOPNAME.prf"|; - execute($c); - - my $c="cat $TOPNAME.par"; - system($c); -} - -if($bitgen==1 || $all==1){ - print GREEN, "Generating bit file...\n\n", RESET; - - $c=qq|ltxt2ptxt $TOPNAME.ncd|; - execute($c); - - $c=qq|bitgen -w -g CfgMode:Disable -g RamCfg:Reset -g ES:No $TOPNAME.ncd $TOPNAME.bit $TOPNAME.prf|; - execute($c); -} - -$c=qq|htmlrpt -mrp $TOPNAME.mrp -mtwr $TOPNAME.twr.hold -ptwr $TOPNAME.twr.setup $TOPNAME|; -execute($c); - -$c=qq|firefox $TOPNAME.html|; -execute($c); - -chdir ".."; -exit; - -sub execute { - my ($c, $op) = @_; - #print "option: $op \n"; - $op = "" if(!$op); - print GREEN, "\n\ncommand to execute: $c \n", RESET; - $r=system($c); - if($r) { - print "$!"; - if($op ne "do_not_exit") { - exit; - } - } - return $r; -} diff --git a/wasa/compile_wasa_gsi_synonly.pl b/wasa/compile_wasa_gsi_synonly.pl deleted file mode 100755 index d25e82a..0000000 --- a/wasa/compile_wasa_gsi_synonly.pl +++ /dev/null @@ -1,154 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - - - - -################################################################################### -#Settings for this project -my $TOPNAME = "cbmrich"; #Name of top-level entity -my $lattice_path = '/opt/lattice/diamond/1.4.2.105'; -my $synplify_path = '/opt/synplicity/F-2012.03-SP1'; -my $lm_license_file_for_synplify = "27000\@lxcad01.gsi.de"; -my $lm_license_file_for_par = "1710\@cronos.e12.physik.tu-muenchen.de"; -################################################################################### - - - - - - - - -use FileHandle; - -$ENV{'SYNPLIFY'}=$synplify_path; -$ENV{'SYN_DISABLE_RAINBOW_DONGLE'}=1; -$ENV{'LM_LICENSE_FILE'}=$lm_license_file_for_synplify; - - - - -my $FAMILYNAME="LatticeECP3"; -my $DEVICENAME="LFE3-150EA"; -my $PACKAGE="FPBGA672"; -my $SPEEDGRADE="8"; - - -#create full lpf file -system("cp ../base/$TOPNAME.lpf workdir/$TOPNAME.lpf"); -system("cat ".$TOPNAME."_constraints.lpf >> workdir/$TOPNAME.lpf"); - - -#set -e -#set -o errexit - -#generate timestamp -my $t=time; -my $fh = new FileHandle(">version.vhd"); -die "could not open file" if (! defined $fh); -print $fh <close; - -system("env| grep LM_"); -my $r = ""; - -my $c="$synplify_path/bin/synplify_premier_dp -batch $TOPNAME.prj"; -$r=execute($c, "do_not_exit" ); - - -chdir "workdir"; -$fh = new FileHandle("<$TOPNAME".".srr"); -my @a = <$fh>; -$fh -> close; - - - -foreach (@a) -{ - if(/\@E:/) - { - print "\n"; - $c="cat $TOPNAME.srr | grep \"\@E\""; - system($c); - print "\n\n"; - exit 129; - } -} - - -#$ENV{'LM_LICENSE_FILE'}=$lm_license_file_for_par; - -#$c=qq| $lattice_path/ispfpga/bin/lin/edif2ngd -l $FAMILYNAME -d $DEVICENAME "$TOPNAME.edf" "$TOPNAME.ngo" |; -#execute($c); - -#$c=qq|$lattice_path/ispfpga/bin/lin/edfupdate -t "$TOPNAME.tcy" -w "$TOPNAME.ngo" -m "$TOPNAME.ngo" "$TOPNAME.ngx"|; -#execute($c); - -#$c=qq|$lattice_path/ispfpga/bin/lin/ngdbuild -a $FAMILYNAME -d $DEVICENAME -p "$lattice_path/ispfpga/ep5c00/data" -dt "$TOPNAME.ngo" "$TOPNAME.ngd"|; -#execute($c); - -#my $tpmap = $TOPNAME . "_map" ; - -#$c=qq|$lattice_path/ispfpga/bin/lin/map -retime -split_node -a $FAMILYNAME -p $DEVICENAME -t $PACKAGE -s $SPEEDGRADE "$TOPNAME.ngd" -o "$tpmap.ncd" -mp "$TOPNAME.mrp" "$TOPNAME.lpf"|; -#execute($c); - - -#system("rm $TOPNAME.ncd"); - -#$c=qq|$lattice_path/ispfpga/bin/lin/multipar -pr "$TOPNAME.prf" -o "mpar_$TOPNAME.rpt" -log "mpar_$TOPNAME.log" -p "../$TOPNAME.p2t" "$tpmap.ncd" "$TOPNAME.ncd"|; -#execute($c); - -## IOR IO Timing Report -#$c=qq|$lattice_path/ispfpga/bin/lin/iotiming -s "$TOPNAME.ncd" "$TOPNAME.prf"|; -#execute($c); - -## TWR Timing Report -#$c=qq|$lattice_path/ispfpga/bin/lin/trce -c -v 15 -o "$TOPNAME.twr.setup" "$TOPNAME.ncd" "$TOPNAME.prf"|; -#execute($c); - -#$c=qq|$lattice_path/ispfpga/bin/lin/trce -hld -c -v 5 -o "$TOPNAME.twr.hold" "$TOPNAME.ncd" "$TOPNAME.prf"|; -#execute($c); - -#$c=qq|$lattice_path/ispfpga/bin/lin/ltxt2ptxt $TOPNAME.ncd|; -#execute($c); - -#$c=qq|$lattice_path/ispfpga/bin/lin/bitgen -w "$TOPNAME.ncd" "$TOPNAME.prf"|; -#execute($c); - -chdir ".."; - -exit; - -sub execute { - my ($c, $op) = @_; - #print "option: $op \n"; - $op = "" if(!$op); - print "\n\ncommand to execute: $c \n"; - $r=system($c); - if($r) { - print "$!"; - if($op ne "do_not_exit") { - exit; - } - } - - return $r; - -} diff --git a/wasa/config.vhd b/wasa/config.vhd index 6ee4c21..908b327 100644 --- a/wasa/config.vhd +++ b/wasa/config.vhd @@ -12,14 +12,14 @@ package config is --TDC settings constant NUM_TDC_MODULES : integer range 1 to 4 := 1; -- number of tdc modules to implement - constant NUM_TDC_CHANNELS : integer range 1 to 65 := 5; -- number of tdc channels per module + constant NUM_TDC_CHANNELS : integer range 1 to 65 := 65; -- number of tdc channels per module constant NUM_TDC_CHANNELS_POWER2 : integer range 0 to 6 := 6; --the nearest power of two, for convenience reasons constant DOUBLE_EDGE_TYPE : integer range 0 to 3 := 3; --double edge type: 0, 1, 2, 3 -- 0: single edge only, -- 1: same channel, -- 2: alternating channels, -- 3: same channel with stretcher - constant RING_BUFFER_SIZE : integer range 0 to 7 := 7; --change names in constraints file + constant RING_BUFFER_SIZE : integer range 0 to 7 := 0; --change names in constraints file --ring buffer size: -- 0->32 -- 1->64 diff --git a/wasa/config_compile_gsi.pl b/wasa/config_compile_gsi.pl index 3d19e20..f803d03 100644 --- a/wasa/config_compile_gsi.pl +++ b/wasa/config_compile_gsi.pl @@ -6,7 +6,7 @@ synplify_path => '/opt/synplicity/J-2015.03-SP1', #synplify_command => "/opt/lattice/diamond/3.5_x64/bin/lin64/synpwrap -fg -options", synplify_command => "/opt/synplicity/J-2015.03-SP1/bin/synplify_premier_dp", -nodelist_file => 'nodes_gsi.txt', +nodelist_file => '../nodes_lxhadeb07.txt', include_TDC => 1, include_GBE => 0, diff --git a/wasa/tdc_release b/wasa/tdc_release index df11eae..6a654d0 120000 --- a/wasa/tdc_release +++ b/wasa/tdc_release @@ -1 +1 @@ -../../tdc/releases/tdc_v2.2 \ No newline at end of file +../../tdc/releases/tdc_v2.3 \ No newline at end of file -- 2.43.0