use Term::ANSIColor;
use File::stat;
use POSIX;
+use Cwd 'abs_path';
###################################################################################
my $synplify_path = '/d/jspc29/lattice/synplify/I-2013.09-SP1/';
###################################################################################
+
system("./compile_constraints.pl");
symlink($CbmNetPath, '../cbmnet/cbmnet') unless (-e '../cbmnet/cbmnet');
use FileHandle;
+my $absBasePath = abs_path($BasePath);
+
$ENV{'SYNPLIFY'}=$synplify_path;
$ENV{'SYN_DISABLE_RAINBOW_DONGLE'}=1;
$ENV{'LM_LICENSE_FILE'}=$lm_license_file_for_synplify;
my $c="$synplify_path/bin/synplify_premier_dp -batch $TOPNAME.prj";
$r=execute($c, "do_not_exit" );
-
chdir "workdir";
$fh = new FileHandle("<$TOPNAME".".srr");
$c=qq|$lattice_path/ispfpga/bin/lin/iotiming -s "$TOPNAME.ncd" "$TOPNAME.prf"|;
execute($c);
-$c=qq|$lattice_path/ispfpga/bin/lin/bitgen -w "$TOPNAME.ncd" "$TOPNAME.prf"|;
+$c=qq|$lattice_path/ispfpga/bin/lin/ltxt2ptxt $TOPNAME.ncd|;
execute($c);
-$c=qq|$lattice_path/ispfpga/bin/lin/ltxt2ptxt $TOPNAME.ncd|;
+$c=qq|$lattice_path/ispfpga/bin/lin/bitgen -w "$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"|;
+$c=qq|$lattice_path/ispfpga/bin/lin/trce -fullname -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/lin/trce -fullname -hld -c -v 5 -o "$TOPNAME.twr.hold" "$TOPNAME.ncd" "$TOPNAME.prf"|;
execute($c);
print color 'blue bold';
print "\n\ncommand to execute: $c \n";
print color 'reset';
- $r=system($c);
+ $r=system("$c | $absBasePath/pretty_syn.pl");
if($r) {
print "$!";
if($op ne "do_not_exit") {
# get activated modules
+my %configSettings = ();
open(CONFIG, 'config.vhd');
my $config = "#!!! This file was compiled using compile_contraints.pl.\n#!!! DO NOT EDIT AS ALL CHANGES WILL BE OVERRIDEN\n\n";
print "The following module configuration was derived from config.vhd:\n";
if ($line =~ /(INCLUDE_\S+).*:=.*c_(yes|no)/i) {
my $mod = uc $1;
my $ena = (lc $2) eq 'yes' ? 1 : 0;
+ $configSettings{$mod} = $ena;
my $conf = "set $mod $ena\n";
print ' ' . $conf;
chdir($workdir);
system ("$back/../../base/linkdesignfiles.sh '$back'");
symlink "$back/../../base/cores/cbmnet_sfp1.txt", 'cbmnet_sfp1.txt';
+symlink "$back/../tdc_release/Adder_304.ngo", "Adder_304.ngo";
chdir($script_dir);
-system ("ln -sfT $back/../tdc_release/Adder_304.ngo $workdir/Adder_304.ngo");
-
system("cp ../base/trb3_central_cts.lpf $workdir/$TOPNAME.lpf");
-# system("cat tdc_release/tdc_constraints_4.lpf >> $workdir/$TOPNAME.lpf");
+system("cat tdc_release/tdc_constraints_4.lpf >> $workdir/$TOPNAME.lpf") if $configSettings{'INCLUDE_TDC'};
system("cat ".$TOPNAME."_constraints.lpf >> $workdir/$TOPNAME.lpf");
-system("sed -i 's#THE_TDC/#gen_TDC_THE_TDC/#g' $workdir/$TOPNAME.lpf");
+system("sed -i 's#THE_TDC/#gen_TDC.THE_TDC/#g' $workdir/$TOPNAME.lpf");
constant USE_125_MHZ : integer range c_NO to c_YES := c_NO;
--Run external 200 MHz clock source
- constant USE_EXTERNAL_CLOCK : integer range c_NO to c_YES := c_NO;
+ constant USE_EXTERNAL_CLOCK : integer range c_NO to c_YES := c_YES;
--Which external trigger module (ETM) to use?
set_option -part_companion ""
# compilation/mapping options
-set_option -default_enum_encoding sequential
+#set_option -default_enum_encoding sequential
set_option -symbolic_fsm_compiler 1
set_option -top_module "trb3_central"
-set_option -resource_sharing true
+#set_option -resource_sharing true
# Lattice XP
set_option -maxfan 100
set_option -fix_gated_and_generated_clocks 1
-#set_option -RWCheckOnRam 1
-#set_option -update_models_cp 0
+set_option -RWCheckOnRam 1
+set_option -update_models_cp 0
set_option -syn_edif_array_rename 1
# map options
set_option -frequency 200
-set_option -fanout_limit 100
+set_option -fanout_limit 1000
set_option -disable_io_insertion 0
set_option -force_gsr false
-set_option -fixgatedclocks 3
-set_option -fixgeneratedclocks 3
set_option -compiler_compatible true
+set_option -retiming 0
+set_option -pipe 1
set_option -max_parallel_jobs 3
#set_option -automatic_compile_point 1
);
-- TODO: just borrowed from CTS ... !
- JOUT2 <= "000" & cbm_dlm_ref_rec_va_i;
+ JOUT2 <= cbm_data2send_stop_i & cbm_link_active_i & cbm_clk_i & cbm_dlm_ref_rec_va_i;
THE_CBMNET_READOUT: cbmnet_readout
port map(
-- Test Connector
---------------------------------------------------------------------------
- TEST_LINE(15 downto 0) <= tdc_debug;
- TEST_LINE(16) <= CLK_EXT(3); --this prevents adding an input register in the CBM MBS input module
- TEST_LINE(31 downto 17) <= (others => '0');
+ TEST_LINE(17 downto 0) <= cbm_data_from_link_i;
+ TEST_LINE(31 downto 18) <= cbm_data2link_i(13 downto 0);
end architecture;
\ No newline at end of file
-trb3_central_constraints_3.lpf
\ No newline at end of file
+trb3_central_constraints_2.lpf
\ No newline at end of file