#######################################################################
#######################################################################
$SIG{__DIE__} = \&sighandler ;
#######################################################################
#######################################################################
my $device = "XC4VLX200";
$blk_list = $ENV{DV_ROOT};
$blk_list .= "/design/sys/synplicity/block.list";
#######################################################################
# Check command line options
#######################################################################
} elsif (($argv =~ /-h/) or ($argv =~ /-help/))
} elsif ($argv =~ /-syn_q_command/)
$syn_q =~ s/-syn_q_command=(.*)/$1/ ;
} elsif ($argv =~ /-device/)
$device =~ s/-device=(.*)/$1/ ;
} elsif ($argv =~ /-flat/) {
open (BLK_IN, "< $blk_list") or die ("DIE. could not open $blk_list");
push @block_list, $line ;
print "$prg: Running Synplicity for all $count modules\n";
my @all_blocks = <BLK_IN>;
foreach my $block (@blocks)
my (@search) = grep (/$block/, @all_blocks);
foreach my $line (@search)
push @block_list, $line ;
print "$prg: Running Synplicity for $count modules\n";
print "$prg: No matching modules found.\n";
# check the memory list and add memory to block list if needed
foreach my $block (@block_list) {
$blk_dir = $ENV{DV_ROOT};
$blk_dir .= "/design/sys/iop/$block";
$blk_dir .= "/synplicity";
if ((!$flat) && ( -f $mlist )) {
print "$prg: $mlist found.\n";
open (BLK_IN, "< $mlist") or
die("DIE. could not open $mlist");
my $sub_blk = $ENV{DV_ROOT};
$sub_blk .= "/design/sys/iop/$line";
$sub_blk .= "/synplicity";
my $sub_blk_mod = $sub_blk;
$sub_blk_mod .= "/$device/$line_mod";
print "$prg: Pre-compiled $line found.\n";
my $cmd = "rsynp -device='$device' ";
print "$prg: Pre-compiled $line not found.\n";
print "$prg: Running $cmd\n";
foreach my $block (@block_list) {
print "$prg: Running Synplicity for $block\n";
$blk_dir = $ENV{DV_ROOT};
$blk_dir .= "/design/sys/iop/$block";
$blk_dir .= "/synplicity";
&create_prj_file($mod_name);
print "$prg: module name $mod_name\n";
$cmd .= " $ENV{DV_ROOT}/tools/bin/synp_command";
# if ed script exists, run it
$cmd .= "$device/$mod_name";
$cmd .= ".vm < $sed_scr";
print "$prg: Running script: $cmd\n";
#######################################################################
open (FLIST_IN, "< $flist") or die ("DIE. could not open $flist");
print OUT "# Synplicity Project File\n\n";
print OUT "set topmodule $mod\n";
print OUT "set rev $device\n";
print OUT "set dv_root [get_env DV_ROOT]\n\n";
print OUT "add_file -verilog \$dv_root/";
print OUT "add_file -verilog \$dv_root/";
open (FLIST_IN, "< $fmlist") or die ("DIE. could not open $fmlist");
print OUT "add_file -verilog \$dv_root/";
print OUT "add_file -verilog \$dv_root/";
print "$prg: $mlist found.\n";
open (BLK_IN, "< $mlist") or
die("DIE. could not open $mlist");
my $sub_blk = $ENV{DV_ROOT};
$sub_blk .= "/design/sys/iop/$line";
$sub_blk .= "/synplicity";
my $sub_blk_mod = $sub_blk;
$sub_blk_mod .= "/$device/$line_mod";
print OUT "add_file -verilog $sub_blk_mod\n";
print OUT "\nsource \$dv_root/design/sys/synplicity/env.prj\n";
print OUT "source \$dv_root/design/sys/synplicity/$device.prj\n";
print OUT "source $prj_file\n";
print OUT "source \$dv_root/design/sys/synplicity/pre_syn_settings.prj\n";
#######################################################################
print "\n$prg : Run Synplicity for OpenSPARC T1\n\n";
print " -all \n\tto run Synplicity for all blocks\n";
print " -h / -help\n\tto print help\n";
print " -syn_q_command='Your job Queue command'\n\tto specify Job queue command\n";
print " -device='Target Device'\n\tto specify Target FPGA device\n";
print " -flat \n\tTo run synthesis flat, must use this for Altera parts.\n";
print " block_list :\n\tspecify list of blocks to synthesize\n\n";
print "\t$prg -all\n\t$prg -device=XC4VLX200 sparc\n";
print "\t$prg -flat -device=EP2S180 sparc\n\n";
#######################################################################