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 43 and 45

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

Rev 43 Rev 45
Line 1... Line 1...
#! /usr/bin/perl -w
#! /usr/bin/perl -w
use Glib qw/TRUE FALSE/;
use Glib qw/TRUE FALSE/;
use strict;
use strict;
use warnings;
use warnings;
 
use FindBin;
 
use lib $FindBin::Bin;
use soc;
use soc;
use ip;
use ip;
use interface;
use interface;
use POSIX 'strtol';
use POSIX 'strtol';
 
 
Line 1077... Line 1079...
 
 
                # Write system.h and Software gen files
                # Write system.h and Software gen files
                generate_header_file($soc,$project_dir,$sw_path,$hw_path,$dir);
                generate_header_file($soc,$project_dir,$sw_path,$hw_path,$dir);
 
 
 
 
 
 
 
 
 
 
                # Write main.c file if not exist
                # Write main.c file if not exist
                my $n="$sw_path/main.c";
                my $n="$sw_path/main.c";
                if (!(-f "$n")) {
                if (!(-f "$n")) {
                        # Write main.c
                        # Write main.c
                        open(FILE,  ">$n") || die "Can not open: $!";
                        open(FILE,  ">$n") || die "Can not open: $!";
                        print FILE main_c_template($name);
                        print FILE main_c_template($name);
                        close(FILE) || die "Error closing file: $!";
                        close(FILE) || die "Error closing file: $!";
 
 
                }
                }
 
 
 
                #write perl_object_file 
 
                mkpath("$target_dir/perl_lib/",1,01777);
 
                open(FILE,  ">$target_dir/perl_lib/$name.SOC") || die "Can not open: $!";
 
                print FILE perl_file_header("$name.SOC");
 
                print FILE Data::Dumper->Dump([\%$soc],['soc']);
 
 
 
 
}
}
 
 
 
 
Line 1507... Line 1508...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sub check_entered_address{
sub check_entered_address{
my      ($base_ref,$end_ref,$connect_ref,$number)=@_;
my      ($base_ref,$end_ref,$connect_ref,$number)=@_;
my @bases=@{$base_ref};
my @bases=@{$base_ref};
my @ends=@{$end_ref};
my @ends=@{$end_ref};
my @connects=@{$connect_ref};
my @connects=@{$connect_ref};
Line 1743... Line 1736...
                        add_colored_info(\$tview,"\tThe $jtag_intfc does not exists!. Press the compile button and select your FPGA board first to generate $jtag_intfc file\n", 'red');
                        add_colored_info(\$tview,"\tThe $jtag_intfc does not exists!. Press the compile button and select your FPGA board first to generate $jtag_intfc file\n", 'red');
                        $error=1;
                        $error=1;
                }
                }
 
 
                return if($error);
                return if($error);
                my $command = "cd $target_dir/sw; sh program.sh";
                my $command = "cd $target_dir/sw; bash program.sh";
                add_info(\$tview,"$command\n");
                add_info(\$tview,"$command\n");
                my ($stdout,$exit,$stderr)=run_cmd_in_back_ground_get_stdout($command);
                my ($stdout,$exit,$stderr)=run_cmd_in_back_ground_get_stdout($command);
                if(length $stderr>1){
                if(length $stderr>1){
                        add_colored_info(\$tview,"$stderr\n",'red');
                        add_colored_info(\$tview,"$stderr\n",'red');
                        add_colored_info(\$tview,"Memory was not programed successfully!\n",'red');
                        add_colored_info(\$tview,"Memory was not programed successfully!\n",'red');
Line 1767... Line 1760...
 
 
}
}
 
 
 
 
sub soc_mem_prog {
sub soc_mem_prog {
         my $string='
         my $string='#!/bin/bash
#!/bin/sh
 
 
 
 
 
#JTAG_INTFC="$PRONOC_WORK/toolchain/bin/JTAG_INTFC"
#JTAG_INTFC="$PRONOC_WORK/toolchain/bin/JTAG_INTFC"
source ./jtag_intfc.sh
source ./jtag_intfc.sh
 
 
Line 1793... Line 1785...
 
 
 
 
 
 
#programe the memory
#programe the memory
 
 
        sh write_memory.sh
        bash write_memory.sh
 
 
 
 
#Enable the cpu
#Enable the cpu
$JTAG_INTFC -n 127  -d  "I:1,D:2:0,I:0"
$JTAG_INTFC -n 127  -d  "I:1,D:2:0,I:0"
# I:1  set jtag_enable  in active mode
# I:1  set jtag_enable  in active mode
Line 1932... Line 1924...
                $soc->object_add_attribute('global_param','CORE_ID',0);
                $soc->object_add_attribute('global_param','CORE_ID',0);
                $soc->object_add_attribute('global_param','SW_LOC',$sw_path);
                $soc->object_add_attribute('global_param','SW_LOC',$sw_path);
 
 
                unlink  "$hw_dir/file_list";
                unlink  "$hw_dir/file_list";
                generate_soc($soc,$info,$target_dir,$hw_dir,$sw_path,1,1);
                generate_soc($soc,$info,$target_dir,$hw_dir,$sw_path,1,1);
                #message_dialog("SoC \"$name\" has been created successfully at $target_dir/ " );
 
                my $has_ni= check_for_ni($soc);
                my $has_ni= check_for_ni($soc);
                if($has_ni){
                if($has_ni){
                        my $dialog = Gtk2::MessageDialog->new (my $window,
                        my $dialog = Gtk2::MessageDialog->new (my $window,
                                              'destroy-with-parent',
                                              'destroy-with-parent',
                                              'question', # message type
                                              'question', # message type

powered by: WebSVN 2.1.0

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