fixed broken fpga flow

This commit is contained in:
tangxifan 2019-06-28 13:07:04 -06:00
parent 1332ba62e8
commit c54f3905d5
4 changed files with 1653 additions and 1653 deletions

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,6 @@ elliptic.blif, 120
ex1010.blif, 120
ex5p.blif, 120
frisc.blif, 120
mcnc_big20.txt
misex3.blif, 120
pdc.blif, 120
s298.blif, 30

View File

@ -274,8 +274,7 @@ sub read_opt_into_hash($ $ $)
sub opts_read()
{
# if no arguments detected, print the usage.
if (-1 == $#ARGV)
{
if (-1 == $#ARGV) {
print "Error : No input arguments!\n";
print "Help desk:\n";
&print_usage();
@ -289,19 +288,15 @@ sub opts_read()
my $argfd;
# Check help fist
$argfd = &spot_option($cur_arg,"-help");
if (-1 != $argfd)
{
if (-1 != $argfd) {
print "Help desk:\n";
&print_usage();
}
# Then Check the debug with highest priority
$argfd = &spot_option($cur_arg,"-debug");
if (-1 != $argfd)
{
if (-1 != $argfd) {
$opt_ptr->{"debug"} = "on";
}
else
{
} else {
$opt_ptr->{"debug"} = "off";
}
# Check mandatory options
@ -731,7 +726,7 @@ sub run_abc_fpgamap($ $ $)
die "ERROR: fail to auto generating cmds for ABC ($cmd_log) ...\n";
}
# Output the standard format (refer to VTR_flow script)
print $ABC_CMD_FH "read $bm; resyn; resyn2; $fpga_synthesis_method -K $lut_num; $abc_seq_optimize write_blif $blif_out; $dump_verilog; quit\n";
print $ABC_CMD_FH "read $bm; resyn; resyn2; scleanup; $fpga_synthesis_method -K $lut_num; sweep; $abc_seq_optimize write_blif $blif_out; $dump_verilog; quit\n";
close($ABC_CMD_FH);
#
@ -1201,7 +1196,7 @@ sub run_pro_blif($ $) {
$pro_blif_path =~ s/\/$//g;
$pro_blif_path = $pro_blif_path . "/pro_blif.pl";
`perl $pro_blif_path -i $abc_blif_out_bak -o $abc_blif_out`;
`perl $pro_blif_path -i $abc_blif_out_bak -o $abc_blif_out -add_default_clk`;
if (!(-e $abc_blif_out)) {
die "ERROR: Fail pro_blif.pl for benchmark $abc_blif_out.\n";
@ -1449,7 +1444,7 @@ sub run_std_vpr($ $ $ $ $ $ $ $ $)
# foreach my $file (0..$#files){
# print "$files[$file]\t";
# }
3 print "\n";
print "\n";
#}
chdir $cwd;
}
@ -3151,7 +3146,11 @@ sub gen_csv_rpt_standard_flow($ $)
for($ikw=0; $ikw < ($#keywords+1); $ikw++) {
$tmpkw = $keywords[$ikw];
$tmpkw =~ s/\s//g;
print $CSVFH ",$rpt_ptr->{$tag}->{$tmp}->{$N_val}->{$K_val}->{$keywords[$ikw]}";
if (defined($rpt_ptr->{$tag}->{$tmp}->{$N_val}->{$K_val}->{$keywords[$ikw]})) {
print $CSVFH ",$rpt_ptr->{$tag}->{$tmp}->{$N_val}->{$K_val}->{$keywords[$ikw]}";
} else {
print $CSVFH ", ";
}
}
if ("on" eq $opt_ptr->{power}) {
@keywords = split /\|/,$conf_ptr->{csv_tags}->{vpr_power_tags}->{val};

View File

@ -10,6 +10,7 @@ my $mydate = gmctime();
my ($char_per_line) = (80);
my ($fname,$frpt,$finitial);
my $add_default_clk = "off";
my $latch_token;
my ($remove_buffers) = (0);
my ($default_clk_name) = ("clk");
@ -25,6 +26,7 @@ sub print_usage()
print " -o <output_blif_path>\n";
print " Options: (Optional)\n";
print " -remove_buffers\n";
print " -add_default_clk\n";
print " -initial_blif <input_blif_path>\n";
print "\n";
return 1;
@ -32,23 +34,21 @@ sub print_usage()
sub opts_read()
{
if (-1 == $#ARGV)
{
if (-1 == $#ARGV) {
print "Error: No input argument!\n";
&print_usage();
exit(1);
}
else
{
for (my $iargv = 0; $iargv < $#ARGV+1; $iargv++)
{
if ("-i" eq $ARGV[$iargv])
{$fname = $ARGV[$iargv+1];}
elsif ("-o" eq $ARGV[$iargv])
{$frpt = $ARGV[$iargv+1];}
elsif ("-initial_blif" eq $ARGV[$iargv])
{$finitial = $ARGV[$iargv+1];}
elsif ("-remove_buffers" eq $ARGV[$iargv]) {
} else {
for (my $iargv = 0; $iargv < $#ARGV+1; $iargv++) {
if ("-i" eq $ARGV[$iargv]) {
$fname = $ARGV[$iargv+1];
} elsif ("-o" eq $ARGV[$iargv]) {
$frpt = $ARGV[$iargv+1];
} elsif ("-add_default_clk" eq $ARGV[$iargv]) {
$add_default_clk = "on";
} elsif ("-initial_blif" eq $ARGV[$iargv]) {
$finitial = $ARGV[$iargv+1];
} elsif ("-remove_buffers" eq $ARGV[$iargv]) {
$remove_buffers = 1;
}
}
@ -217,7 +217,7 @@ sub scan_blif()
my (@input_buffer);
my ($line_no) = (0);
if(undef eq $finitial){
if (!defined($finitial)) {
$latch_token = "re clk";
} else {
my $latch_token_found = 0;
@ -276,11 +276,13 @@ sub scan_blif()
close($FIN);
# Add default clock
# print "INFO: $clk_num clock ports need to be added.\n";
# print "INFO: have_default_clk: $have_default_clk, need_default_clk: $need_default_clk\n";
# if ((0 == $have_default_clk)&&(1 == $need_default_clk)) {
# push @input_tokens,$default_clk_name;
# }
if ("on" eq $add_default_clk) {
print "INFO: $clk_num clock ports need to be added.\n";
print "INFO: have_default_clk: $have_default_clk, need_default_clk: $need_default_clk\n";
if ((0 == $have_default_clk)&&(1 == $need_default_clk)) {
push @input_tokens,$default_clk_name;
}
}
# Bypass some sensitive tokens
for(my $itok = 0; $itok < $#input_tokens+1; $itok++) {
if ("unconn" eq $input_tokens[$itok]) {