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
Compare Revisions
- This comparison shows the changes necessary to convert path
/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk/mpsoc/perl_gui/lib/perl
- from Rev 38 to Rev 41
- ↔ Reverse comparison
Rev 38 → Rev 41
/emulate_ram_gen.pl
30,8 → 30,8
use constant PROBE_ST => 0x2; |
use constant SOURCE_ST => 0x1; |
use constant BYPAS_ST => 0x0; |
use constant RAM_BIN_FILE => "$ENV{'PRONOC_WORK'}/emulate/emulate_ram.bin"; |
use constant RAM_SIM_FILE => "$ENV{'PRONOC_WORK'}/emulate/ram"; |
#use constant RAM_BIN_FILE => "$ENV{'PRONOC_WORK'}/emulate/emulate_ram.bin"; |
#use constant RAM_SIM_FILE => "$ENV{'PRONOC_WORK'}/emulate/ram"; |
|
|
|
230,7 → 230,7
my $ram; |
if(SIM_RAM_GEN){ |
my $ext= sprintf("%02u.txt",$num); |
open( $ram, '>', RAM_SIM_FILE.$ext) || die "Can not create: \">lib/emulate/emulate_ram.bin\" $!"; |
open( $ram, '>', "$ENV{'PRONOC_WORK'}/emulate/ram".$ext) || die "Can not create: \"$ENV{'PRONOC_WORK'}/emulate/ram.$ext\" $!"; |
} |
for ($line_num= 0; $line_num<RAM_SIZE; $line_num++ ) { |
my ($value_s,$value_l)=gen_synthetic_traffic_ram_line ($emulate, $x, $y, $sample, $ratio ,$line_num,$rnd); |
287,8 → 287,8
if ( $xn <2 || $xn >16 ){ add_info($info,"programe_pck_gens:invalid X value: ($xn). should be between 2 and 16 \n"); help(); return 0;} |
if ( $yn <2 || $yn >16 ){ add_info($info,"programe_pck_gens:invalid Y value:($yn). should be between 2 and 16 \n"); help(); return 0;} |
#open file pointer |
#open(my $file, RAM_BIN_FILE) || die "Can not create: \">lib/emulate/emulate_ram.bin\" $!"; |
open(my $file, '>', RAM_BIN_FILE) || die "Can not create: \">lib/emulate/emulate_ram.bin\" $!"; |
#open(my $file, '>', RAM_BIN_FILE) || die "Can not create: \">lib/emulate/emulate_ram.bin\" $!"; |
open(my $file, '>', "$ENV{'PRONOC_WORK'}/emulate/emulate_ram.bin") || die "Can not create: \"$ENV{'PRONOC_WORK'}/emulate/emulate_ram.bin\" $!"; |
|
#generate each node ram data |
for (my $y=0; $y<$yn; $y=$y+1){ |
323,7 → 323,7
|
|
#programe packet generators rams |
my $cmd= "sh $jtag_intfc \"-n ".JTAG_RAM_INDEX." -w 8 -i ".RAM_BIN_FILE." -c\" "; |
my $cmd= "sh $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); |
|
return 0 if(run_cmd_update_info ($cmd,$info)); |
/mpsoc_gen.pl
1782,7 → 1782,7
|
$make -> signal_connect("clicked" => sub{ |
$app->do_save(); |
apend_to_textview($tview,' '); |
append_to_textview($tview,' '); |
run_make_file($sw,$tview); |
|
}); |
/temp.pl
3,7 → 3,90
|
use strict; |
use warnings; |
use Gtk2; |
use Time::HiRes qw( usleep ualarm gettimeofday tv_interval nanosleep clock_gettime clock_getres clock_nanosleep clock stat ); |
use Proc::Background; |
use IO::CaptureOutput qw(capture qxx qxy); |
|
my $scalar = "a1b.2"; |
$scalar =~ s/\D//g; |
print "\n $scalar \n"; |
$ENV{TEMP}="ALIREZA"; |
|
|
my $cmd = "xterm -e sh t.sh"; |
my ($stdout,$exit)=run_cmd_in_back_ground_get_stdout( $cmd); |
|
|
|
########## |
# run external commands |
########## |
|
sub run_cmd_in_back_ground |
{ |
my $command = shift; |
#print "\t$command\n"; |
|
### Start running the Background Job: |
my $proc = Proc::Background->new($command); |
my $PID = $proc->pid; |
my $start_time = $proc->start_time; |
my $alive = $proc->alive; |
|
### While $alive is NOT '0', then keep checking till it is... |
# *When $alive is '0', it has finished executing. |
while($alive ne 0) |
{ |
$alive = $proc->alive; |
|
# This while loop will cause Gtk2 to conti processing events, if |
# there are events pending... *which there are... |
while (Gtk2->events_pending) { |
Gtk2->main_iteration; |
} |
Gtk2::Gdk->flush; |
|
usleep(1000); |
} |
|
my $end_time = $proc->end_time; |
# print "*Command Completed at $end_time, with PID = $PID\n\n"; |
|
# Since the while loop has exited, the BG job has finished running: |
# so close the pop-up window... |
# $popup_window->hide; |
|
# Get the RETCODE from the Background Job using the 'wait' method |
my $retcode = $proc->wait; |
$retcode /= 256; |
|
print "\t*RETCODE == $retcode\n\n"; |
Gtk2::Gdk->flush; |
### Check if the RETCODE returned with an Error: |
if ($retcode ne 0) { |
print "Error: The Background Job ($command) returned with an Error...!\n"; |
return 1; |
} else { |
#print "Success: The Background Job Completed Successfully...!\n"; |
return 0; |
} |
|
} |
|
|
|
sub run_cmd_in_back_ground_get_stdout |
{ |
my $cmd=shift; |
my $exit; |
my ($stdout, $stderr); |
capture { $exit=run_cmd_in_back_ground($cmd) } \$stdout, \$stderr; |
return ($stdout,$exit,$stderr); |
|
} |
|
|
|
|
|
|
|
#system ("sh t.sh"); |
/widget.pl
953,7 → 953,7
|
sub append_text_to_file { |
my ($file_path,$text)=@_; |
open(my $fd, ">>$file_path"); |
open(my $fd, ">>$file_path") or die "could not open $file_path: $!"; |
print $fd $text; |
close $fd; |
} |
1264,10 → 1264,16
|
} |
|
sub get_project_dir{ #mpsoc directory address |
my $dir = Cwd::getcwd(); |
my $project_dir = abs_path("$dir/../../"); |
return $project_dir; |
} |
|
|
sub remove_project_dir_from_addr{ |
my $file=shift; |
my $dir = Cwd::getcwd(); |
my $project_dir = abs_path("$dir/../../"); #mpsoc directory address |
my $file=shift; |
my $project_dir = get_project_dir(); |
$file =~ s/$project_dir//; |
return $file; |
} |
1274,8 → 1280,7
|
sub add_project_dir_to_addr{ |
my $file=shift; |
my $dir = Cwd::getcwd(); |
my $project_dir = abs_path("$dir/../../"); #mpsoc directory address |
my $project_dir = get_project_dir(); |
return $file if(-f $file ); |
return "$project_dir/$file"; |
|
1914,4 → 1919,12
} |
|
|
sub make_undef_as_string { |
foreach my $p (@_){ |
$$p= 'undef' if (! defined $$p); |
|
} |
} |
|
|
1 |