OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [perl_gui/] [lib/] [perl/] [soc_gen.pl] - Diff between revs 16 and 17

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 16 Rev 17
Line 8... Line 8...
use POSIX 'strtol';
use POSIX 'strtol';
 
 
use File::Path;
use File::Path;
use File::Find;
use File::Find;
use File::Copy;
use File::Copy;
 
use File::Copy::Recursive qw(dircopy);
use Cwd 'abs_path';
use Cwd 'abs_path';
 
 
 
 
use Gtk2;
use Gtk2;
use Gtk2::Pango;
use Gtk2::Pango;
Line 27... Line 27...
use constant NUM_COLUMNS     => 4;
use constant NUM_COLUMNS     => 4;
 
 
 
 
require "widget.pl";
require "widget.pl";
require "verilog_gen.pl";
require "verilog_gen.pl";
require "aeMB.pl";
 
 
require "hdr_file_gen.pl";
 
 
 
 
 
 
 
 
 
 
Line 797... Line 798...
  return $hbox;
  return $hbox;
}
}
 
 
 
 
 
 
sub get_all_hdl_files_list {
sub get_all_files_list {
        my $soc=shift;
        my ($soc,$list_name)=@_;
        my @instances=$soc->soc_get_all_instances();
        my @instances=$soc->soc_get_all_instances();
        my $ip = ip->lib_new ();
        my $ip = ip->lib_new ();
        my @files;
        my @files;
        my $dir = Cwd::getcwd();
        my $dir = Cwd::getcwd();
        my $warnings;
        my $warnings;
Line 813... Line 814...
                my $module              =$soc->soc_get_module($id);
                my $module              =$soc->soc_get_module($id);
                my $module_name =$soc->soc_get_module_name($id);
                my $module_name =$soc->soc_get_module_name($id);
                my $category    =$soc->soc_get_category($id);
                my $category    =$soc->soc_get_category($id);
                my $inst                =$soc->soc_get_instance_name($id);
                my $inst                =$soc->soc_get_instance_name($id);
 
 
                my @new=$ip->ip_get_hdl_files( $category,$module);
                my @new=$ip->ip_get_files( $category,$module,$list_name);
                foreach my $f(@new){
                foreach my $f(@new){
                        my $n="$project_dir$f";
                        my $n="$project_dir$f";
                         if (!(-f "$n") && !(-f "$f" )){
                         if (!(-f "$n") && !(-f "$f" )){
                                $warnings=(defined $warnings)? "$warnings WARNING: Can not find  the hdl file \"$f\" which is required for \"$inst\" \n":"WARNING: Can not find  the hdl file \"$f\" which is required for \"$inst\"\n ";
                                $warnings=(defined $warnings)? "$warnings WARNING: Can not find  \"$f\" which is required for \"$inst\" \n":"WARNING: Can not find  \"$f\"  which is required for \"$inst\"\n ";
 
 
                         }
                         }
 
 
 
 
                }
                }
Line 871... Line 872...
                        mkpath("$target_dir/src_verilog/lib/",1,0755);
                        mkpath("$target_dir/src_verilog/lib/",1,0755);
                        mkpath("$target_dir/sw",1,0755);
                        mkpath("$target_dir/sw",1,0755);
 
 
                #copy hdl codes in src_verilog
                #copy hdl codes in src_verilog
 
 
                my ($hdl_ref,$warnings)= get_all_hdl_files_list($soc);
                my ($file_ref,$warnings)= get_all_files_list($soc,"hdl_files");
                foreach my $f(@{$hdl_ref}){
                foreach my $f(@{$file_ref}){
                        my $n="$project_dir$f";
                        my $n="$project_dir$f";
                         if (-f "$n") {
                         if (-f "$n") {
                                copy ("$n","$target_dir/src_verilog/lib");
                                copy ("$n","$target_dir/src_verilog/lib");
                         }elsif(-f "$f" ){
                         }elsif(-f "$f" ){
                                copy ("$f","$target_dir/src_verilog/lib");
                                copy ("$f","$target_dir/src_verilog/lib");
Line 902... Line 903...
 
 
                copy ("$dir/lib/verilog/$name.v","$target_dir/src_verilog/");
                copy ("$dir/lib/verilog/$name.v","$target_dir/src_verilog/");
 
 
 
 
 
 
                # Write header file
                # Write header files
                        my $file_h=aemb_generate_header($soc);
                        my $file_h=generate_header_file($soc);
                        open(FILE,  ">lib/verilog/$name.h") || die "Can not open: $!";
                        open(FILE,  ">lib/verilog/$name.h") || die "Can not open: $!";
                        print FILE $file_h;
                        print FILE $file_h;
                        close(FILE) || die "Error closing file: $!";
                        close(FILE) || die "Error closing file: $!";
 
                        copy ("$dir/lib/verilog/$name.h","$target_dir/sw/");
 
 
 
                # Write Software files
 
                        ($file_ref,$warnings)= get_all_files_list($soc,"sw_files");
 
 
 
                        foreach my $f(@{$file_ref}){
 
                                my $name= basename($f);
 
 
 
                        my $n="$project_dir$f";
 
                         if (-f "$n") { #copy file
 
                                copy ("$n","$target_dir/sw");
 
                         }elsif(-f "$f" ){
 
                                copy ("$f","$target_dir/sw");
 
 
 
                         }elsif (-d "$n") {#copy folder
 
                                dircopy ("$n","$target_dir/sw/$name");
 
                         }elsif(-d "$f" ){
 
                                dircopy ("$f","$target_dir/sw/$name");
 
 
 
                         }
 
 
 
 
 
                }
 
 
 
 
                        copy ("$dir/lib/verilog/$name.h","$target_dir/sw/");
 
 
 
                        use File::Copy::Recursive qw(dircopy);
 
                        dircopy("$dir/../src_processor/aeMB/compiler","$target_dir/sw/") or die("$!\n");
 
 
 
 
 
 
 
                        message_dialog("SoC \"$name\" has been created successfully at $target_dir/ " );
                        message_dialog("SoC \"$name\" has been created successfully at $target_dir/ " );
 
                        exec($^X, $0, @ARGV);# reset ProNoC to apply changes
 
 
                }else {
                }else {
                        message_dialog("Please define the SoC name!");
                        message_dialog("Please define the SoC name!");
 
 
                }
                }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.