use warnings;
use strict;
-my $lattice_path = '/d/sugar/lattice/ispLEVER8.0/isptools/';
-#my $synplify_path = '/d/sugar/lattice/synplify/syn96L3/synplify_linux/';
-my $synplify_path = '/d/sugar/lattice/synplify/D-2010.03/';
+#my $lattice_path = '/d/jspc29/lattice/ispLEVER8.1/isptools/';
+#my $synplify_path = '/d/jspc29/lattice/synplify/D-2010.03/';
+#my $lattice_path = '/d/jspc29/lattice/diamond/3.6_x64';
+#my $synplify_path = '/d/jspc29/lattice/synplify/K-2015.09/';
+my $lattice_path = '/d/jspc29/lattice/diamond/3.9_x64';
+my $synplify_path = '/d/jspc29/lattice/synplify/M-2017.03/';
use FileHandle;
$ENV{'SYNPLIFY'}=$synplify_path;
$ENV{'SYN_DISABLE_RAINBOW_DONGLE'}=1;
-$ENV{'LM_LICENSE_FILE'}="27000\@localhost";
+$ENV{'LM_LICENSE_FILE'}="27020\@jspc29";
my $TOPNAME="cts_fpga1";
#create full lpf file
-system("cp ../trbnet/pinout/$TOPNAME.lpf workdir/$TOPNAME.lpf");
+system("cp $TOPNAME.lpf workdir/$TOPNAME.lpf");
system("cat constraints_$TOPNAME.lpf >> workdir/$TOPNAME.lpf");
#set -e
}
#if (0){
-$ENV{'LM_LICENSE_FILE'}="1710\@cronos.e12.physik.tu-muenchen.de";
+$ENV{'LM_LICENSE_FILE'}="1702\@hadeb05.gsi.de";
-$c=qq| $lattice_path/ispfpga/bin/lin/edif2ngd -l $FAMILYNAME -d $DEVICENAME "$TOPNAME.edf" "$TOPNAME.ngo" |;
+$c=qq| $lattice_path/ispfpga/bin/lin64/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"|;
+$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/lin/ngdbuild -a $FAMILYNAME -d $DEVICENAME -p "$lattice_path/ispfpga/or5s00/data" -dt "$TOPNAME.ngo" "$TOPNAME.ngd"|;
+$c=qq|$lattice_path/ispfpga/bin/lin64/ngdbuild -a $FAMILYNAME -d $DEVICENAME -p "$lattice_path/ispfpga/or5s00/data" -dt "$TOPNAME.ngo" "$TOPNAME.ngd"|;
execute($c);
my $tpmap = $TOPNAME . "_map" ;
-$c=qq|$lattice_path/ispfpga/bin/lin/map -retime -split_node -a $FAMILYNAME -p $DEVICENAME -t $PACKAGE -s $SPEEDGRADE "$TOPNAME.ngd" -o "$tpmap.ncd" -mp "$TOPNAME.mrp" "$TOPNAME.lpf"|;
+$c=qq|$lattice_path/ispfpga/bin/lin64/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/par -w -y -l 4 -i 15 "$tpmap.ncd" "$TOPNAME.ncd" "$TOPNAME.prf" |;
#$c=qq|$lattice_path/ispfpga/bin/lin/par -f $TOPNAME.p2t "$tpmap.ncd" "$TOPNAME.ncd" "$TOPNAME.prf" |;
-$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 -pr "$TOPNAME.prf" -o "mpar_$TOPNAME.rpt" -log "mpar_$TOPNAME.log" -p "../$TOPNAME.p2t" "$tpmap.ncd" "$TOPNAME.ncd"|;
+$c=qq|LC_ALL=en_US.UTF-8; par -f "../$TOPNAME.p2t" $tpmap.ncd $TOPNAME.dir $TOPNAME.prf;|;
execute($c);
# IOR IO Timing Report
-$c=qq|$lattice_path/ispfpga/bin/lin/iotiming -s "$TOPNAME.ncd" "$TOPNAME.prf"|;
+$c=qq|$lattice_path/ispfpga/bin/lin64/iotiming -s "$TOPNAME.ncd" "$TOPNAME.prf"|;
execute($c);
# TWR Timing Report
#$c=qq|$lattice_path/ispfpga/bin/lin/tg "$TOPNAME.ncd" "$TOPNAME.prf"|;
-$c=qq|$lattice_path/ispfpga/bin/lin/trce -c -v 15 -o "$TOPNAME.twr.setup" "$TOPNAME.ncd" "$TOPNAME.prf"|;
+$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/lin/trce -hld -c -v 5 -o "$TOPNAME.twr.hold" "$TOPNAME.ncd" "$TOPNAME.prf"|;
+$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/lin/bitgen -w "$TOPNAME.ncd" -f "$TOPNAME.t2b" "$TOPNAME.prf"|;
+$c=qq|$lattice_path/ispfpga/bin/lin64/bitgen -w "$TOPNAME.ncd" -f "$TOPNAME.t2b" "$TOPNAME.prf"|;
execute($c);
chdir "..";
use warnings;
use strict;
-my $lattice_path = '/d/sugar/lattice/ispLEVER8.1/isptools/';
+#my $lattice_path = '/d/sugar/lattice/ispLEVER8.1/isptools/';
#my $synplify_path = '/d/sugar/lattice/synplify/syn96L3/synplify_linux/';
-my $synplify_path = '/d/sugar/lattice/synplify/D-2010.03/';
+#my $synplify_path = '/d/sugar/lattice/synplify/D-2010.03/';
+my $lattice_path = '/d/jspc29/lattice/diamond/3.6_x64';
+my $synplify_path = '/d/jspc29/lattice/synplify/K-2015.09/';
+
use FileHandle;
$ENV{'SYNPLIFY'}=$synplify_path;
$ENV{'SYN_DISABLE_RAINBOW_DONGLE'}=1;
-$ENV{'LM_LICENSE_FILE'}="27000\@localhost";
+$ENV{'LM_LICENSE_FILE'}="27020\@jspc29";
my $TOPNAME="cts_fpga2";
#create full lpf file
-system("cp ../trbnet/pinout/$TOPNAME.lpf workdir/$TOPNAME.lpf");
+system("cp $TOPNAME.lpf workdir/$TOPNAME.lpf");
system("cat constraints_$TOPNAME.lpf >> workdir/$TOPNAME.lpf");
#set -e
}
#if (0){
-$ENV{'LM_LICENSE_FILE'}="1710\@cronos.e12.physik.tu-muenchen.de";
+$ENV{'LM_LICENSE_FILE'}="1702\@hadeb05.gsi.de";
-$c=qq| $lattice_path/ispfpga/bin/lin/edif2ngd -l $FAMILYNAME -d $DEVICENAME "$TOPNAME.edf" "$TOPNAME.ngo" |;
+$c=qq| $lattice_path/ispfpga/bin/lin64/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"|;
+$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/lin/ngdbuild -a $FAMILYNAME -d $DEVICENAME -p "$lattice_path/ispfpga/or5s00/data" -dt "$TOPNAME.ngo" "$TOPNAME.ngd"|;
+$c=qq|$lattice_path/ispfpga/bin/lin64/ngdbuild -a $FAMILYNAME -d $DEVICENAME -p "$lattice_path/ispfpga/or5s00/data" -dt "$TOPNAME.ngo" "$TOPNAME.ngd"|;
execute($c);
my $tpmap = $TOPNAME . "_map" ;
-$c=qq|$lattice_path/ispfpga/bin/lin/map -retime -split_node -a $FAMILYNAME -p $DEVICENAME -t $PACKAGE -s $SPEEDGRADE "$TOPNAME.ngd" -o "$tpmap.ncd" -mp "$TOPNAME.mrp" "$TOPNAME.lpf"|;
+$c=qq|$lattice_path/ispfpga/bin/lin64/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/par -w -y -l 4 -i 15 "$tpmap.ncd" "$TOPNAME.ncd" "$TOPNAME.prf" |;
#$c=qq|$lattice_path/ispfpga/bin/lin/par -f $TOPNAME.p2t "$tpmap.ncd" "$TOPNAME.ncd" "$TOPNAME.prf" |;
-$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/multipar -pr "$TOPNAME.prf" -o "mpar_$TOPNAME.rpt" -log "mpar_$TOPNAME.log" -p "../$TOPNAME.p2t" "$tpmap.ncd" "$TOPNAME.ncd"|;
+$c=qq|LC_ALL=en_US.UTF-8; par -f "../$TOPNAME.p2t" $tpmap.ncd $TOPNAME.dir $TOPNAME.prf;|;
execute($c);
# IOR IO Timing Report
-$c=qq|$lattice_path/ispfpga/bin/lin/iotiming -s "$TOPNAME.ncd" "$TOPNAME.prf"|;
+$c=qq|$lattice_path/ispfpga/bin/lin64/iotiming -s "$TOPNAME.ncd" "$TOPNAME.prf"|;
execute($c);
# TWR Timing Report
#$c=qq|$lattice_path/ispfpga/bin/lin/tg "$TOPNAME.ncd" "$TOPNAME.prf"|;
-$c=qq|$lattice_path/ispfpga/bin/lin/trce -c -v 15 -o "$TOPNAME.twr.setup" "$TOPNAME.ncd" "$TOPNAME.prf"|;
+$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/lin/trce -hld -c -v 5 -o "$TOPNAME.twr.hold" "$TOPNAME.ncd" "$TOPNAME.prf"|;
+$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/lin/bitgen -w "$TOPNAME.ncd" -f "$TOPNAME.t2b" "$TOPNAME.prf"|;
+$c=qq|$lattice_path/ispfpga/bin/lin64/bitgen -w "$TOPNAME.ncd" -f "$TOPNAME.t2b" "$TOPNAME.prf"|;
execute($c);
chdir "..";
#########################################
FREQUENCY PORT CLK_200_IN 200.000000 MHz HOLD_MARGIN 0.100000 nS ;
-
-
-
+MULTICYCLE FROM CELL "reset_i_100*" 20 ns;
+MULTICYCLE FROM CLKNET "clk_100" TO CLKNET "THE_DDR2_BUSSES/ddr_div_out_clk[0]" 20 ns;
BLOCK ASYNCPATHS ;
IOBUF ALLPORTS IO_TYPE=LVTTL33 PULLMODE=DOWN ;
+IOBUF ALLPORTS SLEWRATE="FAST";
#################################################################
# SPI CLK
#################################################################
-SYSCONFIG MCCLK_FREQ = 20;
+SYSCONFIG MCCLK_FREQ = 33;
+
#################################################################
# Clock I/O
IOBUF PORT "ADO_CLKOUT" IO_TYPE=LVDS ;
IOBUF PORT "CLK_200_IN" IO_TYPE=LVDS ;
-FREQUENCY PORT CLK_200_IN 200.000000 MHz;
+#FREQUENCY PORT CLK_200_IN 200.000000 MHz;
-#USE PRIMARY NET "";
#################################################################
# Reset
#################################################################
# DLL for edge clokcs
#################################################################
-LOCATE COMP "the_ddr2_buses/MAKE_DDR_CONNECTIONS_0_DLL_EDGE_INJECTION_COMPENSATE" SITE "DLL_URCC";
+LOCATE COMP "THE_DDR2_BUSSES/MAKE_DDR_CONNECTIONS.0.DLL_EDGE_INJECTION_COMPENSATE" SITE "DLL_URCC";
+LOCATE COMP "THE_DDR2_BUSSES/MAKE_DDR_CONNECTIONS.1.DLL_EDGE_INJECTION_COMPENSATE" SITE "DLL_LRCD";
+LOCATE COMP "THE_DDR2_BUSSES/MAKE_DDR_CONNECTIONS.2.DLL_EDGE_INJECTION_COMPENSATE" SITE "DLL_LLCE";
+LOCATE COMP "THE_DDR2_BUSSES/MAKE_DDR_CONNECTIONS.3.DLL_EDGE_INJECTION_COMPENSATE" SITE "DLL_ULCC";
+
#################################################################
# To TRB
#################################################################
DEFINE PORT GROUP "FFC_group" "FFC*" ;
IOBUF GROUP "FFC_group" IO_TYPE=LVCMOS25 PULLMODE=DOWN DRIVE=16;
-IOBUF PORT "ONEWIRE_MONITOR_IN" IO_TYPE=LVCMOS25 PULLMODE=UP ;
+#IOBUF PORT "ONEWIRE_MONITOR_IN" IO_TYPE=LVCMOS25 PULLMODE=UP ;
#################################################################
# Display / LED
#LOCATE COMP "LVDS_OUT_15" SITE "AB32";
LOCATE COMP "LVDS_IN" SITE "AB32";
-IOBUF PORT "LVDS_IN" IO_TYPE=LVDS25;
+IOBUF PORT "LVDS_IN" IO_TYPE=LVDS;
DEFINE PORT GROUP "LVDS_group" "LVDS*" ;
IOBUF GROUP "LVDS_group" IO_TYPE=LVDS;
+DEFINE PORT GROUP "LVDS_group2" "buf_Q*" ;
+IOBUF GROUP "LVDS_group2" IO_TYPE=LVDS;
+
LOCATE COMP "PECL_OUT_0" SITE "M4";
LOCATE COMP "PECL_OUT_1" SITE "M3";
LOCATE COMP "PECL_OUT_2" SITE "L2";
LOCATE COMP "TRIG_IN_63" SITE "K25";
DEFINE PORT GROUP "TRIG_group" "TRIG*" ;
IOBUF GROUP "TRIG_group" IO_TYPE=LVDS;
-INPUT "TRIG_group" SETUP 1 ns CLKPORT="clk_400"
+
#################################################################
# Pins not needed in lpf
#################################################################
-n 1
-y
-s 12
--t 1
+-t 3
-c 1
-e 2
#-m nodelist.txt