From fe6317e5da2a23b10a799e9bbd051469ea8a1996 Mon Sep 17 00:00:00 2001 From: Cahit Date: Thu, 4 Feb 2016 15:38:01 +0100 Subject: [PATCH] updated compile script for automated parallel compiling. Edit the compile list in the scripts/compile_parallel.pl and run the script. Dependencies: urxvt, tabbedex (https://github.com/michaeltraxler/urxvt-perls/blob/master/tabbedex) --- 32PinAddOn/compile_constraints.pl | 20 - 32PinAddOn/compile_constraints_frankfurt.pl | 15 - 32PinAddOn/compile_periph_frankfurt.pl | 156 ----- 32PinAddOn/compile_periph_gsi.pl | 298 ---------- 32PinAddOn/config_compile_gsi.pl | 12 +- 32PinAddOn/trb3_periph_32PinAddOn.p2t | 69 +++ 32PinAddOn/trb3_periph_32PinAddOn.prj | 2 +- ADA_Addon/compile.pl | 1 + ADA_Addon/compile_constraints.pl | 15 - ADA_Addon/compile_periph_frankfurt.pl | 155 ----- ADA_Addon/compile_periph_gsi.pl | 298 ---------- ADA_Addon/config_compile.pl | 1 + ADA_Addon/config_compile_frankfurt.pl | 22 + ADA_Addon/config_compile_gsi.pl | 19 + ADA_Addon/trb3_periph_ADA.p2t | 78 ++- ADA_Addon/trb3_periph_ADA.prj | 28 +- base/trb3_periph.p2t | 78 ++- base/trb3_periph_hadesstart.lpf | 421 ++++++++++++++ cbmtof/cbmtof.prj | 17 +- cbmtof/compile_cbmtof_frankfurt.pl | 297 ---------- cbmtof/compile_cbmtof_gsi.pl | 298 ---------- cbmtof/compile_constraints.pl | 15 - cbmtof/config_compile_gsi.pl | 14 +- gpin/config_compile_gsi.pl | 14 +- gpin/trb3_periph_gpin.prj | 23 +- hadesstart/compile.pl | 1 + hadesstart/compile_constraints.pl | 13 - hadesstart/compile_periph_frankfurt.pl | 159 ----- hadesstart/compile_periph_gsi.pl | 298 ---------- hadesstart/config_compile.pl | 1 + hadesstart/config_compile_frankfurt.pl | 22 + hadesstart/config_compile_gsi.pl | 19 + hub/trb3_periph_hub.prj | 2 +- scripts/compile.pl | 609 ++++++++++---------- scripts/compile_parallel.pl | 22 + scripts/config_compile.pl | 1 + scripts/config_compile_frankfurt.pl | 22 + scripts/config_compile_gsi.pl | 19 + wasa/compile_constraints_frankfurt.pl | 19 - wasa/compile_padiwa_frankfurt.pl | 159 ----- wasa/trb3_periph_padiwa.prj | 2 +- 41 files changed, 1160 insertions(+), 2574 deletions(-) delete mode 100755 32PinAddOn/compile_constraints.pl delete mode 100755 32PinAddOn/compile_constraints_frankfurt.pl delete mode 100755 32PinAddOn/compile_periph_frankfurt.pl delete mode 100755 32PinAddOn/compile_periph_gsi.pl create mode 100644 32PinAddOn/trb3_periph_32PinAddOn.p2t create mode 120000 ADA_Addon/compile.pl delete mode 100755 ADA_Addon/compile_constraints.pl delete mode 100755 ADA_Addon/compile_periph_frankfurt.pl delete mode 100755 ADA_Addon/compile_periph_gsi.pl create mode 120000 ADA_Addon/config_compile.pl create mode 100644 ADA_Addon/config_compile_frankfurt.pl create mode 100644 ADA_Addon/config_compile_gsi.pl create mode 100644 base/trb3_periph_hadesstart.lpf delete mode 100755 cbmtof/compile_cbmtof_frankfurt.pl delete mode 100755 cbmtof/compile_cbmtof_gsi.pl delete mode 100755 cbmtof/compile_constraints.pl create mode 120000 hadesstart/compile.pl delete mode 100755 hadesstart/compile_constraints.pl delete mode 100755 hadesstart/compile_periph_frankfurt.pl delete mode 100755 hadesstart/compile_periph_gsi.pl create mode 120000 hadesstart/config_compile.pl create mode 100644 hadesstart/config_compile_frankfurt.pl create mode 100644 hadesstart/config_compile_gsi.pl create mode 100755 scripts/compile_parallel.pl create mode 120000 scripts/config_compile.pl create mode 100644 scripts/config_compile_frankfurt.pl create mode 100644 scripts/config_compile_gsi.pl delete mode 100755 wasa/compile_constraints_frankfurt.pl delete mode 100755 wasa/compile_padiwa_frankfurt.pl diff --git a/32PinAddOn/compile_constraints.pl b/32PinAddOn/compile_constraints.pl deleted file mode 100755 index c5c47dd..0000000 --- a/32PinAddOn/compile_constraints.pl +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - -my $TOPNAME = "trb3_periph_32PinAddOn"; #Name of top-level entity - -#create full lpf file -#system("cp ../base/$TOPNAME.lpf diamond/$TOPNAME.lpf"); -#system("cat tdc_release/trbnet_constraints.lpf >> diamond/$TOPNAME.lpf"); -#system("cat tdc_release/tdc_constraints_64.lpf >> diamond/$TOPNAME.lpf"); -#system("cat tdc_release/unimportant_lines_constraints.lpf >> diamond/$TOPNAME.lpf"); -#system("cat unimportant_lines_constraints.lpf >> diamond/$TOPNAME.lpf"); - -system("cp ../base/$TOPNAME.lpf workdir/diamond/$TOPNAME.lpf"); -system("cat tdc_release/trbnet_constraints.lpf >> workdir/diamond/$TOPNAME.lpf"); -system("cat tdc_release/tdc_constraints_64.lpf >> workdir/diamond/$TOPNAME.lpf"); -system("cat tdc_release/unimportant_lines_constraints.lpf >> workdir/diamond/$TOPNAME.lpf"); -system("cat unimportant_lines_constraints.lpf >> workdir/diamond/$TOPNAME.lpf"); - diff --git a/32PinAddOn/compile_constraints_frankfurt.pl b/32PinAddOn/compile_constraints_frankfurt.pl deleted file mode 100755 index de79f05..0000000 --- a/32PinAddOn/compile_constraints_frankfurt.pl +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - -my $TOPNAME = "trb3_periph_32PinAddOn"; #Name of top-level entity - - -#create full lpf file - -system("cp ../base/$TOPNAME.lpf workdir/diamond/$TOPNAME.lpf"); -system("cat tdc_release/trbnet_constraints.lpf >> workdir/diamond/$TOPNAME.lpf"); -system("cat tdc_release/tdc_constraints_64.lpf >> workdir/diamond/$TOPNAME.lpf"); -system("cat tdc_release/unimportant_lines_constraints.lpf >> workdir/diamond/$TOPNAME.lpf"); -system("cat unimportant_lines_constraints.lpf >> workdir/diamond/$TOPNAME.lpf"); diff --git a/32PinAddOn/compile_periph_frankfurt.pl b/32PinAddOn/compile_periph_frankfurt.pl deleted file mode 100755 index 1929e70..0000000 --- a/32PinAddOn/compile_periph_frankfurt.pl +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - - - - -################################################################################### -#Settings for this project -my $TOPNAME = "trb3_periph_32PinAddOn"; #Name of top-level entity -my $lattice_path = '/d/jspc29/lattice/diamond/3.6_x64'; -my $synplify_path = '/d/jspc29/lattice/synplify/J-2014.09-SP1/'; -my $lm_license_file_for_synplify = "27000\@lxcad01.gsi.de"; -my $lm_license_file_for_par = "1702\@hadeb05.gsi.de"; -################################################################################### - - -$ENV{'PAR_DESIGN_NAME'}=$TOPNAME; - - -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"; -my $WORKDIR = "workdir"; - -#create full lpf file -system("cp ../base/$TOPNAME.lpf $WORKDIR/$TOPNAME.lpf"); -system("cat tdc_release/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat tdc_release/tdc_constraints_64.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat tdc_release/unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat unimportant_lines_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"; -my $c="/d/jspc29/lattice/diamond/3.6_x64/bin/lin64/synpwrap -fg -options -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/lin64/edif2ngd -path "../" -path "." -l $FAMILYNAME -d $DEVICENAME "$TOPNAME.edf" "$TOPNAME.ngo" |; -execute($c); - -$c=qq|$lattice_path/ispfpga/bin/lin64/edfupdate -t "$TOPNAME.tcy" -w "$TOPNAME.ngo" -m "$TOPNAME.ngo" "$TOPNAME.ngx"|; -execute($c); - -$c=qq|$lattice_path/ispfpga/bin/lin64/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/lin64/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); - -system("rm $TOPNAME.ncd"); - -#$c=qq|mpartrce -p "../$TOPNAME.p2t" -log "$TOPNAME.log" -o "$TOPNAME.rpt" -pr "$TOPNAME.prf" -tf "$TOPNAME.pt" "|.$TOPNAME.qq|_map.ncd" "$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"|; -$c=qq|$lattice_path/ispfpga/bin/lin64/par -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parUseNBR=1:parCDP=0:parCDR=0:parPathBased=OFF $tpmap.ncd $TOPNAME.ncd $TOPNAME.prf|; -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/lin64/trce -c -v 15 -o "$TOPNAME.twr.setup" "$TOPNAME.ncd" "$TOPNAME.prf"|; -execute($c); - -$c=qq|$lattice_path/ispfpga/bin/lin64/trce -hld -c -v 5 -o "$TOPNAME.twr.hold" "$TOPNAME.ncd" "$TOPNAME.prf"|; -execute($c); - -$c=qq|$lattice_path/ispfpga/bin/lin64/ltxt2ptxt $TOPNAME.ncd|; -execute($c); - -$c=qq|$lattice_path/ispfpga/bin/lin64/bitgen -w -g CfgMode:Disable -g RamCfg:Reset -g ES:No $TOPNAME.ncd $TOPNAME.bit $TOPNAME.prf|; -# $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/32PinAddOn/compile_periph_gsi.pl b/32PinAddOn/compile_periph_gsi.pl deleted file mode 100755 index 82fe6c4..0000000 --- a/32PinAddOn/compile_periph_gsi.pl +++ /dev/null @@ -1,298 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; -use FileHandle; -use Getopt::Long; - -################################################################################### -#Settings for this project -my $TOPNAME = "trb3_periph_32PinAddOn"; #Name of top-level entity -my $lattice_path = '/opt/lattice/diamond/3.0_x64/'; -my $lattice_bin_path = "$lattice_path/bin/lin64"; # note the lin/lin64 at the end, no isfgpa needed -my $synplify_path = '/opt/synplicity/I-2013.09-SP1'; -#my $lattice_path = '/opt/lattice/diamond/2.01/'; -#my $lattice_bin_path = "$lattice_path/bin/lin"; # note the lin/lin64 at the end, no isfgpa needed -#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 = "1702\@hadeb05.gsi.de"; -################################################################################### - -################################################################################### -#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 rung 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{'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 -system("cp ../base/$TOPNAME.lpf $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/tdc_constraints_64.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); - - -#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" ; - -if($syn==1 || $all==1){ - $c="$synplify_path/bin/synplify_premier_dp -batch $TOPNAME.prj"; - $r=execute($c, "do_not_exit" ); -} - -chdir $WORKDIR; - -if($syn==1 || $all==1){ - $fh = new FileHandle("<$TOPNAME".".srr"); - @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; - -if($map==1 || $all==1){ - $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; - foreach (@a) - { - if(/FC_|HitInvert|ff_en_/) - { - print "\n\n"; - print "#################################################\n"; - print "# !!!Possible Placement Errors!!! #\n"; - print "#################################################\n\n"; - - my $c="egrep 'WARNING.*hitBuf_|Channels/hit_buf_RNO|WARNING.*FC_|Channels/Channel200/SimAdderNo_FC|WARNING.*ff_en_|Channels/Channel200/ff_array_en_i_1_i'"." $TOPNAME"."_mrp.html"; - system($c); - last; - } - } -} - -if($par==1 || $all==1){ - system("rm $TOPNAME.ncd"); - #$c=qq|mpartrce -p "../$TOPNAME.p2t" -log "$TOPNAME.log" -o "$TOPNAME.rpt" -pr "$TOPNAME.prf" -tf "$TOPNAME.pt" "|.$TOPNAME.qq|_map.ncd" "$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"|; - if ($isMultiPar) - { - #$c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -stopzero -w -l 5 -t 1 -e 100 -exp parDisablePgroup=0:parUseNBR=1:parCDP=1:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - #$c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -stopzero -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parDisablePgroup=0:parUseNBR=1:parCDP=0:parCDR=0:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - $c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -w -l 5 -t 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; - foreach (@a) - { - my @line = split(' ', $_); - if(@line && ($line[2] =~ m/^[0-9]+$/) && ($line[3] =~ m/^[0-9]+$/)) - { - if(($line[2] == 0) && ($line[3] == 0)) - { - print "Copying $line[0].ncd file to workdir\n"; - my $c="cp $TOPNAME.dir/$line[0].ncd $TOPNAME.ncd"; - system($c); - print "\n\n"; - $isSuccess = 1; - last; - } - } - } - - if (!$isSuccess){ - print "\n\n"; - print "#################################################\n"; - print "# !!!PAR not succesfull!!! #\n"; - print "#################################################\n\n"; - exit 129; - } - } - else - { - #$c=qq|par -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parUseNBR=1:parCDP=0:parCDR=0:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - $c=qq|par -w -l 5 -t 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){ - # 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); - - $c=qq|ltxt2ptxt $TOPNAME.ncd|; - execute($c); - - my $c="cat $TOPNAME.par"; - system($c); - -} - -if($bitgen==1 || $all==1){ - $c=qq|bitgen -w -g CfgMode:Disable -g RamCfg:Reset -g ES:No $TOPNAME.ncd $TOPNAME.bit $TOPNAME.prf|; - # $c=qq|$lattice_path/ispfpga/bin/lin/bitgen -w "$TOPNAME.ncd" "$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 "\n\ncommand to execute: $c \n"; - $r=system($c); - if($r) { - print "$!"; - if($op ne "do_not_exit") { - exit; - } - } - return $r; -} diff --git a/32PinAddOn/config_compile_gsi.pl b/32PinAddOn/config_compile_gsi.pl index a8bacf4..c5e7654 100644 --- a/32PinAddOn/config_compile_gsi.pl +++ b/32PinAddOn/config_compile_gsi.pl @@ -1,13 +1,15 @@ TOPNAME => "trb3_periph_32PinAddOn", +project_path => "32PinAddOn", lm_license_file_for_synplify => "27000\@lxcad01.gsi.de", lm_license_file_for_par => "1702\@hadeb05.gsi.de", -lattice_path => '/opt/lattice/diamond/3.5_x64/', -synplify_path => '/opt/synplicity/J-2014.09-SP2', -#synplify_command => "/opt/lattice/diamond/3.4_x64/bin/lin64/synpwrap -fg -options", -synplify_command => "/opt/synplicity/J-2014.09-SP2/bin/synplify_premier_dp", +lattice_path => '/opt/lattice/diamond/3.6_x64', +synplify_path => '/opt/synplicity/K-2015.09', +#synplify_command => "/opt/lattice/diamond/3.6_x64/bin/lin64/synpwrap -fg -options", +synplify_command => "/opt/synplicity/K-2015.09/bin/synplify_premier_dp", nodelist_file => '../nodes_lxhadeb07.txt', - +par_options => '../../base/trb3_periph.p2t', + #Include only necessary lpf files include_TDC => 1, include_GBE => 0, diff --git a/32PinAddOn/trb3_periph_32PinAddOn.p2t b/32PinAddOn/trb3_periph_32PinAddOn.p2t new file mode 100644 index 0000000..a7b741d --- /dev/null +++ b/32PinAddOn/trb3_periph_32PinAddOn.p2t @@ -0,0 +1,69 @@ +-w +-y +-l 5 +#-m nodelist.txt # Controlled by the compile.pl script. +#-n 1 # Controlled by the compile.pl script. +-s 12 +-t 1 +-c 1 +-e 2 +-i 15 +-exp parCDP=1:parCDR=1:parPlcInLimit=0:parPlcInNeighborSize=1:parPathBased=ON:parHold=ON:parHoldLimit=10000:paruseNBR=1: + + +#General PAR Command Line Options +# -w With this option, any files generated will overwrite existing files +# (e.g., any .par, .pad files). +# -y Adds the Delay Summary Report in the .par file and creates the delay +# file (in .dly format) at the end of the par run. +# +#PAR Placement Command Line Options +# -l Specifies the effort level of the design from 1 (simplest designs) +# to 5 (most complex designs). +# -m Multi-tasking option. Controlled by the compile.pl script. +# -n Sets the number of iterations performed at the effort level +# specified by the -l option. Controlled by the compile.pl script. +# -s Save the number of best results for this run. +# -t Start placement at the specified cost table. Default is 1. +# +#PAR Routing Command Line Options +# -c Run number of cost-based cleanup passes of the router. +# -e Run number of delay-based cleanup passes of the router on +# completely-routed designs only. +# -i Run a maximum number of passes, stopping earlier only if the routing +# goes to 100 percent completion and all constraints are met. +# +#PAR Explorer Command Line Options +# parCDP Enable the congestion-driven placement (CDP) algorithm. CDP is +# compatible with all Lattice FPGA device families; however, most +# benefit has been demonstrated with benchmarks targeted to ECP5, +# LatticeECP2/M, LatticeECP3, and LatticeXP2 device families. +# parCDR Enable the congestion-driven router (CDR) algorithm. +# Congestion-driven options like parCDR and parCDP can improve +# performance given a design with multiple congestion “hotspots.” The +# Layer > Congestion option of the Design Planner Floorplan View can +# help visualize routing congestion. Large congested areas may prevent +# the options from finding a successful solution. +# CDR is compatible with all Lattice FPGA device families however most +# benefit has been demonstrated with benchmarks targeted to ECP5, +# LatticeECP2/M,LatticeECP3, and LatticeXP2 device families. +# paruseNBR NBR Router or Negotiation-based routing option. Supports all +# FPGA device families except LatticeXP and MachXO. +# When turned on, an alternate routing engine from the traditional +# Rip-up-based routing selection (RBR) is used. This involves an +# iterative routing algorithm that routes connections to achieve +# minimum delay cost. It does so by computing the demand on each +# routing resource and applying cost values per node. It will +# complete when an optimal solution is arrived at or the number of +# iterations is reached. +# parPathBased Path-based placement option. Path-based timing driven +# placement will yield better performance and more +# predictable results in many cases. +# parHold Additional hold time correction option. This option +# forces the router to automatically insert extra wires to compensate for the +# hold time violation. +# parHoldLimit This option allows you to set a limit on the number of +# hold time violations to be processed by the auto hold time correction option +# parHold. +# parPlcInLimit Cannot find in the online help +# parPlcInNeighborSize Cannot find in the online help diff --git a/32PinAddOn/trb3_periph_32PinAddOn.prj b/32PinAddOn/trb3_periph_32PinAddOn.prj index 5154322..aac04c1 100644 --- a/32PinAddOn/trb3_periph_32PinAddOn.prj +++ b/32PinAddOn/trb3_periph_32PinAddOn.prj @@ -52,7 +52,7 @@ impl -active "workdir" #add_file options -add_file -vhdl -lib work "version.vhd" +add_file -vhdl -lib work "workdir/version.vhd" add_file -vhdl -lib work "config.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_std.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_components.vhd" diff --git a/ADA_Addon/compile.pl b/ADA_Addon/compile.pl new file mode 120000 index 0000000..4456748 --- /dev/null +++ b/ADA_Addon/compile.pl @@ -0,0 +1 @@ +../scripts/compile.pl \ No newline at end of file diff --git a/ADA_Addon/compile_constraints.pl b/ADA_Addon/compile_constraints.pl deleted file mode 100755 index 1720215..0000000 --- a/ADA_Addon/compile_constraints.pl +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - -my $TOPNAME = "trb3_periph_ADA"; #Name of top-level entity - - -#create full lpf file -system("cp ../base/trb3_periph_ADA.lpf workdir/diamond/$TOPNAME.lpf"); -system("cat tdc_release/trbnet_constraints.lpf >> workdir/diamond/$TOPNAME.lpf"); -system("cat tdc_release/tdc_constraints_64.lpf >> workdir/diamond/$TOPNAME.lpf"); -system("cat tdc_release/unimportant_lines_constraints.lpf >> workdir/diamond/$TOPNAME.lpf"); -system("cat unimportant_lines_constraints.lpf >> workdir/diamond/$TOPNAME.lpf"); - diff --git a/ADA_Addon/compile_periph_frankfurt.pl b/ADA_Addon/compile_periph_frankfurt.pl deleted file mode 100755 index aa15bf6..0000000 --- a/ADA_Addon/compile_periph_frankfurt.pl +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - - - - -################################################################################### -#Settings for this project -my $TOPNAME = "trb3_periph_ADA"; #Name of top-level entity -my $BasePath = "../base/"; #path to "base" directory -my $lattice_path = '/d/jspc29/lattice/diamond/1.4.2.105'; -my $synplify_path = '/d/jspc29/lattice/synplify/F-2012.03-SP1/'; -my $lm_license_file_for_synplify = "27000\@localhost"; -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 currentRelease/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/tdc_constraints_64.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" ; -system("mv $TOPNAME.ncd guidefile.ncd"); - -#-g guidefile.ncd -$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); - - -$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/ADA_Addon/compile_periph_gsi.pl b/ADA_Addon/compile_periph_gsi.pl deleted file mode 100755 index fa37e33..0000000 --- a/ADA_Addon/compile_periph_gsi.pl +++ /dev/null @@ -1,298 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; -use FileHandle; -use Getopt::Long; - -################################################################################### -#Settings for this project -my $TOPNAME = "trb3_periph_ADA"; #Name of top-level entity -my $lattice_path = '/opt/lattice/diamond/3.0_x64/'; -my $lattice_bin_path = "$lattice_path/bin/lin64"; # note the lin/lin64 at the end, no isfgpa needed -my $synplify_path = '/opt/synplicity/I-2013.09-SP1'; -#my $lattice_path = '/opt/lattice/diamond/2.01/'; -#my $lattice_bin_path = "$lattice_path/bin/lin"; # note the lin/lin64 at the end, no isfgpa needed -#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 = "1702\@hadeb05.gsi.de"; -################################################################################### - -################################################################################### -#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 rung 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{'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 -system("cp ../base/$TOPNAME.lpf $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/tdc_constraints_64.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); - - -#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" ; - -if($syn==1 || $all==1){ - $c="$synplify_path/bin/synplify_premier_dp -batch $TOPNAME.prj"; - $r=execute($c, "do_not_exit" ); -} - -chdir $WORKDIR; - -if($syn==1 || $all==1){ - $fh = new FileHandle("<$TOPNAME".".srr"); - @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; - -if($map==1 || $all==1){ - $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; - foreach (@a) - { - if(/FC_|HitInvert|ff_en_/) - { - print "\n\n"; - print "#################################################\n"; - print "# !!!Possible Placement Errors!!! #\n"; - print "#################################################\n\n"; - - my $c="egrep 'WARNING.*hitBuf_|Channels/hit_buf_RNO|WARNING.*FC_|Channels/Channel200/SimAdderNo_FC|WARNING.*ff_en_|Channels/Channel200/ff_array_en_i_1_i'"." $TOPNAME"."_mrp.html"; - system($c); - last; - } - } -} - -if($par==1 || $all==1){ - system("rm $TOPNAME.ncd"); - #$c=qq|mpartrce -p "../$TOPNAME.p2t" -log "$TOPNAME.log" -o "$TOPNAME.rpt" -pr "$TOPNAME.prf" -tf "$TOPNAME.pt" "|.$TOPNAME.qq|_map.ncd" "$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"|; - if ($isMultiPar) - { - #$c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -stopzero -w -l 5 -t 1 -e 100 -exp parDisablePgroup=0:parUseNBR=1:parCDP=1:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - #$c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -stopzero -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parDisablePgroup=0:parUseNBR=1:parCDP=0:parCDR=0:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - $c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -w -l 5 -t 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; - foreach (@a) - { - my @line = split(' ', $_); - if(@line && ($line[2] =~ m/^[0-9]+$/) && ($line[3] =~ m/^[0-9]+$/)) - { - if(($line[2] == 0) && ($line[3] == 0)) - { - print "Copying $line[0].ncd file to workdir\n"; - my $c="cp $TOPNAME.dir/$line[0].ncd $TOPNAME.ncd"; - system($c); - print "\n\n"; - $isSuccess = 1; - last; - } - } - } - - if (!$isSuccess){ - print "\n\n"; - print "#################################################\n"; - print "# !!!PAR not succesfull!!! #\n"; - print "#################################################\n\n"; - exit 129; - } - } - else - { - #$c=qq|par -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parUseNBR=1:parCDP=0:parCDR=0:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - $c=qq|par -w -l 5 -t 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){ - # IOR IO Timing Report - $c=qq|iotiming -s "$TOPNAME.ncd" "$TOPNAME.prf"|; - execute($c); - - # TWR Timing Report - $c=qq|trce -c -v 15 -o "$TOPNAME.twr.setup" "$TOPNAME.ncd" "$TOPNAME.prf"|; - execute($c); - - $c=qq|trce -hld -c -v 5 -o "$TOPNAME.twr.hold" "$TOPNAME.ncd" "$TOPNAME.prf"|; - execute($c); - - $c=qq|ltxt2ptxt $TOPNAME.ncd|; - execute($c); - - my $c="cat $TOPNAME.par"; - system($c); - -} - -if($bitgen==1 || $all==1){ - $c=qq|bitgen -w -g CfgMode:Disable -g RamCfg:Reset -g ES:No $TOPNAME.ncd $TOPNAME.bit $TOPNAME.prf|; - # $c=qq|$lattice_path/ispfpga/bin/lin/bitgen -w "$TOPNAME.ncd" "$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 "\n\ncommand to execute: $c \n"; - $r=system($c); - if($r) { - print "$!"; - if($op ne "do_not_exit") { - exit; - } - } - return $r; -} diff --git a/ADA_Addon/config_compile.pl b/ADA_Addon/config_compile.pl new file mode 120000 index 0000000..67b86a0 --- /dev/null +++ b/ADA_Addon/config_compile.pl @@ -0,0 +1 @@ +config_compile_gsi.pl \ No newline at end of file diff --git a/ADA_Addon/config_compile_frankfurt.pl b/ADA_Addon/config_compile_frankfurt.pl new file mode 100644 index 0000000..7b4c7f1 --- /dev/null +++ b/ADA_Addon/config_compile_frankfurt.pl @@ -0,0 +1,22 @@ +TOPNAME => "trb3_periph_ADA_Addon", +project_path => "ADA_Addon", +lm_license_file_for_synplify => "1702\@hadeb05.gsi.de", #"27000\@lxcad01.gsi.de"; +lm_license_file_for_par => "1702\@hadeb05.gsi.de", +lattice_path => '/d/jspc29/lattice/diamond/3.5_x64', +synplify_path => '/d/jspc29/lattice/synplify/J-2014.09-SP2/', +synplify_command => "/d/jspc29/lattice/diamond/3.5_x64/bin/lin64/synpwrap -fg -options", +#synplify_command => "/d/jspc29/lattice/synplify/J-2014.09-SP2/bin/synplify_premier_dp", + +nodelist_file => 'nodelist_frankfurt.txt', +par_options => '../../base/trb3_periph.p2t', + + +#Include only necessary lpf files +#pinout_file => '', #name of pin-out file, if not equal TOPNAME +include_TDC => 0, +include_GBE => 0, + +#Report settings +firefox_open => 0, +twr_number_of_errors => 20, + diff --git a/ADA_Addon/config_compile_gsi.pl b/ADA_Addon/config_compile_gsi.pl new file mode 100644 index 0000000..6c4a6a6 --- /dev/null +++ b/ADA_Addon/config_compile_gsi.pl @@ -0,0 +1,19 @@ +TOPNAME => "trb3_periph_ADA_Addon", +project_path => "ADA_Addon", +lm_license_file_for_synplify => "27000\@lxcad01.gsi.de", +lm_license_file_for_par => "1702\@hadeb05.gsi.de", +lattice_path => '/opt/lattice/diamond/3.6_x64', +synplify_path => '/opt/synplicity/K-2015.09', +#synplify_command => "/opt/lattice/diamond/3.6_x64/bin/lin64/synpwrap -fg -options", +synplify_command => "/opt/synplicity/K-2015.09/bin/synplify_premier_dp", + +nodelist_file => '../nodes_lxhadeb07.txt', +par_options => '../../base/trb3_periph.p2t', + +#Include only necessary lpf files +include_TDC => 1, +include_GBE => 0, + +#Report settings +firefox_open => 0, +twr_number_of_errors => 20, diff --git a/ADA_Addon/trb3_periph_ADA.p2t b/ADA_Addon/trb3_periph_ADA.p2t index c037b03..b63d48e 100644 --- a/ADA_Addon/trb3_periph_ADA.p2t +++ b/ADA_Addon/trb3_periph_ADA.p2t @@ -1,20 +1,70 @@ -w --i 15 --l 5 --n 1 -y +-l 5 +#-m nodelist.txt # Controlled by the compile.pl script. +#-n 1 # Controlled by the compile.pl script. -s 12 --t 12 +-t 1 -c 1 -e 2 --m nodelist.txt -# -w -# -i 6 -# -l 5 -# -n 1 -# -t 1 -# -s 1 -# -c 0 -# -e 0 -# +-i 15 -exp parCDP=1:parCDR=1:parPlcInLimit=0:parPlcInNeighborSize=1:parPathBased=ON:parHold=ON:parHoldLimit=10000:paruseNBR=1: + + +#General PAR Command Line Options +# -w With this option, any files generated will overwrite existing files +# (e.g., any .par, .pad files). +# -y Adds the Delay Summary Report in the .par file and creates the delay +# file (in .dly format) at the end of the par run. +# +#PAR Placement Command Line Options +# -l Specifies the effort level of the design from 1 (simplest designs) to 5 +# (most complex designs). +# -m Multi-tasking option. Controlled by the compile.pl script. +# -n Sets the number of iterations performed at the effort level specified by +# the -l option. Controlled by the compile.pl script. +# -s Save the number of best results for this run. +# -t Start placement at the specified cost table. Default is 1. +# +#PAR Routing Command Line Options +# -c Run number of cost-based cleanup passes of the router. +# -e Run number of delay-based cleanup passes of the router on +# completely-routed designs only. +# -i Run a maximum number of passes, stopping earlier only if the routing +# goes to 100 percent completion and all constraints are met. +# +#PAR Explorer Command Line Options +# parCDP Enable the congestion-driven placement (CDP) algorithm. CDP is +# compatible with all Lattice FPGA device families; however, most +# benefit has been demonstrated with benchmarks targeted to ECP5, +# LatticeECP2/M, LatticeECP3, and LatticeXP2 device families. +# parCDR Enable the congestion-driven router (CDR) algorithm. +# Congestion-driven options like parCDR and parCDP can improve +# performance given a design with multiple congestion “hotspots.” +# The Layer > Congestion option of the Design Planner Floorplan +# View can help visualize routing congestion. Large congested +# areas may prevent the options from finding a successful +# solution. CDR is compatible with all Lattice FPGA device +# families however most benefit has been demonstrated with +# benchmarks targeted to ECP5, LatticeECP2/M,LatticeECP3, and +# LatticeXP2 device families. +# paruseNBR NBR Router or Negotiation-based routing option. Supports all +# FPGA device families except LatticeXP and MachXO. When turned +# on, an alternate routing engine from the traditional +# Rip-up-based routing selection (RBR) is used. This involves an +# iterative routing algorithm that routes connections to achieve +# minimum delay cost. It does so by computing the demand on each +# routing resource and applying cost values per node. It will +# complete when an optimal solution is arrived at or the number +# of iterations is reached. +# parPathBased Path-based placement option. Path-based timing driven placement +# will yield better performance and more predictable results in +# many cases. +# parHold Additional hold time correction option. This option forces the +# router to automatically insert extra wires to compensate for +# the hold time violation. +# parHoldLimit This option allows you to set a limit on the number of hold time +# violations to be processed by the auto hold time correction +# option parHold. +# parPlcInLimit Cannot find in the online help +# parPlcInNeighborSize Cannot find in the online help diff --git a/ADA_Addon/trb3_periph_ADA.prj b/ADA_Addon/trb3_periph_ADA.prj index 2cec845..aaaa18b 100644 --- a/ADA_Addon/trb3_periph_ADA.prj +++ b/ADA_Addon/trb3_periph_ADA.prj @@ -50,12 +50,13 @@ impl -active "workdir" #project files -add_file -vhdl -lib work "version.vhd" -add_file -vhdl -lib work "tdc_release/tdc_version.vhd" +add_file -vhdl -lib work "workdir/version.vhd" add_file -vhdl -lib work "config.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_std.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_components.vhd" add_file -vhdl -lib work "../base/trb3_components.vhd" +add_file -vhdl -lib work "tdc_release/tdc_version.vhd" + add_file -vhdl -lib work "../../trbnet/trb_net16_term_buf.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_CRC.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_CRC8.vhd" @@ -68,6 +69,7 @@ add_file -vhdl -lib work "../../trbnet/trb_net_sbuf6.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_sbuf.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_regIO.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_regio_bus_handler.vhd" +add_file -vhdl -lib work "../../trbnet/trb_net16_regio_bus_handler_record.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_priority_encoder.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_dummy_fifo.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_dummy_fifo.vhd" @@ -84,6 +86,7 @@ add_file -vhdl -lib work "../../trbnet/trb_net16_trigger.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_ipudata.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_endpoint_hades_full.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_endpoint_hades_full_handler.vhd" + add_file -vhdl -lib work "../../trbnet/basics/ram_dp.vhd" add_file -vhdl -lib work "../../trbnet/basics/rom_16x8.vhd" add_file -vhdl -lib work "../../trbnet/basics/ram.vhd" @@ -94,6 +97,7 @@ add_file -vhdl -lib work "../../trbnet/basics/ram_16x16_dp.vhd" add_file -vhdl -lib work "../../trbnet/basics/signal_sync.vhd" add_file -vhdl -lib work "../../trbnet/basics/ram_dp_rw.vhd" add_file -vhdl -lib work "../../trbnet/basics/pulse_stretch.vhd" + add_file -vhdl -lib work "../../trbnet/special/handler_lvl1.vhd" add_file -vhdl -lib work "../../trbnet/special/handler_data.vhd" add_file -vhdl -lib work "../../trbnet/special/handler_ipu.vhd" @@ -106,6 +110,7 @@ add_file -vhdl -lib work "../../trbnet/special/spi_master.vhd" add_file -vhdl -lib work "../../trbnet/special/spi_databus_memory.vhd" add_file -vhdl -lib work "../../trbnet/special/spi_flash_and_fpga_reload.vhd" add_file -vhdl -lib work "../../trbnet/special/bus_register_handler.vhd" + add_file -vhdl -lib work "../../trbnet/lattice/ecp3/lattice_ecp3_fifo_18x1k.vhd" add_file -vhdl -lib work "../../trbnet/lattice/ecp3/trb_net16_fifo_arch.vhd" add_file -vhdl -lib work "../../trbnet/lattice/ecp3/lattice_ecp3_fifo_16bit_dualport.vhd" @@ -128,35 +133,43 @@ add_file -vhdl -lib work "../../trbnet/lattice/ecp3/lattice_ecp3_fifo_16x16_dual add_file -vhdl -lib work "../../trbnet/lattice/ecp3/lattice_ecp3_fifo_18x16_dualport.vhd" add_file -vhdl -lib work "../../trbnet/lattice/ecp2m/fifo/fifo_var_oreg.vhd" add_file -vhdl -lib work "../../trbnet/lattice/ecp3/spi_dpram_32_to_8.vhd" + add_file -vhdl -lib work "../../trbnet/optical_link/f_divider.vhd" add_file -vhdl -lib work "../../trbnet/media_interfaces/ecp3_sfp/sfp_1_200_int.vhd" add_file -vhdl -lib work "../../trbnet/media_interfaces/ecp3_sfp/sfp_1_125_int.vhd" add_file -vhdl -lib work "../../trbnet/media_interfaces/trb_net16_lsm_sfp.vhd" add_file -vhdl -lib work "../../trbnet/media_interfaces/trb_net16_med_ecp3_sfp.vhd" + add_file -vhdl -lib work "../base/cores/pll_in200_out100.vhd" add_file -vhdl -lib work "../base/code/input_to_trigger_logic.vhd" add_file -vhdl -lib work "../base/code/input_statistics.vhd" add_file -vhdl -lib work "../base/code/sedcheck.vhd" -add_file -vhdl -lib work "../../tdc/base/cores/ecp3/PLL/pll_in125_out100.vhd" + add_file -vhdl -lib work "tdc_release/tdc_components.vhd" add_file -vhdl -lib work "tdc_release/bit_sync.vhd" -add_file -vhdl -lib work "tdc_release/BusHandler.vhd" +#add_file -vhdl -lib work "tdc_release/BusHandler.vhd" +add_file -vhdl -lib work "tdc_release/BusHandler_record.vhd" add_file -vhdl -lib work "tdc_release/Channel_200.vhd" add_file -vhdl -lib work "tdc_release/Channel.vhd" -add_file -vhdl -lib work "tdc_release/Encoder_304_Bit.vhd" +#add_file -vhdl -lib work "tdc_release/Encoder_304_Bit.vhd" +add_file -vhdl -lib work "tdc_release/Encoder_288_Bit.vhd" add_file -vhdl -lib work "tdc_release/fallingEdgeDetect.vhd" add_file -vhdl -lib work "tdc_release/hit_mux.vhd" add_file -vhdl -lib work "tdc_release/LogicAnalyser.vhd" -add_file -vhdl -lib work "tdc_release/Readout.vhd" +#add_file -vhdl -lib work "tdc_release/Readout.vhd" +add_file -vhdl -lib work "tdc_release/Readout_record.vhd" add_file -vhdl -lib work "tdc_release/risingEdgeDetect.vhd" add_file -vhdl -lib work "tdc_release/ROM_encoder_ecp3.vhd" add_file -vhdl -lib work "tdc_release/ShiftRegisterSISO.vhd" add_file -vhdl -lib work "tdc_release/Stretcher_A.vhd" add_file -vhdl -lib work "tdc_release/Stretcher_B.vhd" add_file -vhdl -lib work "tdc_release/Stretcher.vhd" -add_file -vhdl -lib work "tdc_release/TDC.vhd" +#add_file -vhdl -lib work "tdc_release/TDC.vhd" +add_file -vhdl -lib work "tdc_release/TDC_record.vhd" add_file -vhdl -lib work "tdc_release/TriggerHandler.vhd" add_file -vhdl -lib work "tdc_release/up_counter.vhd" + +add_file -vhdl -lib work "../../tdc/base/cores/ecp3/PLL/pll_in125_out33.vhd" add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_DC_36x128_DynThr_OutReg.vhd" add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_DC_36x128_OutReg.vhd" add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_DC_36x64_OutReg.vhd" @@ -164,5 +177,6 @@ add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_DC_36x32_OutReg.vh add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_36x128_OutReg.vhd" add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_36x64_OutReg.vhd" add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_36x32_OutReg.vhd" + add_file -vhdl -lib work "trb3_periph_ADA.vhd" diff --git a/base/trb3_periph.p2t b/base/trb3_periph.p2t index 995161f..b63d48e 100644 --- a/base/trb3_periph.p2t +++ b/base/trb3_periph.p2t @@ -1,20 +1,70 @@ -w --i 15 --l 5 --n 1 -y +-l 5 +#-m nodelist.txt # Controlled by the compile.pl script. +#-n 1 # Controlled by the compile.pl script. -s 12 --t 11 +-t 1 -c 1 -e 2 --m nodelist.txt -# -w -# -i 6 -# -l 5 -# -n 1 -# -t 1 -# -s 1 -# -c 0 -# -e 0 -# +-i 15 -exp parCDP=1:parCDR=1:parPlcInLimit=0:parPlcInNeighborSize=1:parPathBased=ON:parHold=ON:parHoldLimit=10000:paruseNBR=1: + + +#General PAR Command Line Options +# -w With this option, any files generated will overwrite existing files +# (e.g., any .par, .pad files). +# -y Adds the Delay Summary Report in the .par file and creates the delay +# file (in .dly format) at the end of the par run. +# +#PAR Placement Command Line Options +# -l Specifies the effort level of the design from 1 (simplest designs) to 5 +# (most complex designs). +# -m Multi-tasking option. Controlled by the compile.pl script. +# -n Sets the number of iterations performed at the effort level specified by +# the -l option. Controlled by the compile.pl script. +# -s Save the number of best results for this run. +# -t Start placement at the specified cost table. Default is 1. +# +#PAR Routing Command Line Options +# -c Run number of cost-based cleanup passes of the router. +# -e Run number of delay-based cleanup passes of the router on +# completely-routed designs only. +# -i Run a maximum number of passes, stopping earlier only if the routing +# goes to 100 percent completion and all constraints are met. +# +#PAR Explorer Command Line Options +# parCDP Enable the congestion-driven placement (CDP) algorithm. CDP is +# compatible with all Lattice FPGA device families; however, most +# benefit has been demonstrated with benchmarks targeted to ECP5, +# LatticeECP2/M, LatticeECP3, and LatticeXP2 device families. +# parCDR Enable the congestion-driven router (CDR) algorithm. +# Congestion-driven options like parCDR and parCDP can improve +# performance given a design with multiple congestion “hotspots.” +# The Layer > Congestion option of the Design Planner Floorplan +# View can help visualize routing congestion. Large congested +# areas may prevent the options from finding a successful +# solution. CDR is compatible with all Lattice FPGA device +# families however most benefit has been demonstrated with +# benchmarks targeted to ECP5, LatticeECP2/M,LatticeECP3, and +# LatticeXP2 device families. +# paruseNBR NBR Router or Negotiation-based routing option. Supports all +# FPGA device families except LatticeXP and MachXO. When turned +# on, an alternate routing engine from the traditional +# Rip-up-based routing selection (RBR) is used. This involves an +# iterative routing algorithm that routes connections to achieve +# minimum delay cost. It does so by computing the demand on each +# routing resource and applying cost values per node. It will +# complete when an optimal solution is arrived at or the number +# of iterations is reached. +# parPathBased Path-based placement option. Path-based timing driven placement +# will yield better performance and more predictable results in +# many cases. +# parHold Additional hold time correction option. This option forces the +# router to automatically insert extra wires to compensate for +# the hold time violation. +# parHoldLimit This option allows you to set a limit on the number of hold time +# violations to be processed by the auto hold time correction +# option parHold. +# parPlcInLimit Cannot find in the online help +# parPlcInNeighborSize Cannot find in the online help diff --git a/base/trb3_periph_hadesstart.lpf b/base/trb3_periph_hadesstart.lpf new file mode 100644 index 0000000..6ace711 --- /dev/null +++ b/base/trb3_periph_hadesstart.lpf @@ -0,0 +1,421 @@ +BLOCK RESETPATHS ; +BLOCK ASYNCPATHS ; +BLOCK RD_DURING_WR_PATHS ; + +####Entity template +# entity trb3_periph_ada is +# port( +# --Clocks +# CLK_GPLL_LEFT : in std_logic; --Clock Manager 1/(2468), 125 MHz +# CLK_GPLL_RIGHT : in std_logic; --Clock Manager 2/(2468), 200 MHz <-- MAIN CLOCK for FPGA +# CLK_PCLK_LEFT : in std_logic; --Clock Fan-out, 200/400 MHz <-- For TDC. Same oscillator as GPLL right! +# CLK_PCLK_RIGHT : in std_logic; --Clock Fan-out, 200/400 MHz <-- For TDC. Same oscillator as GPLL right! +# --Trigger +# TRIGGER_LEFT : in std_logic; --left side trigger input from fan-out +# TRIGGER_RIGHT : in std_logic; --right side trigger input from fan-out +# --Serdes +# CLK_SERDES_INT_LEFT : in std_logic; --Clock Manager 1/(1357), off, 125 MHz possible +# CLK_SERDES_INT_RIGHT : in std_logic; --Clock Manager 2/(1357), 200 MHz, only in case of problems +# SERDES_INT_TX : out std_logic_vector(3 downto 0); +# SERDES_INT_RX : in std_logic_vector(3 downto 0); +# SERDES_ADDON_TX : out std_logic_vector(11 downto 0); +# SERDES_ADDON_RX : in std_logic_vector(11 downto 0); +# --Inter-FPGA Communication +# FPGA5_COMM : inout std_logic_vector(11 downto 0); +# --Bit 0/1 input, serial link RX active +# --Bit 2/3 output, serial link TX active +# --Connection to ADA AddOn +# SPARE_LINE : inout std_logic_vector(3 downto 0); --inputs only +# INP : in std_logic_vector(63 downto 0); +# OUT_L_SCK : out std_logic; +# OUT_L_SDO : out std_logic; +# OUT_L_CS : out std_logic; +# IN_L_SDI : out std_logic; +# OUT_H_SCK : out std_logic; +# OUT_H_SDO : out std_logic; +# OUT_H_CS : out std_logic; +# IN_H_SDI : out std_logic; +# --Flash ROM & Reboot +# FLASH_CLK : out std_logic; +# FLASH_CS : out std_logic; +# FLASH_CIN : out std_logic; +# FLASH_DOUT : in std_logic; +# PROGRAMN : out std_logic; --reboot FPGA +# --Misc +# TEMPSENS : inout std_logic; --Temperature Sensor +# CODE_LINE : in std_logic_vector(1 downto 0); +# LED_GREEN : out std_logic; +# LED_ORANGE : out std_logic; +# LED_RED : out std_logic; +# LED_YELLOW : out std_logic; +# SUPPL : in std_logic; --terminated diff pair, PCLK, Pads +# --Test Connectors +# TEST_LINE : inout std_logic_vector(15 downto 0) +# ); +# attribute syn_useioff : boolean; +# --no IO-FF for LEDs relaxes timing constraints +# attribute syn_useioff of LED_GREEN : signal is false; +# attribute syn_useioff of LED_ORANGE : signal is false; +# attribute syn_useioff of LED_RED : signal is false; +# attribute syn_useioff of LED_YELLOW : signal is false; +# attribute syn_useioff of TEMPSENS : signal is false; +# attribute syn_useioff of PROGRAMN : signal is false; +# attribute syn_useioff of CODE_LINE : signal is false; +# attribute syn_useioff of TRIGGER_LEFT : signal is false; +# attribute syn_useioff of TRIGGER_RIGHT : signal is false; +# --important signals +# attribute syn_useioff of FLASH_CLK : signal is true; +# attribute syn_useioff of FLASH_CS : signal is true; +# attribute syn_useioff of FLASH_CIN : signal is true; +# attribute syn_useioff of FLASH_DOUT : signal is true; +# attribute syn_useioff of FPGA5_COMM : signal is true; +# attribute syn_useioff of TEST_LINE : signal is true; +# attribute syn_useioff of INP : signal is false; +# attribute syn_useioff of SPARE_LINE : signal is true; +# attribute syn_useioff of OUT_L_SCK : signal is true; +# attribute syn_useioff of OUT_L_SDO : signal is true; +# attribute syn_useioff of OUT_L_CS : signal is true; +# attribute syn_useioff of IN_L_SDI : signal is true; +# attribute syn_useioff of OUT_H_SCK : signal is true; +# attribute syn_useioff of OUT_H_SDO : signal is true; +# attribute syn_useioff of OUT_H_CS : signal is true; +# attribute syn_useioff of IN_H_SDI : signal is true; +# end entity; + + +################################################################# +# Basic Settings +################################################################# + + SYSCONFIG MCCLK_FREQ = 20; + + FREQUENCY PORT CLK_PCLK_RIGHT 200 MHz; + FREQUENCY PORT CLK_PCLK_LEFT 200 MHz; + FREQUENCY PORT CLK_GPLL_RIGHT 200 MHz; + FREQUENCY PORT CLK_GPLL_LEFT 125 MHz; + +MULTICYCLE FROM CLKNET "clk_100_i_c" TO CLKNET "CLK_PCLK_LEFT_c" 1 X ; +MULTICYCLE FROM CLKNET "CLK_PCLK_LEFT_c" TO CLKNET "clk_100_i_c" 2 X ; + +LOCATE COMP "THE_MEDIA_UPLINK/gen_serdes_1_200_THE_SERDES/PCSD_INST" SITE "PCSA" ; + +################################################################# +# Clock I/O +################################################################# +LOCATE COMP "CLK_PCLK_RIGHT" SITE "U20"; +LOCATE COMP "CLK_PCLK_LEFT" SITE "M4"; +LOCATE COMP "CLK_SERDES_INT_RIGHT" SITE "AC18"; +LOCATE COMP "CLK_SERDES_INT_LEFT" SITE "AC10"; +LOCATE COMP "CLK_GPLL_RIGHT" SITE "W1"; +LOCATE COMP "CLK_GPLL_LEFT" SITE "U25"; + +DEFINE PORT GROUP "CLK_group" "CLK*" ; +IOBUF GROUP "CLK_group" IO_TYPE=LVDS25 ; + + +################################################################# +# Trigger I/O +################################################################# + +#Trigger from fan-out +LOCATE COMP "TRIGGER_LEFT" SITE "V3"; +LOCATE COMP "TRIGGER_RIGHT" SITE "N24"; +IOBUF PORT "TRIGGER_RIGHT" IO_TYPE=LVDS25; +IOBUF PORT "TRIGGER_LEFT" IO_TYPE=LVDS25; + + + +################################################################# +# To central FPGA +################################################################# + +LOCATE COMP "FPGA5_COMM_0" SITE "AD4"; +LOCATE COMP "FPGA5_COMM_1" SITE "AE3"; +LOCATE COMP "FPGA5_COMM_2" SITE "AA7"; +LOCATE COMP "FPGA5_COMM_3" SITE "AB7"; +LOCATE COMP "FPGA5_COMM_4" SITE "AD3"; +LOCATE COMP "FPGA5_COMM_5" SITE "AC4"; +LOCATE COMP "FPGA5_COMM_6" SITE "AE2"; +LOCATE COMP "FPGA5_COMM_7" SITE "AF3"; +LOCATE COMP "FPGA5_COMM_8" SITE "AE4"; +LOCATE COMP "FPGA5_COMM_9" SITE "AF4"; +LOCATE COMP "FPGA5_COMM_10" SITE "V10"; +LOCATE COMP "FPGA5_COMM_11" SITE "W10"; +DEFINE PORT GROUP "FPGA_group" "FPGA*" ; +IOBUF GROUP "FPGA_group" IO_TYPE=LVCMOS25 PULLMODE=UP ; + +LOCATE COMP "TEST_LINE_0" SITE "A5"; +LOCATE COMP "TEST_LINE_1" SITE "A6"; +LOCATE COMP "TEST_LINE_2" SITE "G8"; +LOCATE COMP "TEST_LINE_3" SITE "F9"; +LOCATE COMP "TEST_LINE_4" SITE "D9"; +LOCATE COMP "TEST_LINE_5" SITE "D10"; +LOCATE COMP "TEST_LINE_6" SITE "F10"; +LOCATE COMP "TEST_LINE_7" SITE "E10"; +LOCATE COMP "TEST_LINE_8" SITE "A8"; +LOCATE COMP "TEST_LINE_9" SITE "B8"; +LOCATE COMP "TEST_LINE_10" SITE "G10"; +LOCATE COMP "TEST_LINE_11" SITE "G9"; +LOCATE COMP "TEST_LINE_12" SITE "C9"; +LOCATE COMP "TEST_LINE_13" SITE "C10"; +LOCATE COMP "TEST_LINE_14" SITE "H10"; +LOCATE COMP "TEST_LINE_15" SITE "H11"; +DEFINE PORT GROUP "TEST_LINE_group" "TEST_LINE*" ; +IOBUF GROUP "TEST_LINE_group" IO_TYPE=LVCMOS25 PULLMODE=DOWN; + +################################################################# +# Connection to AddOn +################################################################# +#All DQ groups from one bank are grouped. +#All DQS are inserted in the DQ lines at position 6 and 7 +#DQ 6-9 are shifted to 8-11 +#Order per bank is kept, i.e. adjacent numbers have adjacent pins +#all DQ blocks are 6+2+4=12 Pins wide, only DQUL3 and DQUR0 are 6+2+2=10. +#even numbers are positive LVDS line, odd numbers are negative LVDS line +#DQUL can be switched to 1.8V + +LOCATE COMP "INP_0" SITE "P1"; #"DQLL_0" DQLL0_0 #1 +# LOCATE COMP "INN_0" SITE "P2"; #"DQLL_1" DQLL0_1 #3 +LOCATE COMP "INP_1" SITE "T2"; #"DQLL_2" DQLL0_2 #5 +# LOCATE COMP "INN_1" SITE "U3"; #"DQLL_3" DQLL0_3 #7 +LOCATE COMP "INP_2" SITE "R1"; #"DQLL_4" DQLL0_4 #9 +# LOCATE COMP "INN_2" SITE "R2"; #"DQLL_5" DQLL0_5 #11 +LOCATE COMP "INP_3" SITE "N3"; #"DQLL_6" DQSLL0_T #13 +# LOCATE COMP "INN_3" SITE "P3"; #"DQLL_7" DQSLL0_C #15 +LOCATE COMP "INP_4" SITE "P5"; #"DQLL_8" DQLL0_6 #17 +# LOCATE COMP "INN_4" SITE "P6"; #"DQLL_9" DQLL0_7 #19 +LOCATE COMP "INP_5" SITE "N5"; #"DQLL_10" DQLL0_8 #21 +# LOCATE COMP "INN_5" SITE "N6"; #"DQLL_11" DQLL0_9 #23 + +LOCATE COMP "INP_22" SITE "V1"; #"DQLL_12" DQLL1_0 #26 +# LOCATE COMP "INN_22" SITE "U2"; #"DQLL_13" DQLL1_1 #28 +LOCATE COMP "INP_23" SITE "T1"; #"DQLL_14" DQLL1_2 #30 +# LOCATE COMP "INN_23" SITE "U1"; #"DQLL_15" DQLL1_3 #32 +LOCATE COMP "INP_24" SITE "P4"; #"DQLL_16" DQLL1_4 #34 +# LOCATE COMP "INN_24" SITE "R3"; #"DQLL_17" DQLL1_5 #36 +LOCATE COMP "INP_25" SITE "T3"; #"DQLL_18" DQSLL1_T #38 +# LOCATE COMP "INN_25" SITE "R4"; #"DQLL_19" DQSLL1_C #40 +LOCATE COMP "INP_26" SITE "R5"; #"DQLL_20" DQLL1_6 #42 +# LOCATE COMP "INN_26" SITE "R6"; #"DQLL_21" DQLL1_7 #44 +LOCATE COMP "INP_27" SITE "T7"; #"DQLL_22" DQLL1_8 #46 +# LOCATE COMP "INN_27" SITE "T8"; #"DQLL_23" DQLL1_9 #48 + +LOCATE COMP "INP_6" SITE "AC2"; #"DQLL_24" DQLL2_0 #25 +# LOCATE COMP "INN_6" SITE "AC3"; #"DQLL_25" DQLL2_1 #27 +LOCATE COMP "INP_7" SITE "AB1"; #"DQLL_26" DQLL2_2 #29 +# LOCATE COMP "INN_7" SITE "AC1"; #"DQLL_27" DQLL2_3 #31 +LOCATE COMP "INP_8" SITE "AA1"; #"DQLL_28" DQLL2_4 #33 +# LOCATE COMP "INN_8" SITE "AA2"; #"DQLL_29" DQLL2_5 #35 +LOCATE COMP "INP_9" SITE "W7"; #"DQLL_30" DQLL2_T #37 #should be DQSLL2 +# LOCATE COMP "INN_9" SITE "W6"; #"DQLL_31" DQLL2_C #39 #should be DQSLL2 +LOCATE COMP "INP_10" SITE "Y5"; #"DQLL_32" DQLL2_6 #41 +# LOCATE COMP "INN_10" SITE "AA5"; #"DQLL_33" DQLL2_7 #43 +LOCATE COMP "INP_11" SITE "V6"; #"DQLL_34" DQLL2_8 #45 +# LOCATE COMP "INN_11" SITE "V7"; #"DQLL_35" DQLL2_9 #47 + +LOCATE COMP "INP_16" SITE "AD1"; #"DQLL_36" DQLL3_0 #2 +# LOCATE COMP "INN_16" SITE "AD2"; #"DQLL_37" DQLL3_1 #4 +LOCATE COMP "INP_17" SITE "AB5"; #"DQLL_38" DQLL3_2 #6 +# LOCATE COMP "INN_17" SITE "AB6"; #"DQLL_39" DQLL3_3 #8 +LOCATE COMP "INP_18" SITE "AB3"; #"DQLL_40" DQLL3_4 #10 +# LOCATE COMP "INN_18" SITE "AB4"; #"DQLL_41" DQLL3_5 #12 +LOCATE COMP "INP_19" SITE "Y6"; #"DQLL_42" DQLL3_T #14 #should be DQSLL3 +# LOCATE COMP "INN_19" SITE "Y7"; #"DQLL_43" DQLL3_C #16 #should be DQSLL3 +LOCATE COMP "INP_20" SITE "AA3"; #"DQLL_44" DQLL3_6 #18 +# LOCATE COMP "INN_20" SITE "AA4"; #"DQLL_45" DQLL3_7 #20 +LOCATE COMP "INP_21" SITE "W8"; #"DQLL_46" DQLL3_8 #22 +# LOCATE COMP "INN_21" SITE "W9"; #"DQLL_47" DQLL3_9 #24 + +LOCATE COMP "INP_38" SITE "AC26"; #"DQLR_0" DQLR0_0 #129 +# LOCATE COMP "INN_38" SITE "AC25"; #"DQLR_1" DQLR0_1 #131 +LOCATE COMP "INP_39" SITE "Y19"; #"DQLR_2" DQLR0_2 #133 +# LOCATE COMP "INN_39" SITE "Y20"; #"DQLR_3" DQLR0_3 #135 +LOCATE COMP "INP_40" SITE "AB24"; #"DQLR_4" DQLR0_4 #137 +# LOCATE COMP "INN_40" SITE "AC24"; #"DQLR_5" DQLR0_5 #139 +LOCATE COMP "INP_41" SITE "Y22"; #"DQLR_6" DQSLR0_T #141 +# LOCATE COMP "INN_41" SITE "AA22"; #"DQLR_7" DQSLR0_C #143 +LOCATE COMP "INP_42" SITE "AD24"; #"DQLR_8" DQLR0_6 #145 +# LOCATE COMP "INN_42" SITE "AE24"; #"DQLR_9" DQLR0_7 #147 +LOCATE COMP "INP_43" SITE "AE25"; #"DQLR_10" DQLR0_8 #149 +# LOCATE COMP "INN_43" SITE "AF24"; #"DQLR_11" DQLR0_9 #151 + +LOCATE COMP "INP_44" SITE "W23"; #"DQLR_12" DQLR1_0 #169 +# LOCATE COMP "INN_44" SITE "W22"; #"DQLR_13" DQLR1_1 #171 +LOCATE COMP "INP_45" SITE "AA25"; #"DQLR_14" DQLR1_2 #173 +# LOCATE COMP "INN_45" SITE "Y24"; #"DQLR_15" DQLR1_3 #175 +LOCATE COMP "INP_46" SITE "AA26"; #"DQLR_16" DQLR1_4 #177 +# LOCATE COMP "INN_46" SITE "AB26"; #"DQLR_17" DQLR1_5 #179 +LOCATE COMP "INP_47" SITE "W21"; #"DQLR_18" DQSLR1_T #181 +# LOCATE COMP "INN_47" SITE "W20"; #"DQLR_19" DQSLR1_C #183 +LOCATE COMP "OUT_H_SDO" SITE "AA24"; #"DQLR_20" DQLR1_6 #185 +# LOCATE COMP "OUT_H_SDOb" SITE "AA23"; #"DQLR_21" DQLR1_7 #187 +LOCATE COMP "IN_H_SDI" SITE "AD26"; #"DQLR_22" DQLR1_8 #189 +# LOCATE COMP "IN_H_SDIbD" SITE "AD25"; #"DQLR_23" DQLR1_9 #191 + +LOCATE COMP "INP_60" SITE "R25"; #"DQLR_24" DQLR2_0 #170 +# LOCATE COMP "INN_60" SITE "R26"; #"DQLR_25" DQLR2_1 #172 +LOCATE COMP "INP_61" SITE "T25"; #"DQLR_26" DQLR2_2 #174 +# LOCATE COMP "INN_61" SITE "T24"; #"DQLR_27" DQLR2_3 #176 +LOCATE COMP "INP_62" SITE "T26"; #"DQLR_28" DQLR2_4 #178 +# LOCATE COMP "INN_62" SITE "U26"; #"DQLR_29" DQLR2_5 #180 +LOCATE COMP "INP_63" SITE "V21"; #"DQLR_30" DQSLR2_T #182 +# LOCATE COMP "INN_63" SITE "V22"; #"DQLR_31" DQSLR2_C #184 +LOCATE COMP "OUT_H_SCK" SITE "U24"; #"DQLR_32" DQLR2_6 #186 +# LOCATE COMP "OUT_H_SCKb" SITE "V24"; #"DQLR_33" DQLR2_7 #188 +LOCATE COMP "OUT_H_CS" SITE "U23"; #"DQLR_34" DQLR2_8 #190 +# LOCATE COMP "OUT_H_CSb" SITE "U22"; #"DQLR_35" DQLR2_9 #192 + +# LOCATE COMP "DQUL_0" SITE "B2"; #"DQUL_0" DQUL0_0 #74 +# LOCATE COMP "DQUL_1" SITE "B3"; #"DQUL_1" DQUL0_1 #76 +LOCATE COMP "OUT_L_SDO" SITE "D4"; #"DQUL_2" DQUL0_2 #78 +# LOCATE COMP "OUT_L_SDOb" SITE "E4"; #"DQUL_3" DQUL0_3 #80 +LOCATE COMP "OUT_L_SCK" SITE "C3"; #"DQUL_4" DQUL0_4 #82 +# LOCATE COMP "OUT_L_SCKb" SITE "D3"; #"DQUL_5" DQUL0_5 #84 +LOCATE COMP "IN_L_SDI" SITE "G5"; #"DQUL_6" DQSUL0_T #86 +# LOCATE COMP "IN_L_SDIb" SITE "G6"; #"DQUL_7" DQSUL0_C #88 +# LOCATE COMP "DQUL_8" SITE "E3"; #"DQUL_8" DQUL0_6 #90 +# LOCATE COMP "DQUL_9" SITE "F4"; #"DQUL_9" DQUL0_7 #92 +LOCATE COMP "OUT_L_CS" SITE "H6"; #"DQUL_10" DQUL0_8 #94 +# LOCATE COMP "OUT_L_CSb" SITE "J6"; #"DQUL_11" DQUL0_9 #96 + +# LOCATE COMP "DQUL_12" SITE "G2"; #"DQUL_12" DQUL1_0 #73 +# LOCATE COMP "DQUL_13" SITE "G3"; #"DQUL_13" DQUL1_1 #75 +# LOCATE COMP "DQUL_14" SITE "F2"; #"DQUL_14" DQUL1_2 #77 +# LOCATE COMP "DQUL_15" SITE "F3"; #"DQUL_15" DQUL1_3 #79 +# LOCATE COMP "DQUL_16" SITE "C2"; #"DQUL_16" DQUL1_4 #81 +# LOCATE COMP "DQUL_17" SITE "D2"; #"DQUL_17" DQUL1_5 #83 +# LOCATE COMP "DQUL_18" SITE "K7"; #"DQUL_18" DQSUL1_T #85 +# LOCATE COMP "DQUL_19" SITE "K6"; #"DQUL_19" DQSUL1_C #87 +# LOCATE COMP "DQUL_20" SITE "H5"; #"DQUL_20" DQUL1_6 #89 +# LOCATE COMP "DQUL_21" SITE "J5"; #"DQUL_21" DQUL1_7 #91 +# LOCATE COMP "DQUL_22" SITE "K8"; #"DQUL_22" DQUL1_8 #93 +# LOCATE COMP "DQUL_23" SITE "J7"; #"DQUL_23" DQUL1_9 #95 + +LOCATE COMP "INP_28" SITE "K2"; #"DQUL_24" DQUL2_0 #50 +# LOCATE COMP "INN_28" SITE "K1"; #"DQUL_25" DQUL2_1 #52 +LOCATE COMP "INP_29" SITE "J4"; #"DQUL_26" DQUL2_2 #54 +# LOCATE COMP "INN_29" SITE "J3"; #"DQUL_27" DQUL2_3 #56 +LOCATE COMP "INP_30" SITE "D1"; #"DQUL_28" DQUL2_4 #58 +# LOCATE COMP "INN_30" SITE "C1"; #"DQUL_29" DQUL2_5 #60 +LOCATE COMP "INP_31" SITE "K4"; #"DQUL_30" DQSUL2_T #62 +# LOCATE COMP "INN_31" SITE "K5"; #"DQUL_31" DQSUL2_C #64 +# LOCATE COMP "DQUL_32" SITE "E1"; #"DQUL_32" DQUL2_6 #66 +# LOCATE COMP "DQUL_33" SITE "F1"; #"DQUL_33" DQUL2_7 #68 +# LOCATE COMP "DQUL_34" SITE "L5"; #"DQUL_34" DQUL2_8 #70 +# LOCATE COMP "DQUL_35" SITE "L6"; #"DQUL_35" DQUL2_9 #72 + +LOCATE COMP "INP_12" SITE "H2"; #"DQUL_36" DQUL3_0 #49 +# LOCATE COMP "INN_12" SITE "G1"; #"DQUL_37" DQUL3_1 #51 +LOCATE COMP "INP_13" SITE "K3"; #"DQUL_38" DQUL3_2 #53 +# LOCATE COMP "INN_13" SITE "L3"; #"DQUL_39" DQUL3_3 #55 +LOCATE COMP "INP_14" SITE "H1"; #"DQUL_40" DQUL3_4 #57 +# LOCATE COMP "INN_13" SITE "J1"; #"DQUL_41" DQUL3_5 #59 +LOCATE COMP "INP_15" SITE "M5"; #"DQUL_42" DQSUL3_T #61 +# LOCATE COMP "INN_15" SITE "M6"; #"DQUL_43" DQSUL3_C #63 +# LOCATE COMP "DQUL_44" SITE "L2"; #"DQUL_44" DQUL3_6 #65 +# LOCATE COMP "DQUL_45" SITE "L1"; #"DQUL_45" DQUL3_7 #67 + + +LOCATE COMP "INP_32" SITE "J23"; #"DQUR_0" "DQUR_0" DQUR0_0 #105 +# LOCATE COMP "INN_32" SITE "H23"; #"DQUR_1" "DQUR_1" DQUR0_1 #107 +LOCATE COMP "INP_33" SITE "G26"; #"DQUR_2" "DQUR_2" DQUR0_2 #109 +# LOCATE COMP "INN_33" SITE "F26"; #"DQUR_3" "DQUR_3" DQUR0_3 #111 +LOCATE COMP "INP_34" SITE "F24"; #"DQUR_4" "DQUR_4" DQSUR0_T #113 +# LOCATE COMP "INN_34" SITE "G24"; #"DQUR_7" "DQUR_7" DQSUR0_C #115 +LOCATE COMP "INP_35" SITE "H26"; #"DQUR_6" "DQUR_6" DQUR0_4 #117 +# LOCATE COMP "INN_35" SITE "H25"; #"DQUR_5" "DQUR_5" DQUR0_5 #119 +LOCATE COMP "INP_36" SITE "K23"; #"DQUR_8" "DQUR_8" DQUR0_6 #121 +# LOCATE COMP "INN_36" SITE "K22"; #"DQUR_9" "DQUR_9" DQUR0_7 #123 +LOCATE COMP "INP_37" SITE "F25"; #"DQUR_10" DQUR0_8 #125 #input only +# LOCATE COMP "INN_37" SITE "E26"; #"DQUR_11" DQUR0_9 #127 #input only + +LOCATE COMP "INP_48" SITE "H24"; #"DQUR_10" DQUR1_0 #106 +# LOCATE COMP "INN_48" SITE "G25"; #"DQUR_11" DQUR1_1 #108 +LOCATE COMP "INP_49" SITE "L20"; #"DQUR_12" DQUR1_2 #110 +# LOCATE COMP "INN_49" SITE "M21"; #"DQUR_13" DQUR1_3 #112 +LOCATE COMP "INP_50" SITE "K24"; #"DQUR_14" DQUR1_4 #114 +# LOCATE COMP "INN_50" SITE "J24"; #"DQUR_15" DQUR1_5 #116 +LOCATE COMP "INP_51" SITE "M23"; #"DQUR_16" DQSUR1_T #118 +# LOCATE COMP "INN_51" SITE "M24"; #"DQUR_17" DQSUR1_C #120 +LOCATE COMP "INP_52" SITE "L24"; #"DQUR_18" DQUR1_6 #122 +# LOCATE COMP "INN_52" SITE "K25"; #"DQUR_19" DQUR1_7 #124 +LOCATE COMP "INP_53" SITE "M22"; #"DQUR_20" DQUR1_8 #126 +# LOCATE COMP "INN_53" SITE "N21"; #"DQUR_21" DQUR1_9 #128 + +LOCATE COMP "INP_54" SITE "J26"; #"DQUR_22" DQUR2_0 #130 +# LOCATE COMP "INN_54" SITE "K26"; #"DQUR_23" DQUR2_1 #132 +LOCATE COMP "INP_55" SITE "N23"; #"DQUR_24" DQUR2_2 #134 +# LOCATE COMP "INN_55" SITE "N22"; #"DQUR_25" DQUR2_3 #136 +LOCATE COMP "INP_56" SITE "K19"; #"DQUR_26" DQUR2_4 #138 +# LOCATE COMP "INN_56" SITE "L19"; #"DQUR_27" DQUR2_5 #140 +LOCATE COMP "INP_57" SITE "P23"; #"DQUR_28" DQSUR2_T #142 +# LOCATE COMP "INN_57" SITE "R22"; #"DQUR_29" DQSUR2_C #144 +LOCATE COMP "INP_58" SITE "L25"; #"DQUR_30" DQUR2_6 #146 +# LOCATE COMP "INN_58" SITE "L26"; #"DQUR_31" DQUR2_7 #148 +LOCATE COMP "INP_59" SITE "P21"; #"DQUR_32" DQUR2_8 #150 +# LOCATE COMP "INN_59" SITE "P22"; #"DQUR_33" DQUR2_9 #152 + +DEFINE PORT GROUP "INP_group" "INP*" ; +IOBUF GROUP "INP_group" IO_TYPE=LVDS25 DIFFRESISTOR=100; + +#DEFINE PORT GROUP "IN_group" "IN_*" ; +#IOBUF GROUP "IN_group" IO_TYPE=LVDS25 DIFFRESISTOR=100; + +DEFINE PORT GROUP "OUT_group" "OUT_*" ; +IOBUF GROUP "OUT_group" IO_TYPE=LVDS25; + +################################################################# +# Additional Lines to AddOn +################################################################# + +#Lines 0/1 are terminated with 100 Ohm, pads available on 0-3 +#all lines are input only +#line 4/5 go to PLL input +LOCATE COMP "SPARE_LINE_0" SITE "M25"; #194 +LOCATE COMP "SPARE_LINE_1" SITE "M26"; #196 +LOCATE COMP "SPARE_LINE_2" SITE "W4"; #198 +LOCATE COMP "SPARE_LINE_3" SITE "W5"; #200 + + +################################################################# +# Flash ROM and Reboot +################################################################# + +LOCATE COMP "FLASH_CLK" SITE "B12"; +LOCATE COMP "FLASH_CS" SITE "E11"; +LOCATE COMP "FLASH_DIN" SITE "E12"; +LOCATE COMP "FLASH_DOUT" SITE "A12"; + +DEFINE PORT GROUP "FLASH_group" "FLASH*" ; +IOBUF GROUP "FLASH_group" IO_TYPE=LVCMOS25 PULLMODE=NONE; + +LOCATE COMP "PROGRAMN" SITE "B11"; +IOBUF PORT "PROGRAMN" IO_TYPE=LVCMOS25 PULLMODE=UP DRIVE=8 ; + + +################################################################# +# Misc +################################################################# +LOCATE COMP "TEMPSENS" SITE "A13"; +IOBUF PORT "TEMPSENS" IO_TYPE=LVCMOS25 PULLMODE=UP DRIVE=8 ; + +#coding of FPGA number +LOCATE COMP "CODE_LINE_1" SITE "AA20"; +LOCATE COMP "CODE_LINE_0" SITE "Y21"; +IOBUF PORT "CODE_LINE_1" IO_TYPE=LVCMOS25 PULLMODE=UP ; +IOBUF PORT "CODE_LINE_0" IO_TYPE=LVCMOS25 PULLMODE=UP ; + +#terminated differential pair to pads +LOCATE COMP "SUPPL" SITE "C14"; +IOBUF PORT "SUPPL" IO_TYPE=LVDS25 ; + + +################################################################# +# LED +################################################################# +LOCATE COMP "LED_GREEN" SITE "F12"; +LOCATE COMP "LED_ORANGE" SITE "G13"; +LOCATE COMP "LED_RED" SITE "A15"; +LOCATE COMP "LED_YELLOW" SITE "A16"; +DEFINE PORT GROUP "LED_group" "LED*" ; +IOBUF GROUP "LED_group" IO_TYPE=LVCMOS25 PULLMODE=NONE DRIVE=12; diff --git a/cbmtof/cbmtof.prj b/cbmtof/cbmtof.prj index 8c3e0d9..5ff6cf2 100644 --- a/cbmtof/cbmtof.prj +++ b/cbmtof/cbmtof.prj @@ -51,7 +51,7 @@ impl -active "workdir" #add_file options -add_file -vhdl -lib work "version.vhd" +add_file -vhdl -lib work "workdir/version.vhd" add_file -vhdl -lib work "tdc_release/tdc_version.vhd" add_file -vhdl -lib work "config.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_std.vhd" @@ -77,6 +77,7 @@ add_file -vhdl -lib work "../../trbnet/trb_net_sbuf6.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_sbuf.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_regIO.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_regio_bus_handler.vhd" +add_file -vhdl -lib work "../../trbnet/trb_net16_regio_bus_handler_record.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_priority_encoder.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_dummy_fifo.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_dummy_fifo.vhd" @@ -160,24 +161,30 @@ add_file -vhdl -lib work "../../trbnet/media_interfaces/ecp3_sfp/serdes_sync_0.v #add_file -vhdl -lib work "tdc_release/Adder_304.vhd" add_file -vhdl -lib work "tdc_release/tdc_components.vhd" add_file -vhdl -lib work "tdc_release/bit_sync.vhd" -add_file -vhdl -lib work "tdc_release/BusHandler.vhd" +#add_file -vhdl -lib work "tdc_release/BusHandler.vhd" +add_file -vhdl -lib work "tdc_release/BusHandler_record.vhd" add_file -vhdl -lib work "tdc_release/Channel.vhd" add_file -vhdl -lib work "tdc_release/Channel_200.vhd" -add_file -vhdl -lib work "tdc_release/Encoder_304_Bit.vhd" +#add_file -vhdl -lib work "tdc_release/Encoder_304_Bit.vhd" +add_file -vhdl -lib work "tdc_release/Encoder_288_Bit.vhd" add_file -vhdl -lib work "tdc_release/LogicAnalyser.vhd" -add_file -vhdl -lib work "tdc_release/Readout.vhd" +#add_file -vhdl -lib work "tdc_release/Readout.vhd" +add_file -vhdl -lib work "tdc_release/Readout_record.vhd" add_file -vhdl -lib work "tdc_release/ROM_encoder_ecp3.vhd" add_file -vhdl -lib work "tdc_release/ShiftRegisterSISO.vhd" add_file -vhdl -lib work "tdc_release/Stretcher_A.vhd" add_file -vhdl -lib work "tdc_release/Stretcher_B.vhd" add_file -vhdl -lib work "tdc_release/Stretcher.vhd" -add_file -vhdl -lib work "tdc_release/TDC.vhd" +#add_file -vhdl -lib work "tdc_release/TDC.vhd" +add_file -vhdl -lib work "tdc_release/TDC_record.vhd" add_file -vhdl -lib work "tdc_release/TriggerHandler.vhd" add_file -vhdl -lib work "tdc_release/up_counter.vhd" add_file -vhdl -lib work "tdc_release/fallingEdgeDetect.vhd" add_file -vhdl -lib work "tdc_release/risingEdgeDetect.vhd" add_file -vhdl -lib work "tdc_release/hit_mux.vhd" +add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_DC_36x32_OutReg.vhd" add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_DC_36x128_DynThr_OutReg.vhd" +add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_36x32_OutReg.vhd" add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_36x128_OutReg.vhd" add_file -vhdl -lib work "../base/code/input_to_trigger_logic.vhd" add_file -vhdl -lib work "../base/code/input_statistics.vhd" diff --git a/cbmtof/compile_cbmtof_frankfurt.pl b/cbmtof/compile_cbmtof_frankfurt.pl deleted file mode 100755 index 3eebf85..0000000 --- a/cbmtof/compile_cbmtof_frankfurt.pl +++ /dev/null @@ -1,297 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; -use FileHandle; -use Getopt::Long; - -################################################################################### -#Settings for this project -my $TOPNAME = "cbmtof"; #Name of top-level entity -my $lm_license_file_for_synplify = "1702\@hadeb05.gsi.de"; #"27000\@lxcad01.gsi.de"; -my $lm_license_file_for_par = "1702\@hadeb05.gsi.de"; - -my $lattice_path = '/d/jspc29/lattice/diamond/3.4_x64'; -my $synplify_path = '/d/jspc29/lattice/synplify/J-2014.09-SP2/'; -my $lattice_bin_path = "$lattice_path/bin/lin64"; # note the lin/lin64 at the end, no isfgpa needed -################################################################################### - -################################################################################### -#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 rung 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{'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 -system("cp ../base/$TOPNAME.lpf $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/tdc_constraints_64.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); - - -#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" ; - -if($syn==1 || $all==1){ -# $c="$synplify_path/bin/synplify_premier_dp -batch $TOPNAME.prj"; - $c="$lattice_path/bin/lin64/synpwrap -fg -options -batch $TOPNAME.prj"; - $r=execute($c, "do_not_exit" ); -} - -chdir $WORKDIR; - -if($syn==1 || $all==1){ - $fh = new FileHandle("<$TOPNAME".".srr"); - @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; - -if($map==1 || $all==1){ - $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; - foreach (@a) - { - if(/FC_|HitInvert|ff_en_/) - { - print "\n\n"; - print "#################################################\n"; - print "# !!!Possible Placement Errors!!! #\n"; - print "#################################################\n\n"; - - my $c="egrep 'WARNING.*hitBuf_|Channels/hit_buf_RNO|WARNING.*FC_|Channels/Channel200/SimAdderNo_FC|WARNING.*ff_en_|Channels/Channel200/ff_array_en_i_1_i'"." $TOPNAME"."_mrp.html"; - system($c); - last; - } - } -} - -if($par==1 || $all==1){ - system("rm $TOPNAME.ncd"); - #$c=qq|mpartrce -p "../$TOPNAME.p2t" -log "$TOPNAME.log" -o "$TOPNAME.rpt" -pr "$TOPNAME.prf" -tf "$TOPNAME.pt" "|.$TOPNAME.qq|_map.ncd" "$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"|; - if ($isMultiPar) - { - #$c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -stopzero -w -l 5 -t 1 -e 100 -exp parDisablePgroup=0:parUseNBR=1:parCDP=1:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - #$c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -stopzero -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parDisablePgroup=0:parUseNBR=1:parCDP=0:parCDR=0:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - $c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -w -l 5 -t 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; - foreach (@a) - { - my @line = split(' ', $_); - if(@line && ($line[2] =~ m/^[0-9]+$/) && ($line[3] =~ m/^[0-9]+$/)) - { - if(($line[2] == 0) && ($line[3] == 0)) - { - print "Copying $line[0].ncd file to workdir\n"; - my $c="cp $TOPNAME.dir/$line[0].ncd $TOPNAME.ncd"; - system($c); - print "\n\n"; - $isSuccess = 1; - last; - } - } - } - - if (!$isSuccess){ - print "\n\n"; - print "#################################################\n"; - print "# !!!PAR not succesfull!!! #\n"; - print "#################################################\n\n"; - exit 129; - } - } - else - { - #$c=qq|par -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parUseNBR=1:parCDP=0:parCDR=0:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - $c=qq|par -w -l 5 -t 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){ - # 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); - - $c=qq|ltxt2ptxt $TOPNAME.ncd|; - execute($c); - - my $c="cat $TOPNAME.par"; - system($c); - -} - -if($bitgen==1 || $all==1){ - $c=qq|bitgen -w -g CfgMode:Disable -g RamCfg:Reset -g ES:No $TOPNAME.ncd $TOPNAME.bit $TOPNAME.prf|; - # $c=qq|$lattice_path/ispfpga/bin/lin/bitgen -w "$TOPNAME.ncd" "$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 "\n\ncommand to execute: $c \n"; - $r=system($c); - if($r) { - print "$!"; - if($op ne "do_not_exit") { - exit; - } - } - return $r; -} diff --git a/cbmtof/compile_cbmtof_gsi.pl b/cbmtof/compile_cbmtof_gsi.pl deleted file mode 100755 index 4924776..0000000 --- a/cbmtof/compile_cbmtof_gsi.pl +++ /dev/null @@ -1,298 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; -use FileHandle; -use Getopt::Long; - -################################################################################### -#Settings for this project -my $TOPNAME = "cbmtof"; #Name of top-level entity -my $lattice_path = '/opt/lattice/diamond/3.0_x64/'; -my $lattice_bin_path = "$lattice_path/bin/lin64"; # note the lin/lin64 at the end, no isfgpa needed -my $synplify_path = '/opt/synplicity/I-2013.09-SP1'; -#my $lattice_path = '/opt/lattice/diamond/2.01/'; -#my $lattice_bin_path = "$lattice_path/bin/lin"; # note the lin/lin64 at the end, no isfgpa needed -#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 = "1702\@hadeb05.gsi.de"; -################################################################################### - -################################################################################### -#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 rung 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{'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 -system("cp ../base/$TOPNAME.lpf $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/tdc_constraints_64.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); - - -#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" ; - -if($syn==1 || $all==1){ - $c="$synplify_path/bin/synplify_premier_dp -batch $TOPNAME.prj"; - $r=execute($c, "do_not_exit" ); -} - -chdir $WORKDIR; - -if($syn==1 || $all==1){ - $fh = new FileHandle("<$TOPNAME".".srr"); - @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; - -if($map==1 || $all==1){ - $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; - foreach (@a) - { - if(/FC_|HitInvert|ff_en_/) - { - print "\n\n"; - print "#################################################\n"; - print "# !!!Possible Placement Errors!!! #\n"; - print "#################################################\n\n"; - - my $c="egrep 'WARNING.*hitBuf_|Channels/hit_buf_RNO|WARNING.*FC_|Channels/Channel200/SimAdderNo_FC|WARNING.*ff_en_|Channels/Channel200/ff_array_en_i_1_i'"." $TOPNAME"."_mrp.html"; - system($c); - last; - } - } -} - -if($par==1 || $all==1){ - system("rm $TOPNAME.ncd"); - #$c=qq|mpartrce -p "../$TOPNAME.p2t" -log "$TOPNAME.log" -o "$TOPNAME.rpt" -pr "$TOPNAME.prf" -tf "$TOPNAME.pt" "|.$TOPNAME.qq|_map.ncd" "$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"|; - if ($isMultiPar) - { - #$c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -stopzero -w -l 5 -t 1 -e 100 -exp parDisablePgroup=0:parUseNBR=1:parCDP=1:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - #$c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -stopzero -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parDisablePgroup=0:parUseNBR=1:parCDP=0:parCDR=0:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - $c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -w -l 5 -t 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; - foreach (@a) - { - my @line = split(' ', $_); - if(@line && ($line[2] =~ m/^[0-9]+$/) && ($line[3] =~ m/^[0-9]+$/)) - { - if(($line[2] == 0) && ($line[3] == 0)) - { - print "Copying $line[0].ncd file to workdir\n"; - my $c="cp $TOPNAME.dir/$line[0].ncd $TOPNAME.ncd"; - system($c); - print "\n\n"; - $isSuccess = 1; - last; - } - } - } - - if (!$isSuccess){ - print "\n\n"; - print "#################################################\n"; - print "# !!!PAR not succesfull!!! #\n"; - print "#################################################\n\n"; - exit 129; - } - } - else - { - #$c=qq|par -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parUseNBR=1:parCDP=0:parCDR=0:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - $c=qq|par -w -l 5 -t 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){ - # 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); - - $c=qq|ltxt2ptxt $TOPNAME.ncd|; - execute($c); - - my $c="cat $TOPNAME.par"; - system($c); - -} - -if($bitgen==1 || $all==1){ - $c=qq|bitgen -w -g CfgMode:Disable -g RamCfg:Reset -g ES:No $TOPNAME.ncd $TOPNAME.bit $TOPNAME.prf|; - # $c=qq|$lattice_path/ispfpga/bin/lin/bitgen -w "$TOPNAME.ncd" "$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 "\n\ncommand to execute: $c \n"; - $r=system($c); - if($r) { - print "$!"; - if($op ne "do_not_exit") { - exit; - } - } - return $r; -} diff --git a/cbmtof/compile_constraints.pl b/cbmtof/compile_constraints.pl deleted file mode 100755 index 0758442..0000000 --- a/cbmtof/compile_constraints.pl +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - -my $TOPNAME = "cbmtof"; #Name of top-level entity - - -#create full lpf file -system("cp ../base/cbmtof.lpf diamond/$TOPNAME.lpf"); -system("cat currentRelease/trbnet_constraints.lpf >> diamond/$TOPNAME.lpf"); -system("cat currentRelease/tdc_constraints_64.lpf >> diamond/$TOPNAME.lpf"); -system("cat currentRelease/unimportant_lines_constraints.lpf >> diamond/$TOPNAME.lpf"); -system("cat unimportant_lines_constraints.lpf >> diamond/$TOPNAME.lpf"); - diff --git a/cbmtof/config_compile_gsi.pl b/cbmtof/config_compile_gsi.pl index e683d9b..49edc4d 100644 --- a/cbmtof/config_compile_gsi.pl +++ b/cbmtof/config_compile_gsi.pl @@ -1,11 +1,15 @@ TOPNAME => "cbmtof", +project_path => "cbmtof", lm_license_file_for_synplify => "27000\@lxcad01.gsi.de", lm_license_file_for_par => "1702\@hadeb05.gsi.de", -lattice_path => '/opt/lattice/diamond/3.4_x64/', -synplify_path => '/opt/synplicity/J-2014.09-SP2', -#synplify_command => "/opt/lattice/diamond/3.4_x64/bin/lin64/synpwrap -fg -options", -synplify_command => "/opt/synplicity/J-2014.09-SP2/bin/synplify_premier_dp", +lattice_path => '/opt/lattice/diamond/3.6_x64', +synplify_path => '/opt/synplicity/K-2015.09', +#synplify_command => "/opt/lattice/diamond/3.6_x64/bin/lin64/synpwrap -fg -options", +synplify_command => "/opt/synplicity/K-2015.09/bin/synplify_premier_dp", +nodelist_file => '../nodes_lxhadeb07.txt', +par_options => '../../base/trb3_periph.p2t', + #Include only necessary lpf files include_TDC => 1, include_GBE => 0, @@ -13,5 +17,3 @@ include_GBE => 0, #Report settings firefox_open => 0, twr_number_of_errors => 20, - - diff --git a/gpin/config_compile_gsi.pl b/gpin/config_compile_gsi.pl index 5c5e166..c2a3ce9 100644 --- a/gpin/config_compile_gsi.pl +++ b/gpin/config_compile_gsi.pl @@ -1,11 +1,15 @@ TOPNAME => "trb3_periph_gpin", +project_path => "gpin", lm_license_file_for_synplify => "27000\@lxcad01.gsi.de", lm_license_file_for_par => "1702\@hadeb05.gsi.de", -lattice_path => '/opt/lattice/diamond/3.4_x64/', -synplify_path => '/opt/synplicity/J-2014.09-SP2', -#synplify_command => "/opt/lattice/diamond/3.4_x64/bin/lin64/synpwrap -fg -options", -synplify_command => "/opt/synplicity/J-2014.09-SP2/bin/synplify_premier_dp", +lattice_path => '/opt/lattice/diamond/3.6_x64', +synplify_path => '/opt/synplicity/K-2015.09', +#synplify_command => "/opt/lattice/diamond/3.6_x64/bin/lin64/synpwrap -fg -options", +synplify_command => "/opt/synplicity/K-2015.09/bin/synplify_premier_dp", +nodelist_file => '../nodes_lxhadeb07.txt', +par_options => '../../base/trb3_periph.p2t', + #Include only necessary lpf files include_TDC => 1, include_GBE => 0, @@ -13,5 +17,3 @@ include_GBE => 0, #Report settings firefox_open => 0, twr_number_of_errors => 20, - - diff --git a/gpin/trb3_periph_gpin.prj b/gpin/trb3_periph_gpin.prj index 4a8b6ed..a162e46 100644 --- a/gpin/trb3_periph_gpin.prj +++ b/gpin/trb3_periph_gpin.prj @@ -51,7 +51,7 @@ impl -active "workdir" #add_file options -add_file -vhdl -lib work "version.vhd" +add_file -vhdl -lib work "workdir/version.vhd" add_file -vhdl -lib work "config.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_std.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_components.vhd" @@ -70,6 +70,7 @@ add_file -vhdl -lib work "../../trbnet/trb_net_sbuf6.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_sbuf.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_regIO.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_regio_bus_handler.vhd" +add_file -vhdl -lib work "../../trbnet/trb_net16_regio_bus_handler_record.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_priority_encoder.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_dummy_fifo.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_dummy_fifo.vhd" @@ -148,23 +149,27 @@ add_file -vhdl -lib work "../base/code/sedcheck.vhd" #add_file -vhdl -lib work "tdc_release/Adder_304.vhd" add_file -vhdl -lib work "tdc_release/tdc_components.vhd" add_file -vhdl -lib work "tdc_release/bit_sync.vhd" -add_file -vhdl -lib work "tdc_release/BusHandler.vhd" -add_file -vhdl -lib work "tdc_release/Channel_200.vhd" +#add_file -vhdl -lib work "tdc_release/BusHandler.vhd" +add_file -vhdl -lib work "tdc_release/BusHandler_record.vhd" add_file -vhdl -lib work "tdc_release/Channel.vhd" -add_file -vhdl -lib work "tdc_release/Encoder_304_Bit.vhd" -add_file -vhdl -lib work "tdc_release/fallingEdgeDetect.vhd" -add_file -vhdl -lib work "tdc_release/hit_mux.vhd" +add_file -vhdl -lib work "tdc_release/Channel_200.vhd" +#add_file -vhdl -lib work "tdc_release/Encoder_304_Bit.vhd" +add_file -vhdl -lib work "tdc_release/Encoder_288_Bit.vhd" add_file -vhdl -lib work "tdc_release/LogicAnalyser.vhd" -add_file -vhdl -lib work "tdc_release/Readout.vhd" -add_file -vhdl -lib work "tdc_release/risingEdgeDetect.vhd" +#add_file -vhdl -lib work "tdc_release/Readout.vhd" +add_file -vhdl -lib work "tdc_release/Readout_record.vhd" add_file -vhdl -lib work "tdc_release/ROM_encoder_ecp3.vhd" add_file -vhdl -lib work "tdc_release/ShiftRegisterSISO.vhd" add_file -vhdl -lib work "tdc_release/Stretcher_A.vhd" add_file -vhdl -lib work "tdc_release/Stretcher_B.vhd" add_file -vhdl -lib work "tdc_release/Stretcher.vhd" -add_file -vhdl -lib work "tdc_release/TDC.vhd" +#add_file -vhdl -lib work "tdc_release/TDC.vhd" +add_file -vhdl -lib work "tdc_release/TDC_record.vhd" add_file -vhdl -lib work "tdc_release/TriggerHandler.vhd" add_file -vhdl -lib work "tdc_release/up_counter.vhd" +add_file -vhdl -lib work "tdc_release/fallingEdgeDetect.vhd" +add_file -vhdl -lib work "tdc_release/risingEdgeDetect.vhd" +add_file -vhdl -lib work "tdc_release/hit_mux.vhd" add_file -vhdl -lib work "../../tdc/base/cores/ecp3/PLL/pll_in125_out33.vhd" add_file -vhdl -lib work "../../tdc/base/cores/ecp3/FIFO/FIFO_DC_36x128_DynThr_OutReg.vhd" diff --git a/hadesstart/compile.pl b/hadesstart/compile.pl new file mode 120000 index 0000000..4456748 --- /dev/null +++ b/hadesstart/compile.pl @@ -0,0 +1 @@ +../scripts/compile.pl \ No newline at end of file diff --git a/hadesstart/compile_constraints.pl b/hadesstart/compile_constraints.pl deleted file mode 100755 index 610a599..0000000 --- a/hadesstart/compile_constraints.pl +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - -my $TOPNAME = "trb3_periph_32PinAddOn"; #Name of top-level entity - -#create full lpf file -system("cp ../base/trb3_periph_ada.lpf diamond/trb3_periph.lpf"); -system("cat currentRelease/trbnet_constraints.lpf >> diamond/trb3_periph.lpf"); -system("cat currentRelease/tdc_constraints_64.lpf >> diamond/trb3_periph.lpf"); -system("cat currentRelease/unimportant_lines_constraints.lpf >> diamond/trb3_periph.lpf"); -system("cat unimportant_lines_constraints.lpf >> diamond/trb3_periph.lpf"); diff --git a/hadesstart/compile_periph_frankfurt.pl b/hadesstart/compile_periph_frankfurt.pl deleted file mode 100755 index ed798b9..0000000 --- a/hadesstart/compile_periph_frankfurt.pl +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - - - - -################################################################################### -#Settings for this project -my $TOPNAME = "trb3_periph_hadesstart"; #Name of top-level entity -#my $lattice_path = '/d/jspc29/lattice/diamond/2.1_x64'; -#my $synplify_path = '/d/jspc29/lattice/synplify/F-2012.03-SP1/'; -my $lattice_path = '/d/jspc29/lattice/diamond/3.0_x64'; -my $synplify_path = '/d/jspc29/lattice/synplify/I-2013.09-SP1/'; -my $lm_license_file_for_synplify = "27000\@lxcad01.gsi.de"; -my $lm_license_file_for_par = "1702\@hadeb05.gsi.de"; -################################################################################### - - -$ENV{'PAR_DESIGN_NAME'}=$TOPNAME; - - -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/trb3_periph_ada.lpf workdir/$TOPNAME.lpf"); -# system("cat currentRelease/trbnet_constraints.lpf >> workdir/$TOPNAME.lpf"); -# system("cat currentRelease/tdc_constraints_4.lpf >> workdir/$TOPNAME.lpf"); -system("cp ../base/trb3_periph_ada.lpf workdir/trb3_periph.lpf"); -system("cat currentRelease/trbnet_constraints.lpf >> workdir/trb3_periph.lpf"); -system("cat currentRelease/tdc_constraints_64.lpf >> workdir/trb3_periph.lpf"); -system("cat currentRelease/unimportant_lines_constraints.lpf >> workdir/trb3_periph.lpf"); -system("cat unimportant_lines_constraints.lpf >> workdir/trb3_periph.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 -path "../" -path "." -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" -pr "$TOPNAME.prf" -o "$tpmap.ncd" -mp "$TOPNAME.mrp" "$TOPNAME.lpf"|; -execute($c); - -system("rm $TOPNAME.ncd"); - -#$c=qq|mpartrce -p "../$TOPNAME.p2t" -log "$TOPNAME.log" -o "$TOPNAME.rpt" -pr "$TOPNAME.prf" -tf "$TOPNAME.pt" "|.$TOPNAME.qq|_map.ncd" "$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"|; -$c=qq|$lattice_path/ispfpga/bin/lin/par -w -l 5 -i 6 -t 4 -c 0 -e 0 -exp parUseNBR=1:parCDP=0:parCDR=0:parPathBased=OFF $tpmap.ncd $TOPNAME.ncd $TOPNAME.prf|; -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 -g CfgMode:Disable -g RamCfg:Reset -g ES:No $TOPNAME.ncd $TOPNAME.bit $TOPNAME.prf|; -# $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/hadesstart/compile_periph_gsi.pl b/hadesstart/compile_periph_gsi.pl deleted file mode 100755 index df72594..0000000 --- a/hadesstart/compile_periph_gsi.pl +++ /dev/null @@ -1,298 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; -use FileHandle; -use Getopt::Long; - -################################################################################### -#Settings for this project -my $TOPNAME = "trb3_periph_hadesstart"; #Name of top-level entity -my $lattice_path = '/opt/lattice/diamond/3.0_x64/'; -my $lattice_bin_path = "$lattice_path/bin/lin64"; # note the lin/lin64 at the end, no isfgpa needed -my $synplify_path = '/opt/synplicity/I-2013.09-SP1'; -#my $lattice_path = '/opt/lattice/diamond/2.01/'; -#my $lattice_bin_path = "$lattice_path/bin/lin"; # note the lin/lin64 at the end, no isfgpa needed -#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 = "1702\@hadeb05.gsi.de"; -################################################################################### - -################################################################################### -#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 rung 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{'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 -system("cp ../base/trb3_periph_ada.lpf $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/tdc_constraints_64.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat currentRelease/unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -system("cat unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); - - -#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" ; - -if($syn==1 || $all==1){ - $c="$synplify_path/bin/synplify_premier_dp -batch $TOPNAME.prj"; - $r=execute($c, "do_not_exit" ); -} - -chdir $WORKDIR; - -if($syn==1 || $all==1){ - $fh = new FileHandle("<$TOPNAME".".srr"); - @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; - -if($map==1 || $all==1){ - $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; - foreach (@a) - { - if(/FC_|HitInvert|ff_en_/) - { - print "\n\n"; - print "#################################################\n"; - print "# !!!Possible Placement Errors!!! #\n"; - print "#################################################\n\n"; - - my $c="egrep 'WARNING.*hitBuf_|Channels/hit_buf_RNO|WARNING.*FC_|Channels/Channel200/SimAdderNo_FC|WARNING.*ff_en_|Channels/Channel200/ff_array_en_i_1_i'"." $TOPNAME"."_mrp.html"; - system($c); - last; - } - } -} - -if($par==1 || $all==1){ - system("rm $TOPNAME.ncd"); - #$c=qq|mpartrce -p "../$TOPNAME.p2t" -log "$TOPNAME.log" -o "$TOPNAME.rpt" -pr "$TOPNAME.prf" -tf "$TOPNAME.pt" "|.$TOPNAME.qq|_map.ncd" "$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"|; - if ($isMultiPar) - { - #$c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -stopzero -w -l 5 -t 1 -e 100 -exp parDisablePgroup=0:parUseNBR=1:parCDP=1:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - #$c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -stopzero -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parDisablePgroup=0:parUseNBR=1:parCDP=0:parCDR=0:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - $c=qq|par -m ../nodes_lxhadeb07.txt -n $nrNodes -w -l 5 -t 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; - foreach (@a) - { - my @line = split(' ', $_); - if(@line && ($line[2] =~ m/^[0-9]+$/) && ($line[3] =~ m/^[0-9]+$/)) - { - if(($line[2] == 0) && ($line[3] == 0)) - { - print "Copying $line[0].ncd file to workdir\n"; - my $c="cp $TOPNAME.dir/$line[0].ncd $TOPNAME.ncd"; - system($c); - print "\n\n"; - $isSuccess = 1; - last; - } - } - } - - if (!$isSuccess){ - print "\n\n"; - print "#################################################\n"; - print "# !!!PAR not succesfull!!! #\n"; - print "#################################################\n\n"; - exit 129; - } - } - else - { - #$c=qq|par -w -l 5 -i 6 -t 1 -c 0 -e 0 -exp parUseNBR=1:parCDP=0:parCDR=0:parPathBased=ON $tpmap.ncd $TOPNAME.dir $TOPNAME.prf|; - $c=qq|par -w -l 5 -t 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){ - # 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); - - $c=qq|ltxt2ptxt $TOPNAME.ncd|; - execute($c); - - my $c="cat $TOPNAME.par"; - system($c); - -} - -if($bitgen==1 || $all==1){ - $c=qq|bitgen -w -g CfgMode:Disable -g RamCfg:Reset -g ES:No $TOPNAME.ncd $TOPNAME.bit $TOPNAME.prf|; - # $c=qq|$lattice_path/ispfpga/bin/lin/bitgen -w "$TOPNAME.ncd" "$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 "\n\ncommand to execute: $c \n"; - $r=system($c); - if($r) { - print "$!"; - if($op ne "do_not_exit") { - exit; - } - } - return $r; -} diff --git a/hadesstart/config_compile.pl b/hadesstart/config_compile.pl new file mode 120000 index 0000000..67b86a0 --- /dev/null +++ b/hadesstart/config_compile.pl @@ -0,0 +1 @@ +config_compile_gsi.pl \ No newline at end of file diff --git a/hadesstart/config_compile_frankfurt.pl b/hadesstart/config_compile_frankfurt.pl new file mode 100644 index 0000000..d540da6 --- /dev/null +++ b/hadesstart/config_compile_frankfurt.pl @@ -0,0 +1,22 @@ +TOPNAME => "trb3sc_tdctemplate", +project_path => "../trb3sc/tdctemplate", +lm_license_file_for_synplify => "1702\@hadeb05.gsi.de", #"27000\@lxcad01.gsi.de"; +lm_license_file_for_par => "1702\@hadeb05.gsi.de", +lattice_path => '/d/jspc29/lattice/diamond/3.5_x64', +synplify_path => '/d/jspc29/lattice/synplify/J-2014.09-SP2/', +synplify_command => "/d/jspc29/lattice/diamond/3.5_x64/bin/lin64/synpwrap -fg -options", +#synplify_command => "/d/jspc29/lattice/synplify/J-2014.09-SP2/bin/synplify_premier_dp", + +nodelist_file => 'nodelist_frankfurt.txt', +par_options => '../../base/trb3_periph.p2t', + + +#Include only necessary lpf files +#pinout_file => '', #name of pin-out file, if not equal TOPNAME +include_TDC => 0, +include_GBE => 0, + +#Report settings +firefox_open => 0, +twr_number_of_errors => 20, + diff --git a/hadesstart/config_compile_gsi.pl b/hadesstart/config_compile_gsi.pl new file mode 100644 index 0000000..126542f --- /dev/null +++ b/hadesstart/config_compile_gsi.pl @@ -0,0 +1,19 @@ +TOPNAME => "trb3_periph_hadesstart", +project_path => "hadesstart", +lm_license_file_for_synplify => "27000\@lxcad01.gsi.de", +lm_license_file_for_par => "1702\@hadeb05.gsi.de", +lattice_path => '/opt/lattice/diamond/3.6_x64', +synplify_path => '/opt/synplicity/K-2015.09', +#synplify_command => "/opt/lattice/diamond/3.6_x64/bin/lin64/synpwrap -fg -options", +synplify_command => "/opt/synplicity/K-2015.09/bin/synplify_premier_dp", + +nodelist_file => '../nodes_lxhadeb07.txt', +par_options => '../../base/trb3_periph.p2t', + +#Include only necessary lpf files +include_TDC => 1, +include_GBE => 0, + +#Report settings +firefox_open => 0, +twr_number_of_errors => 20, diff --git a/hub/trb3_periph_hub.prj b/hub/trb3_periph_hub.prj index f9762eb..5ef1620 100644 --- a/hub/trb3_periph_hub.prj +++ b/hub/trb3_periph_hub.prj @@ -50,7 +50,7 @@ impl -active "workdir" #add_file options -add_file -vhdl -lib work "version.vhd" +add_file -vhdl -lib work "workdir/version.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_std.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_components.vhd" add_file -vhdl -lib work "../../trbnet/trb_net16_hub_func.vhd" diff --git a/scripts/compile.pl b/scripts/compile.pl index 69ceada..bec1874 100755 --- a/scripts/compile.pl +++ b/scripts/compile.pl @@ -5,204 +5,254 @@ use strict; use FileHandle; use Getopt::Long; use Term::ANSIColor qw(:constants); +use Cwd; +################################################################################### +#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 $con = 0; +my $guidefile = 0; +my $compile_all = 0; +my $design = ""; +my $result = GetOptions ( + "h|help" => \$help, + "m|mpar=i" => \$nrNodes, + "a|all" => \$all, + "c|con" => \$con, + "s|syn" => \$syn, + "mp|map" => \$map, + "p|par" => \$par, + "t|timing" => \$timing, + "b|bitgen" => \$bitgen, + "g|guide" => \$guidefile, + "d|design=s" => \$design, + ); + +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 "-c --con\tCompile constraints only.\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 "-g --guide\tDefine guide file for the guided placement & routing\n"; + print "-d --design\tSelect the design to compile. Overrides the TOPNAME option in config_compile.pl\n"; + print "\t\t\"-d \"\n"; + print "\n"; + exit; +} + +if ($nrNodes!=0) { + $isMultiPar=1; +} +if ($con!=0 || $syn!=0 || $map!=0 || $par!=0 || $timing!=0 || $bitgen!=0) { + $all=0; +} +################################################################################### + +################################################################################### +#Settings for this project my %config = do "config_compile.pl"; -my $TOPNAME = $config{TOPNAME}; +my $TOPNAME = $design || $config{TOPNAME}; +my $project_path = $config{project_path}; my $lattice_path = $config{lattice_path}; my $synplify_path = $config{synplify_path}; my $lm_license_file_for_synplify = $config{lm_license_file_for_synplify}; my $lm_license_file_for_par = $config{lm_license_file_for_par}; my $synplify_command = $config{synplify_command}; -my $synplify_locale_workaround = "en_US\@UTF-8"; +#my $synplify_locale_workaround = "en_US\@UTF-8"; +my $synplify_locale_workaround = "C"; my $lattice_bin_path = "$lattice_path/bin/lin64"; # note the lin/lin64 at the end, no isfgpa needed -my $nodelist_file = $config{nodelist_file}; my $include_TDC = $config{include_TDC} || 0; my $include_GBE = $config{include_GBE} || 0; my $include_CTS = $config{include_CTS} || 0; my $include_HUB = $config{include_HUB} || 0; -my $central_FPGA = $config{central_FPGA} || 0; my $twr_number_of_errors = $config{twr_number_of_errors} || 10; - - -################################################################################### -#Settings for this project - -################################################################################### - -################################################################################### -#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; -} +#my $pinout_file = $config{pinout_file} || $TOPNAME; +my $nodelist_file = $config{nodelist_file}; +my $par_options = $config{par_options}; ################################################################################### # 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; +#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; + + +my %FPGA=( + trb3_periph_32PinAddOn =>{family=>"LatticeECP3", device=>"LFE3-150EA", speed=>"8", package=>"FPBGA672", path=>"32PinAddOn"}, + trb3_periph_ADA =>{family=>"LatticeECP3", device=>"LFE3-150EA", speed=>"8", package=>"FPBGA672", path=>"ADA_Addon"}, + trb3_periph_gpin =>{family=>"LatticeECP3", device=>"LFE3-150EA", speed=>"8", package=>"FPBGA672", path=>"gpin"}, + trb3_periph_padiwa =>{family=>"LatticeECP3", device=>"LFE3-150EA", speed=>"8", package=>"FPBGA672", path=>"wasa"}, + trb3_periph_hadesstart =>{family=>"LatticeECP3", device=>"LFE3-150EA", speed=>"8", package=>"FPBGA672", path=>"hadesstart"}, + trb3_periph_hub =>{family=>"LatticeECP3", device=>"LFE3-150EA", speed=>"8", package=>"FPBGA672", path=>"hub"}, + trb3_central_cts =>{family=>"LatticeECP3", device=>"LFE3-150EA", speed=>"8", package=>"FPBGA1156", path=>"cts"}, + cbmtof =>{family=>"LatticeECP3", device=>"LFE3-150EA", speed=>"8", package=>"FPBGA672", path=>"cbmtof"}, +# trb3sc =>{family=>"LatticeECP3", device=>"LFE3-150EA", speed=>"8", package=>"FPBGA1156", path=>"../trb3sc/tdctemplate"}, +# dirich =>{family=>"ECP5UM", device=>"LFE5UM-85F", speed=>"8", package=>"BG381C", path=>"../dirich/dirich"}, + ); -my $FAMILYNAME="LatticeECP3"; -my $DEVICENAME="LFE3-150EA"; -my $SPEEDGRADE="8"; -my $PACKAGE="FPBGA672"; -if ($central_FPGA) { -$PACKAGE="FPBGA1156"; -} +compile(); -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"); - -if($include_TDC && $include_CTS==0) { - system("cat tdc_release/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); - system("cat tdc_release/tdc_constraints_64.lpf >> $WORKDIR/$TOPNAME.lpf"); - system("cat tdc_release/unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); - system("cat 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+)/; - } - } +sub compile { + unless (defined $FPGA{$TOPNAME}) { + print RED, "Project $TOPNAME is not defined. Please edit the FPGA details in the compile script.\n", RESET; + exit 129; + } + if ($design) { + $project_path = $FPGA{$TOPNAME}{path}; + } + $ENV{'PAR_DESIGN_NAME'}=$TOPNAME; + $ENV{'SYNPLIFY'}=$synplify_path; + $ENV{'LC_ALL'}=$synplify_locale_workaround; + $ENV{'SYN_DISABLE_RAINBOW_DONGLE'}=1; + $ENV{'LM_LICENSE_FILE'}=$lm_license_file_for_synplify; + $ENV{'SYNPLIFY_BINARY'}=$config{synplify_binary}; + + my $FAMILYNAME= $FPGA{$TOPNAME}{family}; + my $DEVICENAME= $FPGA{$TOPNAME}{device}; + my $SPEEDGRADE= $FPGA{$TOPNAME}{speed}; + my $PACKAGE= $FPGA{$TOPNAME}{package}; + + unless(-d "../$project_path") { + print "Project path does not exit.\n"; + exit 129; + } + chdir "../$project_path"; + my $cwd = getcwd(); + my $WORKDIR = "workdir"; + unless(-d $WORKDIR) { + mkdir $WORKDIR or die "can't create workdir '$WORKDIR': $!"; + system("cd $WORKDIR; ../../base/linkdesignfiles.sh; cd .."); + } - my @newline; - $fh = new FileHandle("<$WORKDIR/$TOPNAME".".lpf"); - @a = <$fh>; - $fh -> close; - - foreach (@a) - { + system("ln -sfT $lattice_path $WORKDIR/lattice-diamond"); + + print GREEN, "Compiling $TOPNAME project in $cwd/$WORKDIR...\n\n", RESET; + + if ($con==1 || $all==1) { + #create full lpf file + my $pinout_file = $config{pinout_file} || $TOPNAME; + print GREEN, "Generating constraints file...\n\n", RESET; + system("cp ../base/$pinout_file.lpf $WORKDIR/$TOPNAME.lpf"); + + if ($include_TDC && $include_CTS==0) { + system("cat tdc_release/trbnet_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); + system("cat tdc_release/tdc_constraints_64.lpf >> $WORKDIR/$TOPNAME.lpf"); + system("cat tdc_release/unimportant_lines_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); + system("cat 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; + my $chNumber; + + foreach (@a) { + $ringbuffersize = $1 if $_ =~ /constant\s+RING_BUFFER_SIZE\s*:.*:=\s*(\d+);/; + $chNumber = $1 if $_ =~ /constant\s+NUM_TDC_CHANNELS\s*:.*:=\s*(\d+);/; + } +# print "$ringbuffersize\n"; +# print "$chNumber\n"; + + 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; + $_ =~ 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; } - elsif ($ringbuffersize == 3 || $ringbuffersize == 7) { - $_ =~ s/Buffer_128.The_Buffer/Buffer_128.The_Buffer/g; - } - else { - print "unknown ringbuffer size... \n"; - exit 129; + + my $ch = 1; + $ch = $1 if $_ =~ /.*[]BLKNAME|PROHIBIT].*[GEN_Channels|GEN_hit_mux]\.(\d+).*/; + if ($ch >= $chNumber) { +# print "Channel $ch doesn't exist.\nold line $_"; + $_ =~ s/$_/#$_/; +# print GREEN "new line $_\n\n\n", RESET; } push(@newline,$_); + } + $fh = new FileHandle(">$WORKDIR/$TOPNAME".".lpf"); + print $fh @newline; + $fh -> close; } - $fh = new FileHandle(">$WORKDIR/$TOPNAME".".lpf"); - print $fh @newline; - $fh -> close; - -} + if ($include_GBE) { -if($include_GBE) { + } + if ($include_HUB) { + system("cat trb3_periph_hub_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); + } + } -} -if($include_HUB) { - system("cat trb3_periph_hub_constraints.lpf >> $WORKDIR/$TOPNAME.lpf"); -} + if ($include_CTS) { + my $CbmNetPath = "../../cbmnet"; + my $config_vhd = 'config_mainz_a2.vhd'; + system("ln -f -s $config_vhd config.vhd") unless (-e "config.vhd"); + system("./compile_constraints.pl"); + system("cp ../base/mulipar_nodelist_example.txt $WORKDIR/nodelist.txt") unless (-e "$WORKDIR/nodelist.txt"); + symlink($CbmNetPath, '../cbmnet/cbmnet') unless (-e '../cbmnet/cbmnet'); + } -if($include_CTS) { -my $CbmNetPath = "../../cbmnet"; -my $config_vhd = 'config_mainz_a2.vhd'; -system("ln -f -s $config_vhd config.vhd") unless (-e "config.vhd"); -system("./compile_constraints.pl"); -system("cp ../base/mulipar_nodelist_example.txt workdir/nodelist.txt") unless (-e "workdir/nodelist.txt"); -symlink($CbmNetPath, '../cbmnet/cbmnet') unless (-e '../cbmnet/cbmnet'); -} + if ($include_TDC) { + #copy delay line to project folder + system("rm $WORKDIR/Adder_304.ngo"); + system("ln -s ../../../tdc/base/cores/ecp3/TDC/Adder_304.ngo $WORKDIR/Adder_304.ngo"); + } -if($include_TDC) { - #copy delay line to project folder - system("rm $WORKDIR/Adder_304.ngo"); - system("ln -s ../../../tdc/base/cores/ecp3/TDC/Adder_304.ngo $WORKDIR/Adder_304.ngo"); -} + if ($guidefile && -f "$TOPNAME.ncd") { + system("cp $TOPNAME.ncd guidefile.ncd"); + $guidefile = " -g guidefile.ncd " + } else { + $guidefile = ""; + } -system("cd workdir; ../../base/linkdesignfiles.sh; cd .."); -#generate timestamp -my $t=time; -my $fh = new FileHandle(">version.vhd"); -die "could not open file" if (! defined $fh); -print $fh <$WORKDIR/version.vhd"); + die "could not open file" if (! defined $fh); + print $fh <close; + $fh->close; -system("env| grep LM_"); -my $r = ""; -my $c = ""; -my @a = (); -my $tpmap = $TOPNAME . "_map" ; + system("env| grep LM_"); + my $r = ""; + my $c = ""; + my @a = (); + my $tpmap = $TOPNAME . "_map" ; -chdir $WORKDIR; -if($syn==1 || $all==1){ - system("rm $TOPNAME.edf"); + 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" ); @@ -235,36 +284,32 @@ if($syn==1 || $all==1){ $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; - } - } -} - + 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; + $ENV{'LM_LICENSE_FILE'}=$lm_license_file_for_par; -if($map==1 || $all==1){ + 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); @@ -276,100 +321,83 @@ if($map==1 || $all==1){ $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++; + 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){ + 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 $nodelist_file -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 successfull!!! #\n", RESET; - print RED, "#################################################\n\n", RESET; - exit 129; + if ($isMultiPar) { + $c=qq|LC_ALL=en_US.UTF-8; par -m $nodelist_file -n $nrNodes -f $par_options $guidefile $tpmap.ncd $TOPNAME.dir $TOPNAME.prf;|; + # $c=qq|LC_ALL=en_US.UTF-8; par -m $nodelist_file -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>; + $fh -> close; + my $isSuccess = 0; + 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; + } } - } - 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.ncd $TOPNAME.prf|; - execute($c); - my $c="cp $TOPNAME.dir/5_1.ncd $TOPNAME.ncd"; - system($c); + } + + if (!$isSuccess) { + print RED, "\n\n", RESET; + print RED, "#################################################\n", RESET; + print RED, "# !!!PAR not successfull!!! #\n", RESET; + print RED, "#################################################\n\n", RESET; + exit 129; + } + } else { + $c=qq|par -f $par_options $guidefile $tpmap.ncd $TOPNAME.ncd $TOPNAME.prf|; + # $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.ncd $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){ + if ($timing==1 || $all==1) { print GREEN, "Generating timing report...\n\n", RESET; # IOR IO Timing Report @@ -379,15 +407,15 @@ if($timing==1 || $all==1){ # TWR Timing Report $c=qq|trce -c -v $twr_number_of_errors -o "$TOPNAME.twr.setup" "$TOPNAME.ncd" "$TOPNAME.prf"|; execute($c); - + $c=qq|trce -hld -c -v $twr_number_of_errors -o "$TOPNAME.twr.hold" "$TOPNAME.ncd" "$TOPNAME.prf"|; execute($c); my $c="cat $TOPNAME.par"; system($c); -} + } -if($bitgen==1 || $all==1){ + if ($bitgen==1 || $all==1) { print GREEN, "Generating bit file...\n\n", RESET; $c=qq|ltxt2ptxt $TOPNAME.ncd|; @@ -395,30 +423,31 @@ if($bitgen==1 || $all==1){ $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); + } -if($config{firefox_open}) { - $c=qq|firefox $TOPNAME.html|; + $c=qq|htmlrpt -mrp $TOPNAME.mrp -mtwr $TOPNAME.twr.hold -ptwr $TOPNAME.twr.setup $TOPNAME|; execute($c); -} -chdir ".."; -exit; + if ($config{firefox_open}) { + $c=qq|firefox $TOPNAME.html|; + execute($c); + } + + chdir ".."; +} 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; - } + my ($c, $op) = @_; + #print "option: $op \n"; + $op = "" if(!$op); + $c = ". $lattice_bin_path/diamond_env; " . $c; + print GREEN, "\n\ncommand to execute: $c \n", RESET; + my $r=system($c); + if ($r) { + print "$!"; + if ($op ne "do_not_exit") { + exit; } - return $r; + } + return $r; } diff --git a/scripts/compile_parallel.pl b/scripts/compile_parallel.pl new file mode 100755 index 0000000..2e5f88e --- /dev/null +++ b/scripts/compile_parallel.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Cwd; + +my @compile_list = ("trb3_periph_32PinAddOn", "trb3_periph_ADA", "trb3_periph_gpin", "trb3_periph_padiwa", +# "trb3_periph_hadesstart", "cbmtof", "trb3sc", "dirich", +# "trb3_periph_hub", "trb3_central_cts", + ); +my $cwd = getcwd(); + +for my $i (0 .. $#compile_list) { + my $design = $compile_list[$i]; + my $tab = $i+1; + print "\033]777;tabbedex;new_tab\007"; + sleep 0.1; + print "\033]777;tabbedex;make_current;$tab\007"; + print "\033]777;tabbedex;set_tab_name;$design\007"; + print "\033]777;tabbedex;interactive_command;cd $cwd\007"; + print "\033]777;tabbedex;interactive_command;./compile.pl -d $design\007"; + sleep 1; +} diff --git a/scripts/config_compile.pl b/scripts/config_compile.pl new file mode 120000 index 0000000..67b86a0 --- /dev/null +++ b/scripts/config_compile.pl @@ -0,0 +1 @@ +config_compile_gsi.pl \ No newline at end of file diff --git a/scripts/config_compile_frankfurt.pl b/scripts/config_compile_frankfurt.pl new file mode 100644 index 0000000..d540da6 --- /dev/null +++ b/scripts/config_compile_frankfurt.pl @@ -0,0 +1,22 @@ +TOPNAME => "trb3sc_tdctemplate", +project_path => "../trb3sc/tdctemplate", +lm_license_file_for_synplify => "1702\@hadeb05.gsi.de", #"27000\@lxcad01.gsi.de"; +lm_license_file_for_par => "1702\@hadeb05.gsi.de", +lattice_path => '/d/jspc29/lattice/diamond/3.5_x64', +synplify_path => '/d/jspc29/lattice/synplify/J-2014.09-SP2/', +synplify_command => "/d/jspc29/lattice/diamond/3.5_x64/bin/lin64/synpwrap -fg -options", +#synplify_command => "/d/jspc29/lattice/synplify/J-2014.09-SP2/bin/synplify_premier_dp", + +nodelist_file => 'nodelist_frankfurt.txt', +par_options => '../../base/trb3_periph.p2t', + + +#Include only necessary lpf files +#pinout_file => '', #name of pin-out file, if not equal TOPNAME +include_TDC => 0, +include_GBE => 0, + +#Report settings +firefox_open => 0, +twr_number_of_errors => 20, + diff --git a/scripts/config_compile_gsi.pl b/scripts/config_compile_gsi.pl new file mode 100644 index 0000000..c5e7654 --- /dev/null +++ b/scripts/config_compile_gsi.pl @@ -0,0 +1,19 @@ +TOPNAME => "trb3_periph_32PinAddOn", +project_path => "32PinAddOn", +lm_license_file_for_synplify => "27000\@lxcad01.gsi.de", +lm_license_file_for_par => "1702\@hadeb05.gsi.de", +lattice_path => '/opt/lattice/diamond/3.6_x64', +synplify_path => '/opt/synplicity/K-2015.09', +#synplify_command => "/opt/lattice/diamond/3.6_x64/bin/lin64/synpwrap -fg -options", +synplify_command => "/opt/synplicity/K-2015.09/bin/synplify_premier_dp", + +nodelist_file => '../nodes_lxhadeb07.txt', +par_options => '../../base/trb3_periph.p2t', + +#Include only necessary lpf files +include_TDC => 1, +include_GBE => 0, + +#Report settings +firefox_open => 0, +twr_number_of_errors => 20, diff --git a/wasa/compile_constraints_frankfurt.pl b/wasa/compile_constraints_frankfurt.pl deleted file mode 100755 index b3cec8c..0000000 --- a/wasa/compile_constraints_frankfurt.pl +++ /dev/null @@ -1,19 +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 workdir/$TOPNAME.lpf"); -system("cat tdc_release/trbnet_constraints.lpf >> workdir/$TOPNAME.lpf"); -system("cat tdc_release/tdc_constraints_4.lpf >> workdir/$TOPNAME.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_padiwa_frankfurt.pl b/wasa/compile_padiwa_frankfurt.pl deleted file mode 100755 index a417c27..0000000 --- a/wasa/compile_padiwa_frankfurt.pl +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/perl -use Data::Dumper; -use warnings; -use strict; - - - - -################################################################################### -#Settings for this project -my $TOPNAME = "trb3_periph_padiwa"; #Name of top-level entity -my $lattice_path = '/d/jspc29/lattice/diamond/2.1_x64'; -my $synplify_path = '/d/jspc29/lattice/synplify/G-2012.09-SP1/'; -my $lm_license_file_for_synplify = "27000\@lxcad01.gsi.de"; -#my $lm_license_file_for_par = "1702\@hadeb05.gsi.de"; -my $lm_license_file_for_par = "1710\@cronos.e12.physik.tu-muenchen.de"; -################################################################################### - -$ENV{'PAR_DESIGN_NAME'}=$TOPNAME; - - - - - - -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 ../tdc_releases/tdc_v1.1.1/tdc_constraints.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 -path "../" -path "." -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" -pr "$TOPNAME.prf" -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"|; -$c=qq|$lattice_path/ispfpga/bin/lin/par -f "../$TOPNAME.p2t" "$tpmap.ncd" "$TOPNAME.ncd" "$TOPNAME.prf"|; -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 -g CfgMode:Disable -g RamCfg:Reset -g ES:No $TOPNAME.ncd $TOPNAME.bit $TOPNAME.prf|; -# $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/trb3_periph_padiwa.prj b/wasa/trb3_periph_padiwa.prj index f1216d6..ee0f0df 100644 --- a/wasa/trb3_periph_padiwa.prj +++ b/wasa/trb3_periph_padiwa.prj @@ -51,7 +51,7 @@ impl -active "workdir" #add_file options -add_file -vhdl -lib work "version.vhd" +add_file -vhdl -lib work "workdir/version.vhd" add_file -vhdl -lib work "config.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_std.vhd" add_file -vhdl -lib work "../../trbnet/trb_net_components.vhd" -- 2.43.0