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/] [emulate_ram_gen.pl] - Diff between revs 44 and 45

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

Rev 44 Rev 45
Line 39... Line 39...
 
 
 
 
sub reset_cmd {
sub reset_cmd {
        my ($ctrl_reset, $noc_reset,$jtag_intfc)=@_;
        my ($ctrl_reset, $noc_reset,$jtag_intfc)=@_;
        my $reset_vector= (($ctrl_reset & 0x1) << 1) +  ($noc_reset & 0x1);
        my $reset_vector= (($ctrl_reset & 0x1) << 1) +  ($noc_reset & 0x1);
        my $cmd = "sh $jtag_intfc \" -n ".JTAG_DONE_RESET_INDEX."  -d I:1,D:2:$reset_vector,I:0 \" ";
        my $cmd = "bash $jtag_intfc \" -n ".JTAG_DONE_RESET_INDEX."  -d I:1,D:2:$reset_vector,I:0 \" ";
        #print "$cmd\n";
        #print "$cmd\n";
        return  $cmd;
        return  $cmd;
}
}
 
 
sub set_time_limit_cmd {
sub set_time_limit_cmd {
        my ($time_limit,$jtag_intfc)=@_;
        my ($time_limit,$jtag_intfc)=@_;
        my $hex = sprintf("0x%X", $time_limit);
        my $hex = sprintf("0x%X", $time_limit);
        my $cmd = "sh $jtag_intfc \" -n ".JTAG_COUNTER_INDEX."  -d I:1,D:".CLK_CNTw.":$hex,I:0 \" ";
        my $cmd = "bash $jtag_intfc \" -n ".JTAG_COUNTER_INDEX."  -d I:1,D:".CLK_CNTw.":$hex,I:0 \" ";
        #print "$cmd\n";
        #print "$cmd\n";
        return  $cmd;
        return  $cmd;
}
}
 
 
 
 
Line 289... Line 289...
        return 0 if(run_cmd_update_info(set_time_limit_cmd($time_limit,$jtag_intfc),$info));
        return 0 if(run_cmd_update_info(set_time_limit_cmd($time_limit,$jtag_intfc),$info));
 
 
 
 
 
 
        #programe packet generators rams
        #programe packet generators rams
        my $cmd= "sh $jtag_intfc \"-n ".JTAG_RAM_INDEX."  -w 8 -i $ENV{'PRONOC_WORK'}/emulate/emulate_ram.bin -c\" ";
        my $cmd= "bash $jtag_intfc \"-n ".JTAG_RAM_INDEX."  -w 8 -i $ENV{'PRONOC_WORK'}/emulate/emulate_ram.bin -c\" ";
        #my ($result,$exit) = run_cmd_in_back_ground_get_stdout($cmd);
        #my ($result,$exit) = run_cmd_in_back_ground_get_stdout($cmd);
 
 
        return 0 if(run_cmd_update_info ($cmd,$info));
        return 0 if(run_cmd_update_info ($cmd,$info));
        #print $result;
        #print $result;
 
 
Line 307... Line 307...
}
}
 
 
 
 
sub read_jtag_memory{
sub read_jtag_memory{
        my ($addr,$jtag_intfc,$info)=@_;
        my ($addr,$jtag_intfc,$info)=@_;
        my $cmd= "sh $jtag_intfc \" -n ".JTAG_STATIC_INDEX." -w 8 -d I:".UPDATE_WB_ADDR.",D:64:$addr,I:5,R:64:$addr,I:0\"";
        my $cmd= "bash $jtag_intfc \" -n ".JTAG_STATIC_INDEX." -w 8 -d I:".UPDATE_WB_ADDR.",D:64:$addr,I:5,R:64:$addr,I:0\"";
        #print "$cmd\n";
        #print "$cmd\n";
        my ($result,$exit,$stderr) = run_cmd_in_back_ground_get_stdout($cmd);
        my ($result,$exit,$stderr) = run_cmd_in_back_ground_get_stdout($cmd);
        if($exit){
        if($exit){
                        add_colored_info($info, "$result\n",'red') if(defined $result);
                        add_colored_info($info, "$result\n",'red') if(defined $result);
                        add_colored_info($info, "$stderr\n",'red') if(defined $stderr);
                        add_colored_info($info, "$stderr\n",'red') if(defined $stderr);
Line 371... Line 371...
        my $sum_of_pck=0;
        my $sum_of_pck=0;
        my $total_router=0;
        my $total_router=0;
        #read static memory
        #read static memory
        my $end= STATISTIC_NUM * 8 *$NE;
        my $end= STATISTIC_NUM * 8 *$NE;
        $end=sprintf ("%X",$end);
        $end=sprintf ("%X",$end);
        my $cmd= "sh $jtag_intfc \"-n ".JTAG_STATIC_INDEX."  -w 8 -r -s 0 -e $end\"";
        my $cmd= "bash $jtag_intfc \"-n ".JTAG_STATIC_INDEX."  -w 8 -r -s 0 -e $end\"";
        #print "$cmd\n";
        #print "$cmd\n";
        my ($result,$exit,$stderr) = run_cmd_in_back_ground_get_stdout($cmd);
        my ($result,$exit,$stderr) = run_cmd_in_back_ground_get_stdout($cmd);
        if($exit){
        if($exit){
                        add_colored_info($info, "$result\n",'red') if(defined $result);
                        add_colored_info($info, "$result\n",'red') if(defined $result);
                        add_colored_info($info, "$stderr\n",'red') if(defined $stderr);
                        add_colored_info($info, "$stderr\n",'red') if(defined $stderr);
Line 432... Line 432...
    my $done=0;
    my $done=0;
    my $counter=0;
    my $counter=0;
    while ($done ==0){
    while ($done ==0){
                usleep(300000);
                usleep(300000);
                #my ($result,$exit) = run_cmd_in_back_ground_get_stdout("quartus_stp -t ./lib/tcl/read.tcl done");
                #my ($result,$exit) = run_cmd_in_back_ground_get_stdout("quartus_stp -t ./lib/tcl/read.tcl done");
                my ($result,$exit) = run_cmd_in_back_ground_get_stdout("sh $jtag_intfc".READ_DONE_CMD);
                my ($result,$exit) = run_cmd_in_back_ground_get_stdout("bash $jtag_intfc".READ_DONE_CMD);
                if($exit != 0 ){
                if($exit != 0 ){
                        add_colored_info($info,$result,'red');
                        add_colored_info($info,$result,'red');
                        return undef;
                        return undef;
                }
                }
                my @q =split  (/###read data#/,$result);
                my @q =split  (/###read data#/,$result);
Line 481... Line 481...
 
 
        }
        }
        #print "total active router=$total_router\n";
        #print "total active router=$total_router\n";
        #read clock counter
        #read clock counter
        my $clk_counter;
        my $clk_counter;
        my ($result,$exit) = run_cmd_in_back_ground_get_stdout("sh $jtag_intfc".READ_COUNTER_CMD);
        my ($result,$exit) = run_cmd_in_back_ground_get_stdout("bash $jtag_intfc".READ_COUNTER_CMD);
        if($exit != 0 ){
        if($exit != 0 ){
                add_colored_info($info,$result,'red');
                add_colored_info($info,$result,'red');
 
 
        }else {
        }else {
 
 

powered by: WebSVN 2.1.0

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