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 53 to Rev 54
- ↔ Reverse comparison
Rev 53 → Rev 54
/Consts.pm
1,8 → 1,8
#This file is created by /home/alireza/work/git/hca_git/ProNoC/mpsoc/intsall.sh |
package Consts; |
|
use constant VERSION => '1.9.1'; |
use constant END_YEAR => '2019'; |
use constant VERSION => '2.1.0'; |
use constant END_YEAR => '2021'; |
use constant GTK_VERSION => '3'; |
|
|
/common.pl
1,3 → 1,5
#!/usr/bin/perl -w |
|
use strict; |
use warnings; |
|
12,7 → 14,21
use Term::ANSIColor qw(:constants); |
use IPC::Run qw(start pump finish timeout pumpable); |
|
use FindBin; |
use lib $FindBin::Bin; |
use constant::boolean; |
use IO::CaptureOutput qw(capture qxx qxy); |
|
|
our %glob_setting; |
$glob_setting{'FONT_SIZE'}='default'; |
$glob_setting{'ICON_SIZE'}='default'; |
$glob_setting{'DSPLY_X'} ='default'; |
$glob_setting{'DSPLY_Y'} ='default'; |
|
|
|
|
sub log2{ |
my $num=shift; |
my $log=($num <=1) ? 1: 0; |
175,8 → 191,7
$all_lib=$all_lib." lib$lib_num"; |
$lib_num++; |
} |
|
|
|
my $make= " |
|
default: sim |
199,14 → 214,21
CPPFLAGS += -W -Werror -Wall |
endif |
|
SLIB = |
HLIB = |
ifneq (\$(wildcard synful/synful.a),) |
SLIB += synful/synful.a |
HLIB += synful/synful.h |
endif |
|
####################################################################### |
# Linking final exe -- presumes have a sim_main.cpp |
|
|
sim: testbench.o \$(VK_GLOBAL_OBJS) $p |
sim: testbench.o \$(VK_GLOBAL_OBJS) $p \$(SLIB) |
\$(LINK) \$(LDFLAGS) -g \$^ \$(LOADLIBES) \$(LDLIBS) -o testbench \$(LIBS) -Wall -O3 -lpthread 2>&1 | c++filt |
|
testbench.o: testbench.cpp $h |
testbench.o: testbench.cpp $h \$(HLIB) |
|
clean: |
rm *.o *.a testbench |
434,7 → 456,7
while (<$fh>) { |
chomp; |
#FIXME: this regex isn't quite good enough |
next unless my ($var, $value) = /\s*(\w+)=([^#]+)/; |
next unless my ($var, $value) = /\s*(\w+)=([^#]+)/; |
$ENV{$var} = $value; |
} |
return undef; |
811,7 → 833,13
0x800080,#Purple |
0x4B0082,#Indigo |
0xFFFFFF,#white |
0x000000 #Black |
0x000000, #Black |
#heatmap |
0xbdff00, # (189,255,0) |
0xe3f018, # (227,240,24) |
0xffce00, # (255,206,0) |
0xff6612, # (255,102,18) |
0xc12424, # (193,36,36) |
); |
|
my $color= ($num< scalar (@colors))? $colors[$num]: 0xFFFFFF; |
859,7 → 887,15
"800080",#Purple |
"4B0082",#Indigo |
"FFFFFF",#white |
"000000" #Black |
"000000", #Black |
#heatmap |
"bdff00", # (189,255,0) |
"e3f018", # (227,240,24) |
"ffce00", # (255,206,0) |
"ff6612", # (255,102,18) |
"c12424", # (193,36,36) |
|
|
); |
|
my $color= ($num< scalar (@colors))? $colors[$num]: "FFFFFF"; |
1052,7 → 1088,7
$scale= 1 if (!defined $scale); |
my $diagram; |
|
my $cmd = "echo \'$dotfile\' | dot -Tpng"; |
my $cmd = "echo \'$dotfile\' | dot -Tpng -q"; |
my ($stdout,$exit,$stderr)= run_cmd_in_back_ground_get_stdout ($cmd); |
if ( length( $stderr || '' ) !=0) { |
message_dialog("$stderr\nHave you installed graphviz? If not run \n \t \"sudo apt-get install graphviz\" \n in terminal",'error'); |
1299,5 → 1335,74
} |
|
|
#get the list of files matching the given extention |
sub get_file_list_by_extention { |
my ($open_in, $ext)=@_; |
my @files = glob "$open_in/*"; |
my $file_list=""; |
foreach my $file (@files){ |
my ($name,$path,$suffix) = fileparse("$file",qr"\..[^.]*$"); |
if($suffix eq $ext || $suffix eq ".$ext" ){ |
$file_list.=",$name"; |
} |
} |
return ($file_list,\@files); |
} |
|
|
|
|
sub set_gui_setting{ |
my $paths=shift; |
my %p=%{$paths}; |
$glob_setting{'FONT_SIZE'}= $p{'GUI_SETTING'}{'FONT_SIZE'} if (defined $p{'GUI_SETTING'}{'FONT_SIZE'}); |
$glob_setting{'ICON_SIZE'}= $p{'GUI_SETTING'}{'ICON_SIZE'} if (defined $p{'GUI_SETTING'}{'ICON_SIZE'}); |
$glob_setting{'DSPLY_X'} = $p{'GUI_SETTING'}{'DSPLY_X'} if (defined $p{'GUI_SETTING'}{'DSPLY_X'}); |
$glob_setting{'DSPLY_Y'} = $p{'GUI_SETTING'}{'DSPLY_Y'} if (defined $p{'GUI_SETTING'}{'DSPLY_Y'}); |
} |
|
my ($screen_x,$screen_y); |
|
sub get_default_screen_size{ |
return ($screen_x,$screen_y) if (defined $screen_x && defined $screen_y); |
|
my $fh= 'xrandr --current | awk \'$2~/\*/{print $1}\'' ; |
my ($stdout, $stderr, $success) = qxx( ($fh) ); |
my @a = split ("\n",$stdout); |
($screen_x,$screen_y) = split ("x",$a[0]); |
$screen_x = 600 if(!defined $screen_x); |
$screen_y = 800 if(!defined $screen_y); |
return ($screen_x,$screen_y); |
} |
|
|
sub get_current_monitor_working_area{ |
my $screen = get_default_screen(); |
my $hight = $screen->get_height(); |
my $active = $screen->get_active_window(); |
my $monitor = $screen->get_monitor_at_window($active); |
my $warea = $screen->get_monitor_workarea($monitor);#get_width(); |
#print Data::Dumper->Dump ([$warea],['ttt']); |
return ($warea->{'width'},$warea->{'height'}); |
} |
|
|
|
|
sub max_win_size { |
my ($x,$y); |
$x= int($glob_setting{'DSPLY_X'}) if ($glob_setting{'DSPLY_X'} ne 'default'); |
$y= int($glob_setting{'DSPLY_Y'}) if ($glob_setting{'DSPLY_Y'} ne 'default'); |
if (!defined $x || !defined $y){ |
my ($X,$Y)=get_current_monitor_working_area(); |
$x=$X if (!defined $x); |
$y=$Y if (!defined $y); |
} |
|
return ($x,$y); |
|
|
} |
|
|
1 |
/diagram.pl
11,9 → 11,9
require "emulator.pl"; |
use File::Copy; |
|
use Chart::Gnuplot; |
|
|
|
sub get_dot_file{ |
my $self= shift; |
my $self_name=$self->object_get_attribute('soc_name'); |
248,15 → 248,49
|
|
sub show_topology_diagram { |
my $self= shift; |
|
my ($self)= @_; |
|
my $table=def_table(20,20,FALSE); |
|
my $window=def_popwin_size(80,80,"NoC-based MPSoC topology block diagram",'percent'); |
my $scrolled_win = add_widget_to_scrolled_win(); |
|
$window->add ($table); |
|
my $notebook = gen_notebook(); |
$notebook->set_tab_pos ('top'); |
$notebook->set_scrollable(TRUE); |
$window->add($notebook); |
|
|
|
|
my @data; |
my $ref =$self->object_get_attribute('noc_param'); |
if(defined $ref){ |
my %param=%{$ref}; |
foreach my $p (sort keys %param){ |
push (@data, {0 => "$p", 1 =>"$param{$p}"}); |
} |
} |
|
# create list store |
my @clmn_type = ('Glib::String', 'Glib::String'); |
my @clmns = (" Parameter Name ", " Value "); |
my $page2=add_widget_to_scrolled_win(gen_list_store (\@data,\@clmn_type,\@clmns)); |
|
|
|
$notebook->append_page ($table,gen_label_with_mnemonic ("Topology diagram")) ; |
$notebook->append_page ($page2,gen_label_with_mnemonic ("NoC parameters")) ; |
|
|
|
|
|
|
|
|
|
my $plus = def_image_button('icons/plus.png',undef,TRUE); |
my $minues = def_image_button('icons/minus.png',undef,TRUE); |
my $save = def_image_button('icons/save.png',undef,TRUE); |
304,7 → 338,7
|
}); |
$minues -> signal_connect("clicked" => sub{ |
$scale*=.9 if ($scale >0.1); ; |
$scale*=.9 if ($scale >0.1); |
$self->object_add_attribute("topology_diagram","scale", $scale ); |
gen_show_diagram($self,$scrolled_win,'topology',"topology_diagram"); |
}); |
331,6 → 365,7
|
gen_show_diagram($self,$scrolled_win,'topology',"topology_diagram"); |
$window->show_all(); |
$notebook->set_current_page (0); |
} |
|
|
390,8 → 425,8
|
|
sub show_diagram { |
my ($self,$scrolled_win,$name)=@_; |
|
my ($self,$scrolled_win,$name,$image_name)=@_; |
$image_name="diagram.png" if (!defined $image_name); |
my @list = $scrolled_win->get_children(); |
foreach my $l (@list){ |
$scrolled_win->remove($l); |
401,7 → 436,7
my $scale=$self->object_get_attribute($name,"scale"); |
$scale= 1 if (!defined $scale); |
my $tmp_dir = "$ENV{'PRONOC_WORK'}/tmp"; |
my $diagram=open_image("$tmp_dir/diagram.png",70*$scale,70*$scale,'percent'); |
my $diagram=open_image("$tmp_dir/$image_name",70*$scale,70*$scale,'percent'); |
|
add_widget_to_scrolled_win($diagram,$scrolled_win); |
$scrolled_win->show_all(); |
671,6 → 706,181
################################## |
|
|
|
|
sub generate_heat_map_table{ |
my ($d)=@_ ; |
|
return (def_table (1, 1, FALSE),def_table (1, 1, FALSE)) if (!defined $d); |
my %data=%{$d}; |
my @xs = (sort {$a<=>$b} keys %data); |
|
|
|
|
my $max=0; |
#for(my $y=0; $y<$dim; $y++){ |
# for(my $x=0; $x<$dim; $x++){ |
foreach my $y (@xs){ |
foreach my $x (@xs){ |
#$data{$x}{$y}=int(rand(50000)); |
#$data{$x}{$y}=$y*64+$x; |
$max = $data{$x}{$y} if( $max < $data{$x}{$y}); |
} |
} |
|
|
my $width_max = length int $max; |
|
my $table = def_table (1, 1, FALSE); |
|
#for(my $y=0; $y<$dim; $y++){ |
foreach my $y (@xs){ |
my $l=gen_label_in_center("$y"); |
$table->attach ($l, $y+1,$y+2,0,1,'expand','shrink',2,2); |
} |
#for(my $x=0; $x<$dim; $x++){ |
foreach my $x (@xs){ |
my $l=gen_label_in_center("$x"); |
$table->attach ($l, 0,1,$x+1,$x+2,'expand','shrink',2,2); |
} |
|
#for(my $y=0; $y<$dim; $y++){ |
# for(my $x=0; $x<$dim; $x++){ |
foreach my $y (@xs){ |
foreach my $x (@xs){ |
my $d=$data{$x}{$y}; |
my $c = int (((5*$d))/($max+1)); |
my $v = length int $d; |
until ($v >= $width_max){ |
$d=" ".$d; |
$v++; |
} |
|
my $l =gen_colored_label( " " ,32+$c); |
set_tip($l,"E[$x]->E[$y]=$d"); |
$table->attach ($l, $y+1,$y+2,$x+1,$x+2,'expand','shrink',2,2); |
} |
|
} |
|
my $scale = def_table (1, 1, FALSE); |
my $v=gen_label_in_center("0"); |
$scale->attach ($v, 1,2,0,1,'expand','shrink',2,2); |
for (my $i=0; $i<5; $i++){ |
my $l =gen_colored_label( " " ,32+$i); |
my $val =int( (2*$i+1)*$max/10); |
my $v=gen_label_in_center($val); |
$scale->attach ($v, 0,1,$i+1,$i+2,'expand','shrink',2,2); |
$scale->attach ($l, 1,2,$i+1,$i+2,'expand','shrink',2,2); |
$scale->attach (gen_label_in_center("$max"), 1,2,$i+2,$i+3,'expand','shrink',2,2) if($i==4); |
} |
|
|
return ($table,$scale); |
|
} |
|
|
sub generate_heat_map_img_file{ |
my ($d,$image_file,$title)=@_ ; |
return if (!defined $d); |
my %hash=%{$d}; |
my @data; |
my @xs = (sort {$a<=>$b} keys %hash); |
foreach my $y (@xs){ |
my @b; |
push (@data ,\@b) if ($y!=0); |
foreach my $x (@xs){ |
my @a=($x,$y, $hash{$x}{$y}); |
push (@data ,\@a); |
} |
|
} |
|
my $length = @xs; |
$length+=1; |
|
my $chart = Chart::Gnuplot->new( |
bg => 'white', |
view => 'map', |
palette => 'defined (0 0 0 1, 1 1 1 0, 2 1 0 0)', |
output => "$image_file", |
title => "$title", |
xlabel => 'Endp-ID', |
ylabel => 'Endp-ID', |
xrange => [-1, $length], |
size => 'ratio -1', |
xtics => { |
labels => \@xs, |
}, |
ytics => { |
labels => \@xs, |
}, |
mxtics => '2', |
mytics => '2', |
border => undef, |
grid => 'front mxtics mytics lw 1.5 lt -1 lc rgb \'white\'', |
|
); |
my $dataSet = Chart::Gnuplot::DataSet->new( |
points => \@data, |
view => 'map', |
type => 'matrix', |
using => "1:2:3 with image", |
); |
|
|
$chart->plot2d($dataSet); |
|
|
|
|
|
} |
|
|
|
sub generate_heat_map_dot_file{ |
my ($data,$dim)=@_ ; |
my $dotfile= |
"digraph G { |
graph [layout = neato, rankdir = RL , splines = true, overlap = true]; |
node[shape=record]; |
"; |
for(my $y=0; $y<$dim; $y++){ |
for(my $x=0; $x<$dim; $x++){ |
my $tx=$x*2+0.5; |
my $ty=($dim-$y-1)*2+0.5; |
my $w=2; |
|
$tx/=2; |
$ty/=2; |
$w/=2; |
|
|
$dotfile.=" |
\"t${x}_$y\"[ |
label = \"8822255\" |
pos = \"$tx,$ty!\" |
width =$w |
height=$w |
style=filled |
fontsize=\"12\" |
fillcolor=orange |
|
]; |
" |
} |
} |
|
$dotfile=$dotfile."\n}\n"; |
return $dotfile; |
|
} |
|
|
|
sub generate_mesh_dot_file{ |
my $self=shift; |
|
/emulator.pl
64,19 → 64,19
my @range=split(':',$p); |
my $size= scalar @range; |
if($size==1){ # its a number |
if ( $range[0] <= 0 || $range[0] >100 ) { message_dialog ("$range[0] is out of boundery (1:100)" ); return undef; } |
if ( $range[0] <= 0 || $range[0] >100 ) { message_dialog ("Injection ratio $range[0] is out of bounds: 1<=ratio=<100" ); return undef; } |
push(@ratios,$range[0]); |
}elsif($size ==3){# its a range |
my($min,$max,$step)=@range; |
if ( $min <= 0 || $min >100 ) { message_dialog ("$min in $p is out of boundery (1:100)" ); return undef; } |
if ( $max <= 0 || $max >100 ) { message_dialog ("$max in $p is out of boundery (1:100)" ); return undef; } |
if ( $min <= 0 || $min >100 ) { message_dialog ("Injection ratio $min in $p is out of bounds: 1<=ratio=<100" ); return undef; } |
if ( $max <= 0 || $max >100 ) { message_dialog ("Injection ratio $max in $p is out of bounds: 1<=ratio=<100" ); return undef; } |
for (my $i=$min; $i<=$max; $i=$i+$step){ |
push(@ratios,$i); |
} |
|
}else{ |
message_dialog ("$p has invalid format. The correct format for range is \$min:\$max:\$step" ); |
|
message_dialog ("Injection ratio $p has an invalid format. The correct format for range is \[min\]:\[max\]:\[step\]" ); |
return undef; |
} |
|
}#foreach |
249,8 → 249,11
} |
|
} |
my $l= "Define injection ratios. You can define individual ratios seprating by comma (\',\') or define a range of injection ratios with \$min:\$max:\$step format. |
As an example defining 2,3,4:10:2 will result in (2,3,4,6,8,10) injection ratios." ; |
my $l= "Injection ratios in flits/clk/Endpoint (%). |
E.g. Injection ratio 10% means each endpoint inject one flit every 10 cycles. |
You can define individual ratios seprating by comma (\',\') or define a range of injection ratios with \$min:\$max:\$step format. |
As an example defining 2,3,4:10:2 will result in (2,3,4,6,8,10) injection ratios. |
" ; |
my $u=get_injection_ratios ($emulate,$sample,"ratios"); |
|
attach_widget_to_table ($table,$row,gen_label_in_left("Injection ratios:"),gen_button_message ($l,"icons/help.png") , $u); $row++; |
370,14 → 373,24
|
$l=def_image_button('icons/diagram.png',$name); |
$l-> signal_connect("clicked" => sub{ |
|
__PACKAGE__->mk_accessors(qw{noc_param}); |
my $temp = __PACKAGE__->new(); |
|
|
|
my $st = ($mode eq "simulate" )? check_sim_sample($emulate,$sample,$info) : check_sample($emulate,$sample,$info); |
return if $st==0; |
my ($topology, $T1, $T2, $T3, $V, $Fpay) = get_sample_emulation_param($emulate,$sample); |
$emulate->object_add_attribute('noc_param','T1',$T1); |
$emulate->object_add_attribute('noc_param','T2',$T2); |
$emulate->object_add_attribute('noc_param','T3',$T3); |
$emulate->object_add_attribute('noc_param','TOPOLOGY',$topology); |
show_topology_diagram ($emulate); |
my $ref=$emulate->object_get_attribute($sample,"noc_info"); |
if (defined $ref){ |
my %noc_info= %$ref; |
foreach my $p (sort keys %noc_info){ |
$temp->object_add_attribute('noc_param',$p,$noc_info{$p}); |
} |
} |
|
show_topology_diagram ($temp); |
}); |
|
my $traffic = def_button("Pattern"); |
873,6 → 886,7
'/mpsoc/rtl/src_peripheral/ram/', |
'/mpsoc/rtl/main_comp.v', |
'/mpsoc/rtl/arbiter.v', |
'/mpsoc/rtl/pronoc_def.v', |
'/mpsoc/rtl/src_topolgy/', |
'/mpsoc/rtl/src_noc/'); |
|
/graph.pl
8,7 → 8,6
|
|
|
|
sub gen_multiple_charts{ |
my ($self,$pageref,$charts_ref,$image_scale)=@_; |
my @pages=@{$pageref}; |
176,6 → 175,7
sub gen_graph { |
my ($self,$chart,$image_scale,@selects)=@_; |
if($chart->{type} eq '2D_line') {return gen_2D_line($self,$chart,@selects);} |
if($chart->{type} eq 'Heat-map') {return gen_heat_map($self,$chart,@selects);} |
return gen_3D_bar($self,$chart,$image_scale,@selects); |
} |
|
182,7 → 182,173
|
|
|
sub gen_heat_map{ |
my ($self,$chart,@selects)=@_; |
|
my $page_id= "P$chart->{page_num}"; |
my $graph_id= $page_id."$chart->{graph_name}"; |
my $result_name= $chart->{result_name}; |
|
|
my $table = def_table (25, 10, FALSE); |
|
my $plus = def_image_button('icons/plus.png',undef,TRUE); |
my $minues = def_image_button('icons/minus.png',undef,TRUE); |
my $setting = def_image_button('icons/setting.png',undef,TRUE); |
my $save = def_image_button('icons/save.png',undef,TRUE); |
|
my $type_combo=gen_combobox_object ($self,"${graph_id}","type","Table,Image",'Table','ref',2); |
|
|
my @samples =$self->object_get_attribute_order("samples"); |
@samples = ('-') if (scalar @samples == 0); |
my $sample_combx=gen_combobox_object ($self,${graph_id},"sample_sel",join(",", @samples),$samples[0],'ref',2); |
my $sample = $self->object_get_attribute("${graph_id}","sample_sel"); |
my $ref=$self->object_get_attribute ($sample,$result_name); |
my @ratios; |
@ratios = get_uniq_keys($ref,@ratios); |
@ratios = ('-') if (!defined $ratios[0]); |
my $rcnt = join(",", @ratios); |
my $ratio_combx=gen_combobox_object ($self,${graph_id},"ratio_sel",$rcnt,$ratios[0],'ref',2); |
my $content=join( ',', @selects); |
my $active_page=gen_combobox_object ($self,$page_id,"active",$content,$selects[0],'ref',2); |
|
|
|
my $t = def_table (25, 10, FALSE); |
#my $dotfile= generate_heat_map_dot_file(undef,40); |
|
|
|
my $r_sel = $self->object_get_attribute("${graph_id}","ratio_sel"); |
my $dat; |
$dat= $ref->{$r_sel} if (defined $ref->{$r_sel}); |
my $scrolled_win = add_widget_to_scrolled_win($t); |
|
|
my $heatmap_type =$self->object_get_attribute("${graph_id}","type"); |
$heatmap_type = 'Table' if (!defined $heatmap_type); |
|
my $scale= $self->object_get_attribute("${graph_id}","scale"); |
if(!defined $scale){ |
$scale = .5; |
$self->object_add_attribute("${graph_id}","scale", $scale ); |
} |
|
my $diagram; |
my $map_info; |
my $image ="$ENV{PRONOC_WORK}/tmp/heatmap.png"; |
if($chart->{'graph_name'} ne 'Select'){ |
if ($heatmap_type eq 'Image'){ |
|
my $regen_img= $self->object_get_attribute("${graph_id}","regen_img"); |
$regen_img = 0 if (!defined $regen_img); |
if ($regen_img==1){ |
my $title= $self->object_get_attribute($page_id,"active"); |
generate_heat_map_img_file($dat,$image,$title); |
$self->object_add_attribute("${graph_id}","regen_img",0); |
} |
|
show_diagram ($self,$scrolled_win,${graph_id},"heatmap.png") if(-f $image); |
|
$minues -> signal_connect("clicked" => sub{ |
$scale*=.9 if ($scale >0.1); |
$self->object_add_attribute("${graph_id}","scale", $scale ); |
show_diagram ($self,$scrolled_win,${graph_id},"heatmap.png") if(-f $image); |
}); |
|
$plus -> signal_connect("clicked" => sub{ |
$scale*=1.1 if ($scale <10); |
$self->object_add_attribute("${graph_id}","scale", $scale ); |
show_diagram ($self,$scrolled_win,${graph_id},"heatmap.png") if(-f $image); |
}); |
|
$save-> signal_connect("clicked" => sub{ |
my $file; |
my $title ='Save as'; |
my @extensions=('png'); |
my $open_in=undef; |
my $dialog=save_file_dialog ($title, @extensions); |
$dialog->set_current_folder ($open_in) if(defined $open_in); |
if ( "ok" eq $dialog->run ) { |
$file = $dialog->get_filename; |
my $ext = $dialog->get_filter; |
$ext=$ext->get_name; |
my ($name,$path,$suffix) = fileparse("$file",qr"\..[^.]*$"); |
$file = ($suffix eq ".$ext" )? $file : "$file.$ext"; |
copy("$image","$file"); |
|
} |
$dialog->destroy; |
}); |
set_tip($save, "Save graph"); |
|
|
|
} |
else{ #heatmap table |
my $t; |
($t,$map_info)=generate_heat_map_table($dat); |
add_widget_to_scrolled_win($t ,$scrolled_win); |
$scrolled_win->show_all(); |
} |
} |
|
|
|
|
# my $scrolled_win = add_widget_to_scrolled_win($t); |
# show_diagram ($self,$scrolled_win,${graph_id},"heatmap.png"); |
|
|
|
|
|
|
|
|
$table->attach_defaults ($scrolled_win , 0, 9, 0, 24); |
my $row=0; |
|
|
$type_combo-> signal_connect("changed" => sub{ |
$self->object_add_attribute("${graph_id}","regen_img",1); |
|
}); |
|
|
$table->attach ($active_page, 9, 10, $row, $row+1,'shrink','shrink',2,2);$row++; |
$table->attach ($sample_combx, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach (gen_label_in_center("Injection-Ratio/"), 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach (gen_label_in_center("Task-file index"), 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach ($ratio_combx, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach (gen_label_in_center("Graph-Type"), 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach ($type_combo, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
|
if ($heatmap_type eq 'Image'){ |
$table->attach ($plus , 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach ($minues, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach ($save, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
}elsif(defined $map_info){ |
$table->attach ($map_info , 9, 10, $row, $row+1,'shrink','shrink',2,2); $row+=6; |
|
} |
#$table->attach ($setting, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
|
while ($row<10){ |
my $tmp=gen_label_in_left(''); |
$table->attach_defaults ($tmp, 9, 10, $row, $row+1);$row++; |
} |
|
return $table; |
|
|
|
|
|
} |
|
|
sub gen_3D_bar{ |
my ($self,$chart,$image_scale,@selects)=@_; |
# $image_scale = .4 if (!defined $image_scale); |
403,7 → 569,7
my $scale= $self->object_get_attribute("${graph_id}_graph_scale",undef); |
$scale = 5 if(!defined $scale); |
$minues -> signal_connect("clicked" => sub{ |
$self->object_add_attribute("${graph_id}_graph_scale",undef,$scale*1.05); |
$self->object_add_attribute("${graph_id}_graph_scale",undef,$scale*1.05); |
set_gui_status($self,"ref",1); |
}); |
|
426,12 → 592,12
|
|
|
$table->attach_defaults ($align , 0, 9, 0, 25); |
$table->attach_defaults ($align , 0, 9, 0, 24); |
my $row=0; |
$table->attach ($active_page, 0, 9, 24, 25,'shrink','shrink',2,2); |
$table->attach (gen_label_in_center("Injection-Ratio/"), 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach (gen_label_in_center("Task-file index"), 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach ($ratio_combx, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach ($active_page, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach ($ratio_combx, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
$table->attach ($dimension, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
|
#$table->attach ($plus , 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++; |
444,6 → 610,8
$table->attach_defaults ($tmp, 9, 10, $row, $row+1);$row++; |
} |
|
|
|
return $table; |
} |
|
/mpsoc_gen.pl
780,27 → 780,77
$type="Combo-box"; |
($row,$coltmp)=add_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,undef,$show_noc,'noc_param'); |
|
if($show_noc == 1){ |
$b1= def_image_button("icons/up.png","NoC Parameters"); |
$table->attach ( $b1 , 0, 2, $row,$row+1,'fill','shrink',2,2); |
$row++; |
|
|
|
|
#CAST_TYPE |
$label='Casting Type'; |
$param='CAST_TYPE'; |
$default= '"UNICAST"'; |
$info='Configure a NoC as Unicast, Multicast, or Broadcast NoC. In Unicast NoC, a packet can be sent to only one destination. In Multicast, a single packet can have multiple target destination nodes, whereas, Broadcast packets are sent to all other destination nodes. For Multicast and Broadcast NoC, only one copy of a packet must be injected into the source router. The routers in the path then fork the packets to different output ports when necessary. Multicast and Broadcast can be selected as FULL, where all destinations can be included in packet destination list, or as PARTIAL where a user-defined subset of nodes (defined with MCAST_ENDP_LIST parameter) can be targeted in destination lists. The other nodes not marked in MCAST_ENDP_LIST can only receive unicast packets. '; |
$content='"UNICAST","MULTICAST_PARTIAL","MULTICAST_FULL","BROADCAST_PARTIAL","BROADCAST_FULL"'; |
$type="Combo-box"; |
($row,$coltmp)=add_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,undef,$show_noc,'noc_param',1); |
|
|
my $cast_type=$mpsoc->object_get_attribute('noc_param','CAST_TYPE'); |
my ($NE, $NR, $RAw, $EAw, $Fw) = get_topology_info($mpsoc); |
|
my $cast = $mpsoc->object_get_attribute('noc_param',"MCAST_ENDP_LIST"); |
if(!defined $cast){ |
my $h=0; |
my $n=""; |
for (my $i=0; $i<$NE; $i++){ |
$h+= (1<<$i%4); |
if(($i+1) % 4==0){ |
$n="$h".$n if($h<10); |
$n=chr($h-10+97).$n if($h>9); |
$h=0; |
} |
} |
$n="$h".$n if($h!=0); |
$n="'h".$n; |
$mpsoc->object_add_attribute('noc_param',"MCAST_ENDP_LIST",$n); |
$mpsoc->object_add_attribute_order('noc_param',"MCAST_ENDP_LIST"); |
# $mpsoc->object_add_attribute('noc_param',"MCAST_PRTLw",$NE); |
# $mpsoc->object_add_attribute_order('noc_param',"MCAST_PRTLw"); |
$cast=$n; |
} |
$b1->signal_connect("clicked" => sub{ |
$show_noc=($show_noc==1)?0:1; |
$mpsoc->object_add_attribute('setting','show_noc_setting',$show_noc); |
set_gui_status($mpsoc,"ref",1); |
}); |
|
#advance parameter start |
my $advc; |
my $adv_set=$mpsoc->object_get_attribute('setting','show_adv_setting'); |
if($adv_set == 0){ |
$advc= def_image_button("icons/down.png","Advance Parameters"); |
$table->attach ( $advc , 0, 2, $row,$row+1,'fill','shrink',2,2); |
$row++; |
|
if($cast_type eq '"MULTICAST_PARTIAL"' || $cast_type eq '"BROADCAST_PARTIAL"') { |
#$table->attach ( gen_label_help($info,"Muticast Node list"),0 , 2, $row,$row+1,'fill','shrink',2,2); |
$info='MCAST_ENDP_LIST is a one-hot coded number where the asserted bit indicates that the corresponding destination ID can be targeted in multicast/broadcast packets. The corresponding destinations with zero bit can only receive unicast packets.'; |
|
my $b1= def_image_button("icons/setting.png","Set"); |
my $bb= def_pack_hbox(FALSE,0,gen_label_in_left("$cast"),$b1); |
my $label=gen_label_in_left("Muticast Node list"); |
my $inf_bt= (defined $info)? gen_button_message ($info,"icons/help.png"):gen_label_in_left(" "); |
attach_widget_to_table ($table,$row,$label,$inf_bt,$bb,0); |
|
|
# $table->attach ( $bb , 2, 3, $row,$row+1,'fill','shrink',2,2); |
$row++; |
|
$b1->signal_connect("clicked" => sub{ |
set_multicast_list($mpsoc); |
|
}); |
} |
|
|
|
#advance parameter start |
# my $advc; |
# my $adv_set=$mpsoc->object_get_attribute('setting','show_adv_setting'); |
# |
# if($adv_set == 0){ |
# $advc= def_image_button("icons/down.png","Advance Parameters"); |
# $table->attach ( $advc , 0, 2, $row,$row+1,'fill','shrink',2,2); |
# $row++; |
# } |
|
my $adv_set= $show_noc; |
#SSA |
$label='SSA Enable'; |
$param='SSA_EN'; |
1006,19 → 1056,32
#($row,$coltmp)=add_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$wrra_show,'noc_param',undef); |
|
|
|
if($adv_set == 1){ |
$advc= def_image_button("icons/up.png","Advance Parameters"); |
$table->attach ( $advc , 0, 2, $row,$row+1,'fill','shrink',2,2); |
$row++; |
if($show_noc == 1){ |
$b1= def_image_button("icons/up.png","NoC Parameters"); |
$table->attach ( $b1 , 0, 2, $row,$row+1,'fill','shrink',2,2); |
$row++; |
} |
$advc->signal_connect("clicked" => sub{ |
$adv_set=($adv_set==1)?0:1; |
$mpsoc->object_add_attribute('setting','show_adv_setting',$adv_set); |
$b1->signal_connect("clicked" => sub{ |
$show_noc=($show_noc==1)?0:1; |
$mpsoc->object_add_attribute('setting','show_noc_setting',$show_noc); |
set_gui_status($mpsoc,"ref",1); |
}); |
|
|
|
|
# if($adv_set == 1){ |
# $advc= def_image_button("icons/up.png","Advance Parameters"); |
# $table->attach ( $advc , 0, 2, $row,$row+1,'fill','shrink',2,2); |
# $row++; |
# } |
# $advc->signal_connect("clicked" => sub{ |
# $adv_set=($adv_set==1)?0:1; |
# $mpsoc->object_add_attribute('setting','show_adv_setting',$adv_set); |
# set_gui_status($mpsoc,"ref",1); |
# }); |
|
|
#other fixed parameters |
|
|
1045,6 → 1108,135
} |
|
|
|
|
sub set_multicast_list{ |
my($mpsoc)=@_; |
my $window = def_popwin_size(50,40,"Select nodes invlove in multicasting ",'percent'); |
my $table= def_table(10,10,FALSE); |
my $row=0; |
my $col=0; |
|
my $init = $mpsoc->object_get_attribute('noc_param',"MCAST_ENDP_LIST"); |
$init =~ s/'h//g; |
my @arr= reverse split (//, $init); |
|
|
my $label = "Multicast Node list (hex fromat)"; |
my ($Ebox,$entry) = def_h_labeled_entry ($label); |
$entry->set_sensitive (FALSE); |
|
my @sel_options= ("Select","All","None","2n","3n","4n","2n+1","3n+1","3n+2","4n+1","4n+2","4n+3"); |
my $combo= gen_combo(\@sel_options, 0); |
$table->attach ($combo , 0, 1, $row,$row+1,'fill','shrink',2,2); |
#get the number of endpoints |
my ($NE, $NR, $RAw, $EAw, $Fw) = get_topology_info($mpsoc); |
my @check; |
|
|
|
my $sel_val="Init"; |
for (my $i=0; $i<$NE; $i++){ |
if($i%10 == 0){ $row++;$col=0;} |
my $box; |
my $l=$NE -$i-1; |
|
my $char = $arr[$l/4]; |
$char=0 if (!defined $char); |
my $hex = hex($char); |
my $bit = ($hex >> ($l%4)) & 1; |
($box,$check[$l])=def_h_labeled_checkbutton("$l"); |
$table->attach ($box , $col, $col+1, $row,$row+1,'fill','shrink',2,2); |
$col++; |
|
if($bit==1){ |
$check[$l]->set_active(TRUE); |
} |
|
$check[$l]-> signal_connect("toggled" => sub{ |
get_multicast_val ($mpsoc,$entry,$NE,@check)if($sel_val eq "Select"); |
}); |
} |
$row++; |
$col=0; |
|
$sel_val="Select"; |
get_multicast_val ($mpsoc,$entry,$NE,@check); |
|
$combo-> signal_connect("changed" => sub{ |
$sel_val=$combo->get_active_text(); |
my $n=1; |
my $r=0; |
return if ($sel_val eq "Select"); |
if ($sel_val eq "None"){ |
for (my $i=0; $i<$NE; $i++){$check[$i]->set_active(FALSE)}; |
get_multicast_val ($mpsoc,$entry,$NE,@check); |
$combo->set_active(0); |
return; |
} |
($n,$r)=sscanf("%dn+%d",$sel_val); |
if(!defined $r){ |
($n,$r)=sscanf("%dn",$sel_val); |
$r=0; |
$n=1 if(!defined $n); |
} |
|
for (my $i=0; $i<$NE; $i++){ |
if($i % $n == $r){ $check[$i]->set_active(TRUE);} |
} |
$combo->set_active(0); |
get_multicast_val ($mpsoc,$entry,$NE,@check); |
|
}); |
|
|
|
$table->attach ($Ebox , 0, 10, $row,$row+1,'fill','shrink',2,2);$row++; |
|
my $main_table=def_table(10,10,FALSE); |
|
my $ok = def_image_button('icons/select.png','OK'); |
$main_table->attach_defaults ($table , 0, 12, 0,11); |
$main_table->attach ($ok,5, 6, 11,12,'shrink','shrink',0,0); |
|
$ok->signal_connect('clicked', sub { |
my $s=get_multicast_val ($mpsoc,$entry,$NE,@check); |
my $n=$entry->get_text( ); |
$mpsoc->object_add_attribute('noc_param',"MCAST_ENDP_LIST",$n); |
# $mpsoc->object_add_attribute('noc_param',"MCAST_PRTLw",$s); |
set_gui_status($mpsoc,"ref",1); |
$window->destroy; |
}); |
|
|
|
|
my $scrolled_win = gen_scr_win_with_adjst($mpsoc,'gen_multicast'); |
add_widget_to_scrolled_win($main_table,$scrolled_win); |
$window->add($scrolled_win); |
$window->show_all(); |
} |
|
sub get_multicast_val { |
my ($mpsoc,$entry,$NE,@check)=@_; |
my $n=""; |
my $h=0; |
my $s=0; |
for (my $i=0; $i<$NE; $i++){ |
if($check[$i]->get_active()){$h+= (1<<$i%4);$s++;} |
if(($i+1) % 4==0){ |
$n="$h".$n if($h<10); |
$n=chr($h-10+97).$n if($h>9); |
$h=0; |
} |
} |
|
$n="$h".$n if($NE%4!=0); |
$n="'h".$n; |
$entry->set_text("$n"); |
return $s; |
|
} |
############# |
# config_custom_topology_gui |
############ |
/mpsoc_verilog_gen.pl
322,10 → 322,12
my $pass_param=""; |
my @params=$mpsoc->object_get_attribute_order('noc_param'); |
my $custom_topology = $mpsoc->object_get_attribute('noc_param','CUSTOM_TOPOLOGY_NAME'); |
my ($NE, $NR, $RAw, $EAw, $Fw) = get_topology_info($mpsoc); |
my %noc_info; |
if(defined $sample ){ |
my $ref=$mpsoc->object_get_attribute($sample,"noc_info"); |
%noc_info= %$ref; |
%noc_info= %$ref; |
($NE, $NR, $RAw, $EAw, $Fw) = get_topology_info_from_parameters($ref); |
} |
|
foreach my $p (@params){ |
333,6 → 335,10
my $val= (defined $sample) ? $noc_info{$p} :$mpsoc->object_get_attribute('noc_param',$p); |
next if($p eq "CUSTOM_TOPOLOGY_NAME"); |
$val=$custom_topology if($p eq "TOPOLOGY" && $val eq "\"CUSTOM\""); |
if($p eq 'MCAST_ENDP_LIST'){ |
|
$val="$NE".$val; |
} |
$param_v= $param_v."\tlocalparam $p=$val;\n"; |
$pass_param=$pass_param."\t\t.$p($p),\n"; |
#print "$p:$val\n"; |
376,7 → 382,11
$topology =~ s/"//g; |
$param_h.="\t#define IS_${topology}\n"; |
|
my ($NE, $NR, $RAw, $EAw, $Fw) = get_topology_info($mpsoc); |
|
|
|
|
my @params=$mpsoc->object_get_attribute_order('noc_param'); |
my $custom_topology = $mpsoc->object_get_attribute('noc_param','CUSTOM_TOPOLOGY_NAME'); |
foreach my $p (@params){ |
383,6 → 393,12
my $val=$mpsoc->object_get_attribute('noc_param',$p); |
next if($p eq "CUSTOM_TOPOLOGY_NAME"); |
$val=$custom_topology if($p eq "TOPOLOGY" && $val eq "\"CUSTOM\""); |
if($p eq "MCAST_ENDP_LIST" || $p eq "ESCAP_VC_MASK"){ |
$val="$NE".$val if($p eq 'MCAST_ENDP_LIST'); |
$val =~ s/\'/\\\'/g; |
$val="\"$val\""; |
} |
|
$param_h=$param_h."\t#define $p\t$val\n"; |
|
#print "$p:$val\n"; |
415,8 → 431,10
#add_text_to_string (\$pass_param,".CVw(CVw)\n"); |
|
|
#remove 'b and 'h |
#$param_h =~ s/\d\'b/ /g; |
#$param_h =~ s/\'h/ /g; |
|
|
return $param_h; |
} |
|
448,7 → 466,8
.reset(noc_reset_in), |
.clk(noc_clk_in), |
.chan_in_all(ni_chan_out), |
.chan_out_all(ni_chan_in) |
.chan_out_all(ni_chan_in), |
.router_event( ) |
); |
|
|
/network_maker.pl
2837,6 → 2837,7
#generate_connection_v($self,$info,$dir); |
add_routing_instance_v($self,$info,$dir); |
add_noc_instance_v($self,$info,$dir); |
add_noc_custom_h($self,$info,$dir); |
save_topology_parameter_object_file($self,$info); |
|
#create the file list |
/run_time_jtag_debug.pl
46,9 → 46,9
|
my $NAME = 'Soure Probe'; |
my $path = ""; |
our $FONT_SIZE='default'; |
our $ICON_SIZE='default'; |
|
|
|
my %memory; |
my %status; |
|
60,9 → 60,7
my $paths_file= "$project_dir/mpsoc/perl_gui/lib/Paths"; |
if (-f $paths_file){#} && defined $ENV{PRONOC_WORK} ) { |
my $paths= do $paths_file; |
my %p=%{$paths}; |
$FONT_SIZE= $p{'GUI_SETTING'}{'FONT_SIZE'} if (defined $p{'GUI_SETTING'}{'FONT_SIZE'}); |
$ICON_SIZE= $p{'GUI_SETTING'}{'ICON_SIZE'} if (defined $p{'GUI_SETTING'}{'ICON_SIZE'}); |
set_gui_setting($paths); |
} |
|
set_defualt_font_size(); |
/simulator.pl
45,8 → 45,8
$tops{Vpck_inj} = "--top-module packet_injector_verilator"; |
my $target_dir= "$ENV{PRONOC_WORK}/simulate"; |
|
my $dir = Cwd::getcwd(); |
my $project_dir = abs_path("$dir/.."); |
|
my $project_dir = get_project_dir()."/mpsoc/"; |
my $src_verilator_dir="$project_dir/src_verilator"; |
my $src_c="$project_dir/src_c"; |
my $src_noc_dir="$project_dir/rtl/src_noc"; |
73,6 → 73,7
push (@files,$src_noc_dir); |
push (@files,"$project_dir/rtl/arbiter.v"); |
push (@files,"$project_dir/rtl/main_comp.v"); |
push (@files,"$project_dir/rtl/pronoc_def.v"); |
|
|
#my @files=( |
103,8 → 104,8
} |
copy_file_and_folders (\@files,$project_dir,$target_modelsim_dr); |
|
|
|
|
|
#check if we have a custom topology |
my $topology=$simulate->object_get_attribute('noc_param','TOPOLOGY'); |
150,6 → 151,13
return; |
} |
|
my $r; |
#copy nettrace synful |
dircopy("$src_c/netrace-1.0","$obj_dir/netrace-1.0") or $r=$!; |
dircopy("$src_c/synfull","$obj_dir/synful") or $r=$!; |
add_colored_info($info_text,"ERROR: $r\n","red") if(defined $r ) ; |
|
|
#copy simulation c header files |
@files = File::Find::Rule->file() |
->name( '*.h') |
158,16 → 166,13
copy_file_and_folders (\@files,$project_dir,$obj_dir); |
copy($testbench_file,"$obj_dir/testbench.cpp"); |
|
my $r; |
#copy nettrace |
dircopy("$src_c/netrace-1.0","$obj_dir/netrace-1.0") or $r=$!; |
add_colored_info($info_text,"ERROR: $r\n","red") if(defined $r ) ; |
|
|
#compile the testbench |
my $param_h=gen_noc_param_h($simulate); |
my $text = gen_sim_parameter_h($param_h,$includ_h,$ne,$nr,$router_p,$fifow); |
|
$param_h =~ s/\d\'b/ /g; |
|
open(FILE, ">$obj_dir/parameter.h") || die "Can not open: $!"; |
print FILE "$text"; |
|
392,7 → 397,8
my $table=def_table(10,2,FALSE); |
my $row=0; |
|
my $scrolled_win = add_widget_to_scrolled_win ($table); |
|
my $scrolled_win = add_widget_to_scrolled_win ($table,gen_scr_win_with_adjst($self,'noc_conf_scr_win')); |
|
my $ok = def_image_button('icons/select.png','_OK',FALSE,1); |
my $import = def_image_button('icons/import.png','I_mport',FALSE,1); |
465,14 → 471,43
$exe_files="$exe_files,$name"; |
} |
} |
|
my $model_obj = gen_combobox_object ($self,$sample, "sof_file", $exe_files, undef,'ref_set_win',1); |
attach_widget_to_table ($table,$row,gen_label_in_left(" Verilated Model:"),gen_button_message ("Select the verilator simulation file. Different NoC simulators can be generated using Generate NoC configuration tab.","icons/help.png"), |
gen_combobox_object ($self,$sample, "sof_file", $exe_files, undef,'ref_set_win',1)); $row++; |
|
$model_obj); $row++; |
|
my $cast_type= '"UNICAST"'; |
|
#get simulation parameters here |
my $s=$self->object_get_attribute($sample,"sof_file"); |
if (defined $s){ |
my ($infobox,$info)= create_txview(); |
my $sof=get_sim_bin_path($self,$sample,$info); |
my ($name,$path,$suffix) = fileparse("$sof",qr"\..[^.]*$"); |
my $sof_info= "$path$name.inf"; |
|
my $pp= do $sof_info ; |
my $p=$pp->{'noc_param'}; |
$cast_type = $p->{'CAST_TYPE'}; |
$cast_type= '"UNICAST"' if (!defined $cast_type); |
} |
|
my $trf_info = "Select of the following traffic models: |
1- Synthetic |
2- Task-graph : |
The task graph traffic pattern can be generated |
using ProNoC trace generator |
3- Netrace: |
Dependency-Tracking Trace-Based Network-on-Chip |
Simulation. For downloading the trace files and more |
information refere to https://www.cs.utexas.edu/~netrace/ |
4- SynFull: |
Synthetic Traffic Models Capturing a Full Range |
of Cache Coherent Behaviour |
https://github.com/mariobadr/synfull-isca |
"; |
|
|
my $coltmp=0; |
($row,$coltmp)=add_param_widget ($self, "Traffic Type", "TRAFFIC_TYPE", "Synthetic", 'Combo-box', "Synthetic,Task-graph", undef, $table,$row,undef,1, $sample, 1,'ref_set_win'); |
($row,$coltmp)=add_param_widget ($self, "Traffic Type", "TRAFFIC_TYPE", "Synthetic", 'Combo-box', "Synthetic,Task-graph,SynFull,Netrace", $trf_info, $table,$row,undef,1, $sample, 1,'ref_set_win'); |
|
my $traffictype=$self->object_get_attribute($sample,"TRAFFIC_TYPE"); |
my $MIN_PCK_SIZE=$self->object_get_attribute($sample,"MIN_PCK_SIZE"); |
607,6 → 642,31
} |
|
|
if ($cast_type ne '"UNICAST"'){ |
my $min=$self->object_get_attribute($sample,'MCAST_PCK_SIZ_MIN'); |
my $max=$self->object_get_attribute($sample,'MCAST_PCK_SIZ_MAX'); |
$min=5 if(!defined $min); |
$max=5 if(!defined $max); |
$max= $min if($max< $min); |
|
|
my $s = ($cast_type eq '"BROADCAST_FULL"' || $cast_type eq '"BROADCAST_PARTIAL"')? "Broadcast" : "Milticast"; |
my $info1= "Define the percentage ratio of $s traffic towards Unicast traffic"; |
my $info2= "Define how destinations is selected in Multicast packets"; |
($row,$coltmp)=add_param_widget ($self, "$s Node Select" , "MCAST_TRAFFIC_TYPE" , "Uniform-Random", 'Combo-box', "Uniform-Random", $info1, $table,$row,undef,1, $sample); |
($row,$coltmp)=add_param_widget ($self, "$s Traffic Ratio", "MCAST_TRAFFIC_RATIO", 5 , 'Spin-button', "0,100,1" , $info2, $table,$row,undef,1, $sample); |
|
($row,$coltmp)=add_param_widget ($self, "$s min pck size", "MCAST_PCK_SIZ_MIN", 5 , 'Spin-button', "1,$max,1" , $info2, $table,$row,undef,1, $sample,1,'ref_set_win'); |
|
($row,$coltmp)=add_param_widget ($self, "$s max pck size", "MCAST_PCK_SIZ_MAX", 5 , 'Spin-button', "$min,100,1" , $info2, $table,$row,undef,1, $sample,1,'ref_set_win'); |
|
|
|
} |
|
|
|
|
my $d= { label=>'number of message class:', param_name=>'MESSAGE_CLASS', type=>'Spin-button', default_val=>0, content=>"0,256,1", info=>"Number of packet message classes. Each message class can be configured to use specefic subset of avilable VCs", param_parent=>$sample, ref_delay=> 1, new_status=>'ref_set_win'}; |
($row,$coltmp)=add_param_widget ($self, $d->{label}, $d->{param_name}, $d->{default_val}, $d->{type}, $d->{content}, $d->{info}, $table,$row,undef,1, $d->{param_parent}, $d->{ref_delay}, $d->{new_status}); |
my $num=$self->object_get_attribute($sample,"MESSAGE_CLASS"); |
675,6 → 735,7
my $s=$self->object_get_attribute($sample,"sof_file"); |
#check if injection ratios are valid |
my $r=$self->object_get_attribute($sample,"ratios"); |
|
my $h; |
|
my $t=$self->object_get_attribute($sample,"PCK_SIZ_SEL"); |
690,7 → 751,12
$h= check_hotspot_parameters($self,$sample); |
} |
|
if(defined $s && defined $r && !defined $h) { |
my $v; |
if(defined $r ){ |
$v=check_inserted_ratios($r); |
} |
|
if(defined $s && defined $r && defined $v && !defined $h) { |
#$set_win->destroy; |
$set_win->hide(); |
$self->object_add_attribute("active_setting",undef,undef); |
702,7 → 768,7
message_dialog($m); |
} elsif (! defined $r) { |
message_dialog("Please define valid injection ratio(s)!"); |
} else { |
} elsif (defined $h){ |
message_dialog("$h"); |
} |
} |
771,6 → 837,129
} |
|
|
if($traffictype eq "SynFull"){ |
#get the synful model names |
my $models_dir = get_project_dir()."/mpsoc/src_c/synfull/generated-models/"; |
my ($flist)=get_file_list_by_extention ("$models_dir",".model"); |
|
|
my $model_obj = gen_combobox_object ($self,$sample, "MODEL_NAME", $flist, undef,undef,undef); |
attach_widget_to_table ($table,$row,gen_label_in_left(" Traffic Model name:"),gen_button_message ("Select an application traffic model.","icons/help.png"), |
$model_obj); $row++; |
|
|
|
my @custominfo = ( |
{ label=>"Synful Flit-size:(Bytes)", param_name=>'SYNFUL_FLITw', type=>'Spin-button', default_val=>4, content=>"4,72,4", info=>"The synful flit size in Byte. It defines the number of flits that should be set to ProNoC for each synful packets. The ProNoC packet size is : |
\t Ceil( synful packet size/synful flit size). ", param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
{ label=>'Configuration name:', param_name=>'line_name', type=>'Entry', default_val=>$sample, content=>undef, info=>"NoC configuration name. This name will be shown in load-latency graph for this configuration", param_parent=>$sample, ref_delay=> undef, new_status=>undef}, |
{ label=>"Total packet number limit:", param_name=>'PCK_NUM_LIMIT', type=>'Spin-button', default_val=>200000, content=>"2,$max_pck_num,1", info=>"Simulation will stop when total number of sent packets by all nodes reaches packet number limit or total simulation clock reach its limit", param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
{ label=>"Simulator clocks limit:", param_name=>'SIM_CLOCK_LIMIT', type=>'Spin-button', default_val=>100000, content=>"2,$max_sim_clk,1", info=>"Each node stops sending packets when it reaches packet number limit or simulation clock number limit", param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
{ label=>"Markov Chain Random seed:", param_name=>'RND_SEED', type=>'Spin-button', default_val=>53432145, content=>"0,999999999,1", info=>"The seed valus is passe to synfull random number generator.", param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
{ label=>"Exit at steady state:", param_name=>'EXIT_STEADY', type=>'Check-box', default_val=>0, content=>"1", info=>"Exit the simulation when it reaches to a steady state.", param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
|
|
|
); |
|
|
|
foreach my $d (@custominfo) { |
($row,$coltmp)=add_param_widget ($self, $d->{label}, $d->{param_name}, $d->{default_val}, $d->{type}, $d->{content}, $d->{info}, $table,$row,undef,1, $d->{param_parent}, $d->{ref_delay}, $d->{new_status}); |
|
} |
|
$ok->signal_connect("clicked"=> sub{ |
#check if sof file has been selected |
my $s=$self->object_get_attribute($sample,"MODEL_NAME"); |
if(!defined $s){ |
message_dialog("Please select a SynFull traffic model"); |
return; |
} |
|
|
#$set_win->destroy; |
$set_win->hide(); |
$self->object_add_attribute("active_setting",undef,undef); |
set_gui_status($self,"ref",1); |
|
}); |
|
|
|
}#SynFull |
|
|
if($traffictype eq "Netrace"){ |
#get the synful model names |
my $models_dir = "$ENV{PRONOC_WORK}/simulate/netrace"; |
my ($flist)=get_file_list_by_extention ("$models_dir",".bz2"); |
|
my $model_obj = gen_combobox_object ($self,$sample, "MODEL_NAME", $flist, undef,undef,undef); |
my $download=def_image_button("icons/download.png",'Download'); |
my $box =def_hbox(FALSE, 0); |
$box->pack_start( $model_obj , 1,1, 0); |
$box->pack_start( $download, 0, 1, 3); |
|
attach_widget_to_table ($table,$row,gen_label_in_left(" Trace name:"),gen_button_message ("Select a netrace trace file. You can download traces using download button.","icons/help.png"), |
$box); |
|
|
$row++; |
|
|
|
my @custominfo = ( |
{ label=>'Configuration name:', param_name=>'line_name', type=>'Entry', default_val=>$sample, content=>undef, info=>"NoC configuration name. This name will be shown in load-latency graph for this configuration", param_parent=>$sample, ref_delay=> undef, new_status=>undef}, |
{ label=>"Total packet number limit:", param_name=>'PCK_NUM_LIMIT', type=>'Spin-button', default_val=>200000, content=>"2,$max_pck_num,1", info=>"Simulation will stop when total number of sent packets by all nodes reaches packet number limit or total simulation clock reach its limit", param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
#{ label=>"Simulator clocks limit:", param_name=>'SIM_CLOCK_LIMIT', type=>'Spin-button', default_val=>100000, content=>"2,$max_sim_clk,1", info=>"Each node stops sending packets when it reaches packet number limit or simulation clock number limit", param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
{ label=>"ignore dependencies:", param_name=>'IGNORE_DPNDCY', type=>'Check-box', default_val=>0, content=>"1", info=>"Ignore dependency between packets", param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
{ label=>"Enable reader throttling:", param_name=>'READER_THRL', type=>'Check-box', default_val=>0, content=>"1", info=>"If Reader throttling is enabled, simulators offloads much of the work of reading and tracking packets to the Netrace reader, |
which simplifies the code in the network simulator.", param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
{ label=>"trace file start region:", param_name=>'START_RGN', type=>'Spin-button', default_val=>0, content=>"0,10000,1", info=>undef, param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
{ label=>"Netrace to Pronoc clk ratio:", param_name=>'SPEED_UP', type=>'Spin-button', default_val=>1, content=>"1,99,1", info=>"The ratio of netrace frequency to pronoc.The higher value results in higher injection ratio to the NoC. Default is one\n", param_parent=>$sample, ref_delay=>undef, new_status=>undef}, |
|
|
|
|
|
|
); |
|
|
|
foreach my $d (@custominfo) { |
($row,$coltmp)=add_param_widget ($self, $d->{label}, $d->{param_name}, $d->{default_val}, $d->{type}, $d->{content}, $d->{info}, $table,$row,undef,1, $d->{param_parent}, $d->{ref_delay}, $d->{new_status}); |
|
} |
|
$ok->signal_connect("clicked"=> sub{ |
#check if sof file has been selected |
my $s=$self->object_get_attribute($sample,"MODEL_NAME"); |
if(!defined $s){ |
message_dialog("Please select a SynFull traffic model"); |
return; |
} |
|
|
#$set_win->destroy; |
$set_win->hide(); |
$self->object_add_attribute("active_setting",undef,undef); |
set_gui_status($self,"ref",1); |
|
}); |
|
$download->signal_connect("clicked"=> sub{ download_netrace("$models_dir") }); |
|
|
|
}#netrace |
|
|
|
|
|
|
add_widget_to_scrolled_win ($mtable,$set_win); |
|
$set_win->show_all(); |
800,9 → 989,9
next if($status ne "run"); |
next if(!check_sim_sample($simulate,$sample,$info)); |
my $traffictype=$simulate->object_get_attribute($sample,"TRAFFIC_TYPE"); |
run_synthetic_simulation($simulate,$info,$sample,$name) if($traffictype eq "Synthetic"); |
run_task_simulation($simulate,$info,$sample,$name) if($traffictype eq "Task-graph"); |
|
if($traffictype eq "Synthetic") {run_synthetic_simulation($simulate,$info,$sample,$name);} |
elsif($traffictype eq "Task-graph"){run_task_simulation($simulate,$info,$sample,$name) ;} |
else {run_trace_simulation($simulate,$info,$sample,$name);} |
|
} |
|
878,7 → 1067,31
$custom_sv.="localparam CUSTOM_NODE_NUM=0;\n\twire [NEw-1 : 0] custom_traffic_t [NE-1 : 0];\n\twire [NE-1 : 0] custom_traffic_en; |
"; |
} |
#multicast |
my $mcast=""; |
my $mcast_sv=""; |
my $p= $simulate->object_get_attribute ($sample,"noc_info"); |
my $cast_type=$p->{"CAST_TYPE"}; |
if ($cast_type ne '"UNICAST"'){ |
#$self->object_get_attribute ($sample, "MCAST_TRAFFIC_TYPE"); |
my $mr = $simulate->object_get_attribute ($sample, "MCAST_TRAFFIC_RATIO"); |
my $mmax = $simulate->object_get_attribute ($sample, "MCAST_PCK_SIZ_MAX"); |
my $mmin = $simulate->object_get_attribute ($sample, "MCAST_PCK_SIZ_MIN"); |
|
$mcast = "-u \"$mr,$mmin,$mmax\""; |
$mcast_sv.= "localparam MCAST_TRAFFIC_RATIO = $mr;\n"; |
$mcast_sv.= "localparam MCAST_PCK_SIZ_MAX = $mmax;\n"; |
$mcast_sv.= "localparam MCAST_PCK_SIZ_MIN = $mmin;\n"; |
}else { |
$mcast_sv.= "localparam MCAST_TRAFFIC_RATIO = 0;\n"; |
$mcast_sv.= "localparam MCAST_PCK_SIZ_MAX = 0;\n"; |
$mcast_sv.= "localparam MCAST_PCK_SIZ_MIN = 0;\n"; |
} |
|
|
|
|
|
my $classes; |
my $num=$simulate->object_get_attribute($sample,"MESSAGE_CLASS"); |
$classes.="-p 100" if($num==0); |
979,11 → 1192,14
MAX_PACKET_SIZE=$MAX_PCK_SIZE, |
STOP_PCK_NUM=$PCK_NUM_LIMIT, |
STOP_SIM_CLK=$SIM_CLOCK_LIMIT; |
|
|
$hotspot_sv |
|
$custom_sv |
|
$mcast_sv |
|
$discrete_sv |
|
parameter INJRATIO=90; |
1053,16 → 1269,16
if ($simulator eq 'Modelsim'){ |
add_info($info, "Run $bin with injection ratio of $ratio_in \% \n"); |
my $out="$out_path/modelsim/work$c"; |
$cmd=" xterm -e bash -c ' cd $out; sed -i \"s/ INJRATIO=\[\[:digit:\]\]\\+/ INJRATIO=$ratio_in/\" $out/sim_param.sv; rm -Rf rtl_work; $vsim -c -do $out/model.tcl -l $out_path/sim_out$ratio_in;' &\n "; |
$cmd=" xterm -e bash -c ' cd $out; sed -i \"s/ INJRATIO=\[\[:digit:\]\]\\+/ INJRATIO=$ratio_in/\" $out/sim_param.sv; rm -Rf rtl_work; $vsim -c -do $out/model.tcl -l $out_path/sim_out$ratio_in;' &\n "; |
|
}elsif ($simulator eq 'Modelsim gui'){ |
add_info($info, "Run $bin with injection ratio of $ratio_in \% \n"); |
my $out="$out_path/modelsim/work$c"; |
$cmd="cd $out; sed -i \"s/ INJRATIO=\[\[:digit:\]\]\\+/ INJRATIO=$ratio_in/\" $out/sim_param.sv; rm -Rf rtl_work; $vsim -do $out/model.tcl -l $out_path/sim_out$ratio_in; "; |
$cmd="cd $out; sed -i \"s/ INJRATIO=\[\[:digit:\]\]\\+/ INJRATIO=$ratio_in/\" $out/sim_param.sv; rm -Rf rtl_work; $vsim -do $out/model.tcl -l $out_path/sim_out$ratio_in; "; |
|
}else{ |
add_info($info, "Run $bin with injection ratio of $ratio_in \% \n"); |
$cmd="$bin -t \"$patern\" $pck_size -T $thread_num -n $PCK_NUM_LIMIT -c $SIM_CLOCK_LIMIT -i $ratio_in $classes $hotspot $custom > $out_path/sim_out$ratio_in & "; |
$cmd="$bin -t \"$patern\" $pck_size -T $thread_num -n $PCK_NUM_LIMIT -c $SIM_CLOCK_LIMIT -i $ratio_in $classes $hotspot $custom $mcast > $out_path/sim_out$ratio_in & "; |
|
} |
$cmds .=$cmd; |
1118,45 → 1334,59
|
} |
|
sub extract_and_update_noc_sim_statistic { |
my ($simulate,$sample,$ratio_in,$stdout)=@_; |
my @results = split("#node,",$stdout); |
|
sub extract_st_by_name{ |
my($st_name, $stdout)=@_; |
|
my @results = split($st_name,$stdout); |
my %statistcs; |
my @lines = split("\n",$results[1]); |
#first line is statsitic names |
my @lines = split("\n",$results[1]); |
my @names; |
my $i=0; |
foreach my $line (@lines){ |
$line=remove_all_white_spaces($line); |
$line =~ s/^#//g; #remove # from beginig of each line in modelsim |
if($i==0){ |
@names=split(",",$line); |
|
}else{ |
if($i==0) { |
$i++; |
next; |
} |
elsif($i==1){ |
#first line is statsitic names |
@names=split(",",$line); |
$i++; |
next; |
}elsif(length($line)>1) { |
my @fileds=split(",",$line); |
my $j=0; |
#print ("ff :@fileds\n"); |
foreach my $f (@fileds){ |
unless($j==0){ |
$statistcs{$fileds[0]}{$names[$j-1]}=$f; |
$statistcs{$fileds[0]}{$names[$j]}=$f; |
} |
$j++; |
} |
$i++; |
}else{ #empty line end of endp statistic |
last; |
} |
$i++; |
|
} |
#print Dumper(\%statistcs); |
return %statistcs; |
} |
|
|
|
sub extract_and_update_noc_sim_statistic { |
my ($simulate,$sample,$ratio_in,$stdout)=@_; |
|
|
|
|
my $total_time =capture_number_after("Simulation clock cycles:",$stdout); |
|
my %packet_rsvd_per_core = capture_cores_data("total number of received packets:",$stdout); |
my %worst_rsvd_delay_per_core = capture_cores_data('worst-case-delay of received packets \(clks\):',$stdout); |
my %packet_sent_per_core = capture_cores_data("total number of sent packets:",$stdout); |
my %worst_sent_delay_per_core = capture_cores_data('worst-case-delay of sent packets \(clks\):',$stdout); |
|
next if (!defined $statistcs{"total"}{'avg_latency_pck'}); |
my %statistcs = extract_st_by_name("Endpoints Statistics:",$stdout); |
|
return if (!defined $statistcs{"total"}{'avg_latency_pck'}); |
update_result($simulate,$sample,"latency_result",$ratio_in,$statistcs{"total"}{'avg_latency_pck'}); |
update_result($simulate,$sample,"latency_flit_result",$ratio_in,$statistcs{"total"}{'avg_latency_flit'}); |
update_result($simulate,$sample,"sd_latency_result",$ratio_in,$statistcs{"total"}{'avg.std_dev'}); |
1173,7 → 1403,33
update_result($simulate,$sample,"worst_delay_rsvd_result",$ratio_in,$p,$statistcs{$p}{'rsvd_stat.worst_latency'}); |
update_result($simulate,$sample,"packet_sent_result",$ratio_in,$p,$statistcs{$p}{'sent_stat.pck_num'} ); |
update_result($simulate,$sample,"worst_delay_sent_result",$ratio_in,$p,$statistcs{$p}{'sent_stat.worst_latency'}); |
update_result($simulate,$sample,"flit_rsvd_result",$ratio_in,$p,$statistcs{$p}{'rsvd_stat.flit_num'}); |
update_result($simulate,$sample,"flit_sent_result",$ratio_in,$p,$statistcs{$p}{'sent_stat.flit_num'}); |
} |
|
my %st1 = extract_st_by_name("Endp_to_Endp flit_num:",$stdout); |
update_result($simulate,$sample,"endp-endp-flit_result",$ratio_in,\%st1); |
|
my %st2 = extract_st_by_name("Endp_to_Endp pck_num:",$stdout); |
update_result($simulate,$sample,"endp-endp-pck_result",$ratio_in,\%st2); |
|
my %st3 = extract_st_by_name("Routers' statistics:",$stdout); |
foreach my $p (sort keys %st3){ |
update_result($simulate,$sample,"flit_per_router_result",$ratio_in,$p,$st3{$p}{'flit_in'}); |
update_result($simulate,$sample,"packet_per_router_result",$ratio_in,$p,$st3{$p}{'pck_in'}); |
my $tmp= ($st3{$p}{'flit_in_buffered'}*100) / $st3{$p}{'flit_in'}; |
#print " $tmp= ($st3{$p}{'flit_in_buffered'}*100) / $st3{$p}{'flit_in'};\n"; |
update_result($simulate,$sample,"flit_buffered_router_ratio",$ratio_in,$p,$tmp); |
$tmp= ($st3{$p}{'flit_in_bypassed'}*100) / $st3{$p}{'flit_in'}; |
update_result($simulate,$sample,"flit_bypass_router_ratio",$ratio_in,$p,$tmp); |
|
} |
|
#my $p= $simulate->object_get_attribute ($sample,"noc_info"); |
# my $TOPOLOGY=$p->{"TOPOLOGY"}; |
#print "$TOPOLOGY\n"; |
|
|
} |
|
|
1250,6 → 1506,103
|
|
|
|
sub run_trace_simulation{ |
my ($simulate,$info,$sample,$name)=@_; |
my $log= (defined $name)? "$ENV{PRONOC_WORK}/simulate/$name.log": "$ENV{PRONOC_WORK}/simulate/sim.log"; |
|
|
my $bin=get_sim_bin_path($simulate,$sample,$info); |
|
|
my $project_dir = get_project_dir(); |
$bin= "$project_dir/$bin" if(!(-f $bin)); |
|
|
my $cpu_num = $simulate->object_get_attribute('compile', 'cpu_num'); |
$cpu_num = 1 if (!defined $cpu_num); |
|
my @paralel_ratio; |
|
my $jobs=0; |
my $c=0; |
my $cmds=""; |
my $out_path ="$ENV{PRONOC_WORK}/simulate/"; |
my $thread_num = $simulate->object_get_attribute('compile', 'thread_num'); |
$thread_num = 1 if (!defined $thread_num); |
|
my $model= $simulate->object_get_attribute($sample,'MODEL_NAME'); |
|
add_info($info, "Run $bin for $model model \n"); |
|
my $cmd="$bin -T $thread_num "; |
my $traffictype=$simulate->object_get_attribute($sample,"TRAFFIC_TYPE"); |
if($traffictype eq "Netrace"){ |
my $PCK_NUM_LIMIT=$simulate->object_get_attribute ($sample,"PCK_NUM_LIMIT"); |
my $IGNORE_DPNDCY=$simulate->object_get_attribute ($sample,"IGNORE_DPNDCY"); |
my $READER_THRL=$simulate->object_get_attribute ($sample,"READER_THRL"); |
my $START_RGN=$simulate->object_get_attribute ($sample,"START_RGN"); |
my $SPEED_UP=$simulate->object_get_attribute ($sample,"SPEED_UP"); |
|
my $models_dir = "$ENV{PRONOC_WORK}/simulate/netrace"; |
|
$cmd .="-F $models_dir/$model.bz2 -n $PCK_NUM_LIMIT -r $START_RGN -v 0 -s $SPEED_UP"; |
$cmd .=" -l " if ($READER_THRL eq "1\'b1" ); |
$cmd .=" -d " if ($IGNORE_DPNDCY eq "1\'b1"); |
|
|
|
|
|
}else{#synful |
my $SIM_CLOCK_LIMIT=$simulate->object_get_attribute ($sample,"SIM_CLOCK_LIMIT"); |
my $PCK_NUM_LIMIT=$simulate->object_get_attribute ($sample,"PCK_NUM_LIMIT"); |
my $RND_SEED=$simulate->object_get_attribute ($sample,"RND_SEED"); |
my $EXIT_STEADY=$simulate->object_get_attribute ($sample,"EXIT_STEADY"); |
my $FLITw=$simulate->object_get_attribute ($sample,"SYNFUL_FLITw"); |
|
|
my $models_dir = get_project_dir()."/mpsoc/src_c/synfull/generated-models/"; |
$cmd .=" -S $models_dir/$model.model -n $PCK_NUM_LIMIT -r $RND_SEED -c $SIM_CLOCK_LIMIT -v 0 -w $FLITw"; |
$cmd .=" -s " if ($EXIT_STEADY eq "1\'b1"); |
|
|
|
} |
$cmd .=" > $out_path/sim_out"; |
add_info($info, "$cmd \n"); |
|
my ($stdout,$exit,$stderr)=run_cmd_in_back_ground_get_stdout("$cmd\n wait\n"); |
if($exit || (length $stderr >4)){ |
add_colored_info($info, "Error in running simulation: $stderr \n",'red'); |
$simulate->object_add_attribute ($sample,"status","failed"); |
$simulate->object_add_attribute('status',undef,'ideal'); |
return; |
} |
|
|
|
$stdout = load_file("$out_path/sim_out"); |
my @errors = unix_grep("$out_path/sim_out","ERROR:"); |
if (scalar @errors ){ |
add_colored_info($info, "Error in running simulation: @errors \n",'red'); |
$simulate->object_add_attribute ($sample,"status","failed"); |
$simulate->object_add_attribute('status',undef,'ideal'); |
return; |
} |
|
extract_and_update_noc_sim_statistic ($simulate,$sample,0,$stdout); |
|
|
set_gui_status($simulate,"ref",2); |
|
|
$simulate->object_add_attribute ($sample,"status","done"); |
} |
|
|
|
|
########## |
# check_sample |
########## |
1427,10 → 1780,11
|
|
my @pages =( |
{page_name=>" Avg. throughput/latency", page_num=>0}, |
{page_name=>" Injected Packet ", page_num=>1}, |
{page_name=>" Worst-Case Delay ",page_num=>2}, |
{page_name=>" Execution Time ",page_num=>3}, |
{page_name=>" Average/Total ", page_num=>0}, |
{page_name=>" Per node ", page_num=>1}, |
#{page_name=>" Worst-Case Delay ",page_num=>2}, |
#{page_name=>" Execution Time ",page_num=>3}, |
{page_name=>" Heat-Map. ",page_num=>4}, |
); |
|
|
1441,20 → 1795,42
{ type=>"2D_line", page_num=>0, graph_name=> "Avg. flit Latency per hop", result_name => "latency_perhop_result", X_Title=> 'Desired Avg. Injected Load Per Router (flits/clock (%))', Y_Title=>'Avg. Flit Latency per hop (clock)', Z_Title=>undef, Y_Max=>100}, |
{ type=>"2D_line", page_num=>0, graph_name=> "Avg. throughput", result_name => "throughput_result", X_Title=> 'Desired Avg. Injected Load Per Router (flits/clock (%))', Y_Title=>'Avg. Throughput (flits/clock (%))', Z_Title=>undef,Y_Max=>100}, |
{ type=>"2D_line", page_num=>0, graph_name=> "Avg. SD latency", result_name => "sd_latency_result", X_Title=> 'Desired Avg. Injected Load Per Router (flits/clock (%))', Y_Title=>'Latency Standard Deviation (clock)', Z_Title=>undef}, |
|
{ type=>"2D_line", page_num=>0, graph_name=> "Worst pck latency (clk)", result_name => "worst_latency_result", X_Title=> 'Desired Avg. Injected Load Per Router (flits/clock (%))', Y_Title=>'Worst Packet Latency (clock)', Z_Title=>undef}, |
{ type=>"2D_line", page_num=>0, graph_name=> "Min pck latency (clk)", result_name => "min_latency_result", X_Title=> 'Desired Avg. Injected Load Per Router (flits/clock (%))', Y_Title=>'Minimum Packet Latency (clock)', Z_Title=>undef}, |
{ type=>"2D_line", page_num=>0, graph_name=> "Total injected pck", result_name =>"injected_pck_total" , X_Title=> 'Desired Avg. Injected Load Per Router (flits/clock (%))', Y_Title=>'Total Injected packets', Z_Title=>undef}, |
{ type=>"2D_line", page_num=>0, graph_name=> "Total injected flit",result_name =>"injected_flit_total", X_Title=> 'Desired Avg. Injected Load Per Router (flits/clock (%))', Y_Title=>'Total Injected Fslits', Z_Title=>undef}, |
{ type=>"2D_line", page_num=>0, graph_name=> "Execuation Cycles", result_name => "exe_time_result",X_Title=>'Desired Avg. Injected Load Per Router (flits/clock (%))' , Y_Title=>'Total Simulation Time (clk)', Z_Title=>undef}, |
|
|
|
{ type=>"3D_bar", page_num=>1, graph_name=> "Received", result_name => "packet_rsvd_result", X_Title=>'Core ID' , Y_Title=>'Received Packets Per Router', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>1, graph_name=> "Sent", result_name => "packet_sent_result", X_Title=>'Core ID' , Y_Title=>'Sent Packets Per Router', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>2, graph_name=> "Received", result_name => "worst_delay_rsvd_result",X_Title=>'Core ID' , Y_Title=>'Worst-Case Delay (clk)', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>2, graph_name=> "Sent", result_name => "worst_delay_sent_result",X_Title=>'Core ID' , Y_Title=>'Worst-Case Delay (clk)', Z_Title=>undef}, |
{ type=>"2D_line", page_num=>3, graph_name=> "-", result_name => "exe_time_result",X_Title=>'Desired Avg. Injected Load Per Router (flits/clock (%))' , Y_Title=>'Total Simulation Time (clk)', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>1, graph_name=> "Received packets per Endp", result_name => "packet_rsvd_result", X_Title=>'Endpoint ID' , Y_Title=>'Received Packets Per Endpoint', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>1, graph_name=> "Sent packets per Endp", result_name => "packet_sent_result", X_Title=>'Endpoint ID' , Y_Title=>'Sent Packets Per Endpoint', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>1, graph_name=> "Received flits per Endp", result_name => "flit_rsvd_result", X_Title=>'Endpoint ID' , Y_Title=>'Received Flits Per Endpoint', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>1, graph_name=> "Sent flits per Endp", result_name => "flit_sent_result", X_Title=>'Endpoint ID' , Y_Title=>'Sent Packets Flits Endpoint', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>1, graph_name=> "Flits per Router", result_name => "flit_per_router_result", X_Title=>'Router ID' , Y_Title=>'Received Flits Per Router', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>1, graph_name=> "Packets per Router", result_name => "packet_per_router_result", X_Title=>'Router ID' , Y_Title=>'Received Packets Per Router', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>1, graph_name=> "Worst Received pck latency per Endp", result_name => "worst_delay_rsvd_result",X_Title=>'Endpoint ID' , Y_Title=>'Worst-Case Delay (clk)', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>1, graph_name=> "Worst Sent pck latency per Endp", result_name => "worst_delay_sent_result",X_Title=>'Endpoint ID' , Y_Title=>'Worst-Case Delay (clk)', Z_Title=>undef}, |
|
{ type=>"3D_bar", page_num=>1, graph_name=> "Buffered Flit in Ratio Per Router", result_name => "flit_buffered_router_ratio",X_Title=>'Router ID' , Y_Title=>'Flit in buffered in router/Flit in (%)', Z_Title=>undef}, |
{ type=>"3D_bar", page_num=>1, graph_name=> "Bypassed Flit in Ratio Per Router", result_name => "flit_bypass_router_ratio",X_Title=>'Router ID' , Y_Title=>'Flit in bypassed in router/Flit in (%)', Z_Title=>undef}, |
|
|
|
|
|
|
|
|
|
|
|
|
{ type=>"Heat-map", page_num=>4, graph_name=> "Select", result_name => "undef",X_Title=>'-' , Y_Title=> undef, Z_Title=>undef}, |
{ type=>"Heat-map", page_num=>4, graph_name=> "Endp-2-Endp Flit-num", result_name => "endp-endp-flit_result",X_Title=>'total flit number sent from an endpoint to another' , Y_Title=> undef, Z_Title=>undef}, |
{ type=>"Heat-map", page_num=>4, graph_name=> "Endp-2-Endp Packet-num", result_name => "endp-endp-pck_result",X_Title=>'total packet number sent from an endpoint to another' , Y_Title=> undef, Z_Title=>undef}, |
|
|
); |
|
|
1554,3 → 1930,65
return ($core_num, -1);#off |
} |
|
sub download_netrace{ |
my ($path) =@_; |
#create path if it is not exist |
unless (-d $path){ |
mkpath("$path",1,01777); |
} |
my $window = def_popwin_size(30,85,"Netrace download",'percent'); |
my $table = def_table(1, 1, FALSE); |
my $scrolled_win = add_widget_to_scrolled_win($table); |
|
|
my @links =( |
{ label=>"blackscholes simlarge (907M) ",name=>"blackscholes_64c_simlarge.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/blackscholes_64c_simlarge.tra.bz2"}, |
{ label=>"blackscholes simmedium (182M)",name=>"blackscholes_64c_simmedium.tra.bz2",url=>"https://www.cs.utexas.edu/~netrace/download/blackscholes_64c_simmedium.tra.bz2"}, |
{ label=>"blackscholes simsmall (55M) ",name=>"blackscholes_64c_simsmall.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/blackscholes_64c_simsmall.tra.bz2"}, |
{ label=>"bodytrack simlarge (3.5G) ",name=>"bodytrack_64c_simlarge.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/bodytrack_64c_simlarge.tra.bz2"}, |
{ label=>"canneal simmedium (3.5G) ",name=>"canneal_64c_simmedium.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/canneal_64c_simmedium.tra.bz2"}, |
{ label=>"dedup simmedium (4.1G) ",name=>"dedup_64c_simmedium.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/dedup_64c_simmedium.tra.bz2"}, |
{ label=>"ferret simmedium (2.7G) ",name=>"ferret_64c_simmedium.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/ferret_64c_simmedium.tra.bz2"}, |
{ label=>"fluidanimate simlarge (1.8G) ",name=>"fluidanimate_64c_simlarge.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/fluidanimate_64c_simlarge.tra.bz2"}, |
{ label=>"fluidanimate simmedium (677M)",name=>"fluidanimate_64c_simmedium.tra.bz2",url=>"https://www.cs.utexas.edu/~netrace/download/fluidanimate_64c_simmedium.tra.bz2"}, |
{ label=>"fluidanimate simsmall (317M) ",name=>"fluidanimate_64c_simsmall.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/fluidanimate_64c_simsmall.tra.bz2"}, |
{ label=>"swaptions simlarge (3.0G) ",name=>"swaptions_64c_simlarge.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/swaptions_64c_simlarge.tra.bz2"}, |
{ label=>"vips simmedium (3.1G) ",name=>"vips_64c_simmedium.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/vips_64c_simmedium.tra.bz2"}, |
{ label=>"x264 simmedium (5.1G) ",name=>"x264_64c_simmedium.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/x264_64c_simmedium.tra.bz2"}, |
{ label=>"x264 simsmall (1.2G) ",name=>"x264_64c_simsmall.tra.bz2" ,url=>"https://www.cs.utexas.edu/~netrace/download/x264_64c_simsmall.tra.bz2"}, |
); |
|
my $row=0; |
|
|
foreach my $d (@links){ |
my $srow=$row; |
$table-> attach (gen_label_in_left($d->{label}) , 0, 1, $row,$row+1,'expand','shrink',2,2); |
my $file="$path/$d->{name}"; |
if (-f $file){ |
|
}else{ |
my $download=def_image_button("icons/download.png",'Download'); |
$table-> attach ($download , 2, 3, $row,$row+1,'expand','shrink',2,2); |
$download->signal_connect("clicked"=> sub{ |
$download ->set_sensitive (FALSE); |
my $load= show_gif("icons/load.gif"); |
$table->attach ($load, 1, 2, $srow,$srow+ 1,'shrink','shrink',0,0); |
$load->show_all; |
my $o=$d->{name}; |
download_from_google_drive("$d->{url}" ,"$path/$o" ); |
$load->destroy; |
$download->destroy if (-f $file); |
}); |
} |
$row++; |
} |
|
|
|
|
|
$window ->add($scrolled_win); |
$window->show_all; |
|
} |
/software_editor.pl
55,9 → 55,9
|
my $NAME = 'ProNoC'; |
my $path = ""; |
our $FONT_SIZE='default'; |
our $ICON_SIZE='default'; |
|
|
|
exit gtk_gui_run(\&software_main_stand_alone) unless caller; |
|
|
69,9 → 69,7
my $paths_file= "$project_dir/mpsoc/perl_gui/lib/Paths"; |
if (-f $paths_file){#} && defined $ENV{PRONOC_WORK} ) { |
my $paths= do $paths_file; |
my %p=%{$paths}; |
$FONT_SIZE= $p{'GUI_SETTING'}{'FONT_SIZE'} if (defined $p{'GUI_SETTING'}{'FONT_SIZE'}); |
$ICON_SIZE= $p{'GUI_SETTING'}{'ICON_SIZE'} if (defined $p{'GUI_SETTING'}{'ICON_SIZE'}); |
set_gui_setting($paths); |
} |
|
set_defualt_font_size(); |
/temp.pl
1,26 → 1,38
#!/usr/bin/perl -w |
|
# a perl getopts example |
# alvin alexander, http://www.devdaily.com |
|
use strict; |
use Getopt::Std; |
use warnings; |
use IO::CaptureOutput qw(capture qxx qxy); |
use Gtk3; |
|
# declare the perl command line flags/options we want to allow |
my %options=(); |
getopts("hj:ln:s:", \%options); |
|
# test for the existence of the options on the command line. |
# in a normal program you'd do more than just print these. |
print "-h $options{h}\n" if defined $options{h}; |
print "-j $options{j}\n" if defined $options{j}; |
print "-l $options{l}\n" if defined $options{l}; |
print "-n $options{n}\n" if defined $options{n}; |
print "-s $options{s}\n" if defined $options{s}; |
|
# other things found on the command line |
print "Other things found on the command line:\n" if $ARGV[0]; |
foreach (@ARGV) |
{ |
print "$_\n"; |
my ($screen_x,$screen_y); |
|
sub get_default_screen_size{ |
return ($screen_x,$screen_y) if (defined $screen_x && defined $screen_y); |
my $fh= 'xrandr --current | awk \'$2~/\*/{print $1}\'' ; |
my ($stdout, $stderr, $success) = qxx( ($fh) ); |
my @a = split ("\n",$stdout); |
my ($screen_x,$screen_y) = split ("x",$a[0]); |
$screen_x = 600 if(!defined $screen_x); |
$screen_y = 800 if(!defined $screen_y); |
return ($screen_x,$screen_y); |
} |
|
|
|
my ($x,$y) =get_default_screen_size(); |
print "$x,$y\n"; |
|
|
|
sub get_screen_size{ |
my $screen = Gtk3::Gdk::Screen::get_default; |
my $hight = $screen->get_height(); |
my $width = $screen->get_width(); |
return ($width,$hight); |
} |
|
($x,$y) =get_screen_size(); |
print "$x,$y\n"; |
/topology.pl
22,7 → 22,21
} |
|
|
sub get_topology_info_from_parameters { |
my ($ref) =@_; |
my %noc_info; |
my %param= %$ref if(defined $ref ); |
my $topology=$param{'TOPOLOGY'}; |
my $T1 =$param{'T1'}; |
my $T2 =$param{'T2'}; |
my $T3 =$param{'T3'}; |
my $V =$param{'V'}; |
my $Fpay=$param{'Fpay'}; |
return get_topology_info_sub($topology, $T1, $T2, $T3,$V, $Fpay); |
} |
|
|
|
sub get_topology_info_sub { |
|
my ($topology, $T1, $T2, $T3,$V, $Fpay)=@_; |
366,6 → 380,20
} |
|
|
sub mcast_partial_width { |
my ($p,$NE)=@_; |
my $m=0; |
$p=remove_not_hex($p); |
my @arr=split (//, $p); |
foreach my $i (@arr) { |
my $n=hex($i); |
$m++ if($n & 0x1); |
$m++ if($n & 0x2); |
$m++ if($n & 0x4); |
$m++ if($n & 0x8); |
} |
return $m; |
} |
|
|
|
376,7 → 404,11
my $T1=$self->object_get_attribute('noc_param','T1'); |
my $T2=$self->object_get_attribute('noc_param','T2'); |
my $T3=$self->object_get_attribute('noc_param','T3'); |
my $cast = $self->object_get_attribute('noc_param','MCAST_ENDP_LIST'); |
my $CAST_TYPE= $self->object_get_attribute('noc_param','CAST_TYPE'); |
my $DAw_OFFSETw = ($topology eq '"MESH"' || $topology eq '"TORUS"' || $topology eq '"FMESH"')? $T1 : 0; |
|
|
my %tops; |
my %nr_p; # number of routers have $p port num |
my $router_p; #number of routers with different port number in topology |
383,6 → 415,17
|
my ($ne, $nr, $RAw, $EAw)=get_topology_info($self); |
|
my $MCAST_PRTLw= mcast_partial_width($cast,$ne); |
my $MCASTw = |
($CAST_TYPE eq '"MULTICAST_FULL"') ? $ne : |
($CAST_TYPE eq '"MULTICAST_PARTIAL"' && $EAw >= $MCAST_PRTLw) ? $EAw +1 : |
($CAST_TYPE eq '"MULTICAST_PARTIAL"' && $EAw < $MCAST_PRTLw) ? $MCAST_PRTLw +1 : |
$EAw +1; #broadcast |
|
my $DAw = ($CAST_TYPE eq '"UNICAST"') ? $EAw: $MCASTw + $DAw_OFFSETw; |
|
print "$DAw=$DAw\n"; |
|
my $custom_include=""; |
if($topology eq '"FATTREE"') { |
my $K = $T1; |
450,6 → 493,7
}elsif ($topology eq '"STAR"') { |
$router_p=1;# number of router with different port number |
my $ports= $T1; |
$nr_p{p1}=$ports; |
$nr_p{1}=1; |
%tops = ( |
#"Vrouter1" => "router_top_v_p${ports}.v", |
495,7 → 539,7
} |
$router_p=$i-1; |
${topology_name} =~ s/\"+//g; |
$custom_include="#include \"${topology_name}_noc.h\"\n"; |
$custom_include="#define IS_${topology_name}_noc\n"; |
}#else |
|
|
506,14 → 550,21
} |
my $rns_num = $router_p+1; |
$includ_h.="int router_NRs[$rns_num];\n"; |
|
my $max_p=0; |
for (my $p=1; $p<=$router_p ; $p++){ |
my $pnum= $nr_p{"p$p"}; |
$includ_h=$includ_h."#define NR${p} $nr_p{$p}\n"; |
my $pnum= $nr_p{"p$p"}; |
$includ_h=$includ_h."#define NR${p}_PNUM $pnum\n"; |
|
$includ_h=$includ_h."Vrouter${p} *router${p}[ $nr_p{$p} ]; // Instantiation of router with $pnum port number\n"; |
|
$max_p = $pnum if($max_p < $pnum); |
} |
$includ_h.="#define MAX_P $max_p //The maximum number of ports available in a router in this topology\n"; |
|
$includ_h.="#define DAw $DAw //The traffic generator's destination address width\n"; |
|
|
my $st1=''; |
my $st2=''; |
my $st3=''; |
520,7 → 571,9
my $st4=''; |
my $st5=''; |
my $st6=''; |
|
my $st7=''; |
my $st8=''; |
|
my $i=1; |
my $j=0; |
my $accum=0; |
560,6 → 613,34
if (i<NR${i}){ router${i}[i]->eval(); return;} |
i-= NR${i}; |
"; |
|
|
|
|
|
$st7.=" |
if (i<NR${i}){ |
update_router_st( |
NR${i}_PNUM, |
router${i}[i]->current_r_id, |
router${i}[i]->router_event |
); |
return; |
} |
i-= NR${i}; |
"; |
|
$st8=$st8." |
if (i<NR${i}){ |
router${i}[i]->reset= reset; |
router${i}[i]->clk= clk ; |
return; |
} |
i-= NR${i}; |
"; |
|
|
|
$i++; |
$j++; |
$accum=$accum+$nr_p{$p}; |
597,7 → 678,27
$st6 |
} |
|
#define SMART_NUM ((SMART_MAX==0)? 1 : SMART_MAX) |
#if SMART_NUM > 8 |
typedef unsigned int EVENT; |
#else |
typedef unsigned char EVENT; |
#endif |
|
extern void update_router_st ( |
unsigned int, |
unsigned int, |
EVENT * |
); |
|
void single_router_st_update(int i){ |
$st7 |
} |
|
void inline single_router_reset_clk(int i){ |
$st8 |
} |
|
|
"; |
|
/topology_verilog_gen.pl
23,7 → 23,9
} |
print $fd autogen_warning(); |
print $fd get_license_header($top); |
|
print $fd ' |
`include "pronoc_def.v" |
'; |
|
my $param_str ="\tparameter TOPOLOGY = \"$name\", |
\tparameter ROUTE_NAME = \"${name}_DETERMINISTIC\""; |
71,7 → 73,8
|
$wires=$wires."\tinput smartflit_chanel_t ${instance}_chan_in;\n"; |
$wires=$wires."\toutput smartflit_chanel_t ${instance}_chan_out;\n"; |
$ports=$ports.",\n\t${instance}_chan_in,\n\t${instance}_chan_out"; |
$wires=$wires."\toutput router_event_t ${instance}_router_event;\n"; |
$ports=$ports.",\n\t${instance}_chan_in,\n\t${instance}_chan_out,\n\t${instance}_router_event"; |
|
foreach my $d (@ports){ |
my $range = ($d->{pwidth} eq 1)? " " : " [$d->{pwidth}-1 : 0]"; |
194,6 → 197,7
|
\tsmartflit_chanel_t ${instance}_chan_in [$Pnum-1 : 0]; |
\tsmartflit_chanel_t ${instance}_chan_out [$Pnum-1 : 0]; |
\trouter_event_t ${instance}_router_event [$Pnum-1 : 0]; |
|
"; |
|
211,9 → 215,11
( |
.clk(${instance}_clk), |
.reset(${instance}_reset), |
.current_r_id($current_r), |
.current_r_addr (${instance}_current_r_addr), |
.chan_in (${instance}_chan_in), |
.chan_out (${instance}_chan_out) |
.chan_out (${instance}_chan_out), |
.router_event (${instance}_router_event) |
); |
"; |
|
242,6 → 248,8
}else{ |
$router_v.=" \t\tassign ${instance}_chan_in [$i] = ${cinstance}_chan_in;\n"; |
$router_v.=" \t\tassign ${cinstance}_chan_out = ${instance}_chan_out [$i];\n"; |
$router_v.=" \t\tassign ${cinstance}_router_event = ${instance}_router_event [$i];\n"; |
|
} |
my $cpplus=$cp+1; |
|
309,7 → 317,9
} |
print $fd autogen_warning(); |
print $fd get_license_header($top); |
|
print $fd ' |
`include "pronoc_def.v" |
'; |
|
my $param_str ="\tparameter TOPOLOGY = \"$name\", |
\tparameter ROUTE_NAME = \"${name}_DETERMINISTIC\""; |
341,7 → 351,8
my $ports="\treset, |
\tclk, |
\tchan_in_all, |
\tchan_out_all |
\tchan_out_all, |
\trouter_event |
"; |
my $ports_def=" |
\tinput reset; |
349,10 → 360,14
\tinput smartflit_chanel_t chan_in_all [NE-1 : 0]; |
\toutput smartflit_chanel_t chan_out_all [NE-1 : 0]; |
|
//Events |
\toutput router_event_t router_event [NR-1 : 0][MAX_P-1 : 0]; |
|
//all routers port |
\tsmartflit_chanel_t router_chan_in [NR-1 :0][MAX_P-1 : 0]; |
\tsmartflit_chanel_t router_chan_out [NR-1 :0][MAX_P-1 : 0]; |
|
|
\twire [RAw-1 : 0] current_r_addr [NR-1 : 0]; |
|
|
406,8 → 421,10
'; |
my $offset=0; |
my $assign=""; |
my $assign_h=""; |
my $assign_r2r=""; |
my $assign_r2e=""; |
my $init_h=""; |
my $init_gnd_h=""; |
my %new_h; |
my $addr=0; |
for ( my $i=2;$i<=12; $i++){ |
421,6 → 438,7
$new_h{"RNUM_${pos}"}="$rr"; |
|
$init_h.="router${Tnum}[$rr]->current_r_addr=$addr;\n"; |
$init_h.="router${Tnum}[$rr]->current_r_id=$addr;\n"; |
$addr++; |
} |
$offset+= $n; |
435,7 → 453,7
|
|
$offset=0; |
|
my $R_num=0; |
for ( my $i=2;$i<=12; $i++){ |
my $n= $self->object_get_attribute("ROUTER${i}","NUM"); |
$n=0 if(!defined $n); |
442,9 → 460,11
if($n>0){ |
my $router_pos= ($offset==0)? 'i' : "i+$offset"; |
#my $instant=get_router_genvar_instance_v($self,$i,$router_pos,$NE,$NR,$MAX_P); |
|
my $p = $i-1; |
$routers=$routers." |
\tfor( i=0; i<$n; i=i+1) begin : router_${i}_port_lp |
localparam RID = $router_pos; |
assign current_r_addr [RID] = RID[RAw-1: 0]; |
|
router_top #( |
.P($i) |
453,9 → 473,11
( |
.clk(clk), |
.reset(reset), |
.current_r_addr($router_pos), |
.chan_in (router_chan_in\[$router_pos\]), |
.chan_out (router_chan_out\[$router_pos\]) |
.current_r_id(RID), |
.current_r_addr(current_r_addr\[RID\]), |
.chan_in (router_chan_in \[RID\] \[$p : 0\]), |
.chan_out (router_chan_out\[RID\] \[$p : 0\]), |
.router_event(router_event\[RID\] \[$p : 0\]) |
); |
|
|
465,10 → 487,14
|
for ( my $j=0;$j<$n; $j++){ |
my $rname ="ROUTER${i}_$j"; |
my ($ass_v,$ass_h)=get_wires_assignment_genvar_v($self,$rname,0,\%new_h); |
my ($ass_v,$r2r_h,$r2e_h, $int_h,$gnd_h); |
($ass_v,$r2r_h,$r2e_h, $int_h,$gnd_h,$R_num) = get_wires_assignment_genvar_v($self,$rname,0,\%new_h,$R_num); |
|
$assign=$assign.$ass_v; |
$assign_h.=$ass_h; |
$assign_r2r.=$r2r_h; |
$assign_r2e.=$r2e_h; |
$init_h.=$int_h; |
$init_gnd_h.=$gnd_h; |
} |
|
$offset+= $n; |
492,7 → 518,8
reset, |
clk, |
chan_in_all, |
chan_out_all |
chan_out_all, |
router_event |
); |
|
function integer log2; |
539,16 → 566,46
add_colored_info($info,"Error in creating $top: $r",'red'); |
return; |
} |
|
my $fr2r=""; |
for (my $i=0;$i<$R_num ; $i++){ |
$fr2r.="\n" if($i%10==0); |
$fr2r.=($i==0) ? "single_r2r$i" : ",single_r2r$i"; |
|
} |
|
my $fr2e=""; |
for (my $i=0;$i<$NE ; $i++){ |
$fr2e.="\n" if($i%10==0); |
$fr2e.=($i==0) ? "single_r2e$i" : ",single_r2e$i"; |
} |
|
|
print $fd " |
|
|
$assign_r2r |
|
void topology_connect_all_nodes (void){ |
$assign_h |
$assign_r2e |
|
|
void (*r2r_func_ptr[$R_num])() = {$fr2r}; |
void (*r2e_func_ptr[$NE])() = {$fr2e}; |
|
void topology_connect_r2r (int n){ |
(*r2r_func_ptr[n])(); |
} |
|
void topology_connect_r2e (int n){ |
(*r2e_func_ptr[n])(); |
} |
|
|
|
void topology_init(void){ |
$init_h |
R2R_TABLE_SIZ=$R_num; |
$init_gnd_h |
} |
"; |
close $fd; |
578,8 → 635,10
.clk(clk), |
.reset(reset), |
.current_r_addr($router_pos), |
.current_r_id($router_pos), |
.chan_in (router_chan_in\[$router_pos\]), |
.chan_out(router_chan_out\[$router_pos\]) |
.chan_out(router_chan_out\[$router_pos\]), |
.router_event(router_event\[$router_pos\]) |
); |
|
|
593,7 → 652,7
|
|
sub get_wires_assignment_genvar_v{ |
my ($self,$rname,$reverse,$cref)=@_; |
my ($self,$rname,$reverse,$cref,$R_num)=@_; |
$reverse = 0 if(!defined $reverse); |
my $instance= $self->object_get_attribute("$rname","NAME"); |
my $Pnum=$self->object_get_attribute("$rname",'PNUM'); |
603,7 → 662,12
my @ports= @{$self->object_get_attribute('Verilog','Router_ports')}; |
|
my $assign=""; |
my $ass_h=""; |
my $r2e_h=""; |
my $r2r_h=""; |
my $init_h=""; |
my $gnd_h=""; |
|
|
|
my @ends=get_list_of_all_endpoints($self); |
my @routers=get_list_of_all_routers($self); |
627,8 → 691,8
my $ctype = $self->object_get_attribute("$cname",'TYPE'); |
my ($cp)= sscanf("Port[%u]","$pnode"); |
$assign.="//Connect $instance input ports $i to $cinstance output ports $cp\n"; |
$ass_h.="//Connect $instance input ports $i to $cinstance output ports $cp\n"; |
|
|
my $cpos =($ctype eq 'ENDP')? get_scolar_pos($cname,@ends) : get_scolar_pos($cname,@routers); |
|
my $cpplus=$cp+1; |
643,6 → 707,7
|
#$assign = $assign."//connet $instance input port $i to $cinstance output port $cp\n"; |
if($type ne 'ENDP' && $ctype eq 'ENDP'){ |
|
$assign= $assign."\t\tassign router_chan_in \[$pos\]\[$i\] = chan_in_all \[$cpos\];\n" if($reverse==0); |
$assign= $assign."\t\tassign chan_in_all \[$cpos\] = router_chan_in \[$pos\]\[$i\];\n" if($reverse==1); |
|
649,14 → 714,17
$assign= $assign."\t\tassign chan_out_all \[$cpos\] = router_chan_out \[$pos\]\[$i\];\n" if($reverse==0); |
$assign= $assign."\t\tassign router_chan_out \[$pos\]\[$i\] = chan_out_all \[$cpos\];\n" if($reverse==1); |
|
$ass_h.= "\tconnect_r2e($TNUM_pos,$RNUM_pos,$i,$cpos);\n" if (defined $TNUM_pos); |
$r2e_h.="//Connect $instance input ports $i to $cinstance output ports $cp\n"; |
$r2e_h.= "void single_r2e$cpos(void) {connect_r2e($TNUM_pos,$RNUM_pos,$i,$cpos);}\n" if (defined $TNUM_pos); |
|
|
}elsif ($type ne 'ENDP' && $ctype ne 'ENDP'){ |
$assign= $assign."\t\tassign router_chan_in \[$pos\]\[$i\] = router_chan_out \[$cpos\]\[$cp\];\n" if($reverse==0); |
$assign= $assign."\t\tassign router_chan_out \[$cpos\]\[$cp\] = router_chan_in \[$pos\]\[$i\];\n" if($reverse==1); |
$ass_h.= "\tconect_r2r($TNUM_pos,$RNUM_pos,$i,$TNUM_cpos,$RNUM_cpos,$cp);\n" if (defined $TNUM_pos); |
|
$r2r_h.="//Connect $instance input ports $i to $cinstance output ports $cp\n"; |
$r2r_h.= "void single_r2r$R_num(void){conect_r2r($TNUM_pos,$RNUM_pos,$i,$TNUM_cpos,$RNUM_cpos,$cp);}\n" if (defined $TNUM_pos); |
$init_h.="\tr2r_cnt_all[$R_num] =(r2r_cnt_table_t){.id1=$pos, .t1=$TNUM_pos, .r1=$RNUM_pos, .p1=$i,.id2=$cpos, .t2=$TNUM_cpos, .r2=$RNUM_cpos, .p2=$cp };\n"; |
$R_num++; |
} |
|
|
667,16 → 735,19
my $TNUM_pos = $rinfo{"TNUM_${pos}" }; |
my $RNUM_pos = $rinfo{"RNUM_${pos}" }; |
|
$assign = $assign."//Connect $instance port $i to ground\n"; |
$ass_h.="//Connect $instance port $i to ground\n"; |
$assign = $assign."//Connect $instance port $i to ground\n"; |
$assign= $assign."\t\tassign router_chan_in \[$pos\]\[$i\] ={SMARTFLIT_CHANEL_w{1'b0}};\n " if($reverse==0); |
$assign= $assign."\t\tassign router_chan_out \[$pos\]\[$i\] ={SMARTFLIT_CHANEL_w{1'b0}};\n " if($reverse==1); |
$ass_h.= "\tconnect_r2gnd($TNUM_pos,$RNUM_pos,$i);\n" if (defined $TNUM_pos); |
|
$gnd_h.="//Connect $instance port $i to ground\n"; |
$gnd_h.= "\tconnect_r2gnd($TNUM_pos,$RNUM_pos,$i);\n" if (defined $TNUM_pos); |
} |
|
} |
|
return ($assign,$ass_h); |
|
|
return ($assign,$r2r_h,$r2e_h,$init_h,$gnd_h,$R_num); |
} |
|
|
865,6 → 936,8
|
|
print $fd " |
|
`include \"pronoc_def.v\" |
/******************* |
* ${Vname}_look_ahead_routing |
*******************/ |
891,8 → 964,8
reg [EAw-1 :0] dest_e_addr_delay; |
reg [EAw-1 :0] src_e_addr_delay; |
|
always @(posedge clk)begin |
if(reset)begin |
always @ (`pronoc_clk_reset_edge )begin |
if(`pronoc_reset)begin |
dest_e_addr_delay<={EAw{1'b0}}; |
src_e_addr_delay<={EAw{1'b0}}; |
end else begin |
1107,6 → 1180,8
|
|
print $fd " |
`include \"pronoc_def.v\" |
|
/***************************** |
* ${Vname}_look_ahead_routing_genvar |
******************************/ |
1132,8 → 1207,8
reg [EAw-1 :0] dest_e_addr_delay; |
reg [EAw-1 :0] src_e_addr_delay; |
|
always @(posedge clk)begin |
if(reset)begin |
always @ (`pronoc_clk_reset_edge )begin |
if(`pronoc_reset) begin |
dest_e_addr_delay<={EAw{1'b0}}; |
src_e_addr_delay<={EAw{1'b0}}; |
end else begin |
1214,10 → 1289,12
} |
print $fd autogen_warning(); |
print $fd get_license_header($top); |
print $fd ' |
`include "pronoc_def.v" |
'; |
|
|
|
|
|
|
|
1308,7 → 1385,7
'; |
my $offset=0; |
my $assign=""; |
|
my $R_num=0; |
for ( my $i=2;$i<=12; $i++){ |
my $n= $self->object_get_attribute("ROUTER${i}","NUM"); |
$n=0 if(!defined $n); |
1325,7 → 1402,7
|
for ( my $j=0;$j<$n; $j++){ |
my $rname ="ROUTER${i}_$j"; |
my ($ass_v, $ass_h)= get_wires_assignment_genvar_v($self,$rname,1); |
my ($ass_v, $r2r_h,$r2e_h, $int_h,$gnd_h,$R_num)= get_wires_assignment_genvar_v($self,$rname,1,undef,$R_num); |
$assign=$assign.$ass_v; |
} |
|
1441,10 → 1518,39
|
} |
|
sub add_noc_custom_h{ |
my ($self,$info,$dir)=@_; |
my $name=$self->object_get_attribute('save_as'); |
my $str=" |
//do not modify this line ===${name}=== |
#ifdef IS_${name}_noc |
#include \"${name}_noc.h\" |
#endif |
"; |
|
|
my $file = "$dir/../../../src_verilator/topology/custom/custom.h"; |
#check if ***$name**** exist in the file |
unless (-f $file){ |
add_colored_info($info,"$file dose not exist\n",'red'); |
return; |
} |
my $r = check_file_has_string($file, "===${name}==="); |
if ($r==1){ |
add_info($info,"The instance ${name}_noc exists in $file. This file is not modified\n ",'blue'); |
|
}else{ |
my $text = read_file_cntent($file,' '); |
my @a = split('endgenerate',$text); |
save_file($file,"$a[0] $str $a[1]"); |
add_info($info,"$file has been modified. The ${name}_noc has been added to the file\n ",'blue'); |
|
} |
|
} |
|
|
|
|
sub add_routing_instance_v{ |
my ($self,$info,$dir)=@_; |
my $name=$self->object_get_attribute('save_as'); |
1632,7 → 1738,8
.reset(reset), |
.clk(clk), |
.chan_in_all(chan_in_all), |
.chan_out_all(chan_out_all) |
.chan_out_all(chan_out_all), |
.router_event(router_event) |
); |
end |
|
1673,4 → 1780,3
|
|
1 |
|
/trace_gen.pl
162,10 → 162,10
|
|
|
my $dir = Cwd::getcwd(); |
my $project_dir = abs_path("$dir/.."); #mpsoc directory address |
|
my $project_dir = get_project_dir()."/mpsoc/"; |
|
|
$add->signal_connect ( 'clicked'=> sub{ |
load_task_file($self,$project_dir,$tview) if($mode eq 'task'); |
load_orcc_file($self,$tview) if($mode eq 'orcc'); |
/widget.pl
21,4 → 21,8
} |
|
|
|
|
|
|
1; |
/widget2.pl
20,9 → 20,9
use Gtk2::Pango; |
#use Tk::Animation; |
|
our $FONT_SIZE; |
our $ICON_SIZE; |
our %glob_setting; |
|
|
############## |
# combo box |
############# |
378,11 → 378,11
sub get_icon_pixbuff{ |
my $icon_file=shift; |
my $size; |
if ($ICON_SIZE eq 'default'){ |
if ($glob_setting{'ICON_SIZE'} eq 'default'){ |
my $font_size=get_defualt_font_size(); |
$size=($font_size *2.5); |
}else{ |
$size = int ($ICON_SIZE); |
$size = int ($glob_setting{'ICON_SIZE'}); |
} |
my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file_at_scale($icon_file,$size,$size,FALSE); |
return $pixbuf; |
819,20 → 819,14
} |
|
|
sub get_default_screen { |
return Gtk2::Gdk::Screen->get_default(); |
} |
|
|
|
|
sub max_win_size{ |
my $screen =Gtk2::Gdk::Screen->get_default(); |
my $hight = $screen->get_height(); |
my $width = $screen->get_width(); |
return ($width,$hight); |
} |
|
|
sub get_defualt_font_size{ |
return int($FONT_SIZE) if ($FONT_SIZE ne 'default'); |
return int($glob_setting{'FONT_SIZE'}) if ($glob_setting{'FONT_SIZE'} ne 'default'); |
|
my($width,$hight)=max_win_size(); |
#print "($width,$hight)\n"; |
839,7 → 833,7
my $font_size=($width>=1600)? 10: |
($width>=1400)? 9: |
($width>=1200)? 9: |
($width>=1000)? 7:6; |
($width>=1000)? 8:7; |
#print "$font_size\n"; |
return $font_size; |
} |
2047,6 → 2041,8
my $cmd=shift; |
my $exit; |
my ($stdout, $stderr); |
STDOUT->flush(); |
STDERR->flush(); |
capture { $exit=run_cmd_in_back_ground($cmd) } \$stdout, \$stderr; |
return ($stdout,$exit,$stderr); |
|
/widget3.pl
3,6 → 3,9
use strict; |
use warnings; |
|
use FindBin; |
use lib $FindBin::Bin; |
|
use Data::Dumper; |
use Gtk3::SourceView; |
use Consts; |
9,8 → 12,7
|
require "common.pl"; |
|
use FindBin; |
use lib $FindBin::Bin; |
|
use IO::CaptureOutput qw(capture qxx qxy); |
|
#use ColorButton; |
18,8 → 20,7
|
#use Tk::Animation; |
|
our $FONT_SIZE; |
our $ICON_SIZE; |
our %glob_setting; |
|
############## |
# combo box |
388,11 → 389,11
sub get_icon_pixbuff{ |
my $icon_file=shift; |
my $size; |
if ($ICON_SIZE eq 'default'){ |
if ($glob_setting{'ICON_SIZE'} eq 'default'){ |
my $font_size=get_defualt_font_size(); |
$size=($font_size *2.5); |
}else{ |
$size = int ($ICON_SIZE); |
$size = int ($glob_setting{'ICON_SIZE'}); |
} |
my $pixbuf = Gtk3::Gdk::Pixbuf->new_from_file_at_scale($icon_file,$size,$size,FALSE); |
return $pixbuf; |
868,35 → 869,12
} |
|
|
|
|
my ($scr, $curr_scr, %screens); |
|
sub max_win_size{ |
# my $screen =Gtk3::Gdk::Screen::get_default; |
|
if(!defined $curr_scr){ |
|
open my $fh, "xdpyinfo|" or die; |
|
while (<$fh>) { |
$scr = $1 if m/^\s*screen\s+#(\d+):/; |
$curr_scr = $1 if m/^\s*default screen number:\s+(\d+)/; |
@{$screens{$scr}}{'x','y'} = ($1, $2) |
if m/^\s*dimensions:\s+(\d+)x(\d+)/; |
} |
close $fh; |
} |
|
|
my $width = $screens{$curr_scr}{'y'}; |
my $height = $screens{$curr_scr}{'x'}; |
return ($height,$width); |
sub get_default_screen { |
return Gtk3::Gdk::Screen::get_default; |
} |
|
|
sub get_defualt_font_size{ |
return int($FONT_SIZE) if ($FONT_SIZE ne 'default'); |
return int($glob_setting{'FONT_SIZE'}) if ($glob_setting{'FONT_SIZE'} ne 'default'); |
|
my($width,$hight)=max_win_size(); |
#print "($width,$hight)\n"; |
1008,7 → 986,7
sub save_adj { |
my ($self,$adjustment,$at1,$at2)=@_; |
my $value = $adjustment->get_value; |
$self->object_add_attribute($at1,$at2,$value); |
$self->object_add_attribute($at1,$at2,$value) if (defined $self); |
} |
|
|
1537,9 → 1515,7
$object->object_add_attribute($attribute1,$attribute2,$new_param_value); |
set_gui_status($object,$status,$timeout) if (defined $status); |
}); |
return $widget; |
|
|
return $widget; |
} |
|
|
1977,7 → 1953,8
my $renderer = Gtk3::CellRendererText->new; |
my $column = Gtk3::TreeViewColumn->new_with_attributes ("$l", |
$renderer, |
text => $c ); |
text => $c |
); |
$column->set_sort_column_id ($c ); |
$treeview->append_column ($column); |
$c++; |
2190,6 → 2167,7
# This while loop will cause Gtk3 to continue processing events, if |
# there are events pending... *which there are... |
while (Gtk3::events_pending) { |
|
Gtk3::main_iteration; |
} |
Gtk3::Gdk::flush; |
2227,17 → 2205,20
my $exit; |
my ($stdout, $stderr); |
|
open(OLDERR, ">&STDERR"); |
open(STDERR, ">>/tmp/tmp.spderr") or die "Can't dup stdout"; |
select(STDOUT); $| = 1; # make unbuffered |
print OLDERR ""; #this fixed an error about OLDERR not being used |
#open(OLDERR, ">&STDERR"); |
#open(STDERR, ">>/tmp/tmp.spderr") or die "Can't dup stdout"; |
#select(STDOUT); $| = 1; # make unbuffered |
#print OLDERR ""; #this fixed an error about OLDERR not being used |
|
## do my stuff here. |
|
STDOUT->flush(); |
STDERR->flush(); |
|
capture { $exit=run_cmd_in_back_ground($cmd) } \$stdout, \$stderr; |
|
close(STDERR); |
open(STDERR, ">&OLDERR"); |
#close(STDERR); |
#open(STDERR, ">&OLDERR"); |
return ($stdout,$exit,$stderr); |
|
} |