From 3e4134f9f73bed39920f785957d30d88770f5ca4 Mon Sep 17 00:00:00 2001 From: hadaq Date: Mon, 5 Jul 2010 13:28:40 +0000 Subject: [PATCH] *** empty log message *** --- compile_munich.pl | 198 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100755 compile_munich.pl diff --git a/compile_munich.pl b/compile_munich.pl new file mode 100755 index 0000000..7243ef6 --- /dev/null +++ b/compile_munich.pl @@ -0,0 +1,198 @@ +#!/usr/bin/perl +########################################### +# Script file to run the flow +########################################### + +# You need the tunnels before! + +use Data::Dumper; +use warnings; +use strict; + +# Path settings for ispLEVER tools +my $lattice_path = '/usr/local/opt/synplify/8/isptools'; + +# Path settings for SynplifyPRO +my $synplify_path = '/usr/local/opt/synplify/premier'; + +use FileHandle; + +$ENV{'SYNPLIFY'}=$synplify_path; +$ENV{'SYN_DISABLE_RAINBOW_DONGLE'}=1; +$ENV{'LM_LICENSE_FILE'}="27000\@localhost"; + +# Design top level entity +my $TOPNAME="cts_fpga1"; + +# FPGA chip description +my $FAMILYNAME="LatticeSCM"; +my $DEVICENAME="LFSCM3GA40EP1"; +my $PACKAGE="FFBGA1020"; +my $SPEEDGRADE="7"; + +# benchmarking +my $CTIME_String = localtime(time); +print "Script started: $CTIME_String\n"; +system("echo $CTIME_String > workdir/benchmark.txt"); + +# Create full lpf file +system("cp ../trbnet/pinout/$TOPNAME.lpf workdir/$TOPNAME.lpf"); +system("cat constraints_$TOPNAME.lpf >> workdir/$TOPNAME.lpf"); + +# Generate timestamp for slowcontrol readback +my $t=time; +my $fh = new FileHandle(">version.vhd"); +die "could not open file" if (! defined $fh); +print $fh <close; + +# Run Synplify on the design +system("env| grep LM_"); +my $r = ""; +my $c="$synplify_path/bin/synplify_premier_dp -batch $TOPNAME".".prj"; +$r=execute($c, "do_not_exit" ); + +# Check for errors +chdir "workdir"; +$fh = new FileHandle("<$TOPNAME".".srr"); +my @a = <$fh>; +$fh -> close; + +foreach (@a) +{ + if(/\@E:/) + { + $c="cat $TOPNAME.srr"; + system($c); + print "ERROR_ERROR_ERROR_ERROR_ERROR\n"; + exit 129; + } +} + +# ispLEVER design flow starts here +# new license file must be given +$ENV{'LM_LICENSE_FILE'}="1710\@cronos.e12.physik.tu-muenchen.de"; + +# EDIF2NGD +$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); + +# NGDBUILD +$c=qq|$lattice_path/ispfpga/bin/lin/ngdbuild -a $FAMILYNAME -d $DEVICENAME -p "$lattice_path/ispfpga/or5s00/data" -dt "$TOPNAME.ngo" "$TOPNAME.ngd"|; +execute($c); + +# MAP +my $tpmap = $TOPNAME . "_map" ; +$c=qq|$lattice_path/ispfpga/bin/lin/map -noinferGSR -a $FAMILYNAME -p $DEVICENAME -t $PACKAGE -s $SPEEDGRADE "$TOPNAME.ngd" -o "$tpmap.ncd" -mp "$TOPNAME.mrp" "$TOPNAME.lpf" -tdm -td_pack|; +execute($c); + +system("rm $TOPNAME.ncd"); + +# MULTIPAR + +my $fh2 = new FileHandle(">$TOPNAME.p2t"); +die "could not open file" if (! defined $fh2); +print $fh2 <close; + +###################################################################### +# -w # overwrite files +# -i 15 # maximum number of routing attempts +# -l 5 # effort level (1-5) +# -n 1 # starting cost table (n=0 loop) +# -y # delay summary report +# -s 12 # number of best results to save +# -t 1 # start placement with cost table X +# -c 1 # number of cost-based cleanup passes of the router +# -e 2 # number of delay-based cleanup passes of the router +# -m nodelist.txt # +# -exp parCDP=1 # +# -exp parCDR=1 # +# -exp parPlcInLimit=0 # +# -exp parPlcInNeighborSize=1 # +# -exp parPathBased=ON # +# -exp parHold=ON # +# -exp parHoldLimit=10000 # +# -exp paruseNBR=1 # +###################################################################### + +# real multipar +$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 (setup) +$c=qq|$lattice_path/ispfpga/bin/lin/trce -c -v 15 -o "$TOPNAME.twr.setup" "$TOPNAME.ncd" "$TOPNAME.prf"|; +execute($c); + +# TWR Timing Report (hold) +$c=qq|$lattice_path/ispfpga/bin/lin/trce -hld -c -v 5 -o "$TOPNAME.twr.hold" "$TOPNAME.ncd" "$TOPNAME.prf"|; +execute($c); + +# BitGen +#$c=qq|$lattice_path/ispfpga/bin/lin/bitgen -w "$TOPNAME.ncd" -f "$TOPNAME.t2b" "$TOPNAME.prf"|; +$c=qq|$lattice_path/ispfpga/bin/lin/bitgen -w "$TOPNAME.ncd" "$TOPNAME.prf"|; +execute($c); + +chdir ".."; + +$CTIME_String = localtime(time); +print "Script ended: $CTIME_String\n"; +system("echo $CTIME_String >> workdir/benchmark.txt"); + +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; + +} -- 2.43.0