Line 24... |
Line 24... |
|
|
|
|
require "widget.pl";
|
require "widget.pl";
|
require "mpsoc_verilog_gen.pl";
|
require "mpsoc_verilog_gen.pl";
|
require "hdr_file_gen.pl";
|
require "hdr_file_gen.pl";
|
|
require "readme_gen.pl";
|
|
|
sub get_pos{
|
sub get_pos{
|
my ($item,@list)=@_;
|
my ($item,@list)=@_;
|
my $pos=0;
|
my $pos=0;
|
foreach my $p (@list){
|
foreach my $p (@list){
|
Line 40... |
Line 40... |
|
|
}
|
}
|
|
|
|
|
sub noc_param_widget{
|
sub noc_param_widget{
|
my ($mpsoc,$name,$param, $default,$type,$content,$info, $state,$table,$row,$show)=@_;
|
my ($mpsoc,$name,$param, $default,$type,$content,$info, $table,$row,$show,$attribut1,$ref_delay)=@_;
|
my $label =gen_label_in_left(" $name");
|
my $label =gen_label_in_left(" $name");
|
my $widget;
|
my $widget;
|
my $value=$mpsoc->mpsoc_get_param($param);
|
my $value=$mpsoc->object_get_attribute($attribut1,$param);
|
if(! defined $value) {
|
if(! defined $value) {
|
$mpsoc->mpsoc_add_param($param,$default);
|
$mpsoc->object_add_attribute($attribut1,$param,$default);
|
$mpsoc->mpsoc_add_param_order($param);
|
$mpsoc->object_add_attribute_order($attribut1,$param);
|
$value=$default;
|
$value=$default;
|
}
|
}
|
|
if( ! defined $ref_delay){
|
|
$ref_delay=($type eq "Entry") ? 10 : 1;
|
|
|
|
}
|
if ($type eq "Entry"){
|
if ($type eq "Entry"){
|
$widget=gen_entry($value);
|
$widget=gen_entry($value);
|
$widget-> signal_connect("changed" => sub{
|
$widget-> signal_connect("changed" => sub{
|
my $new_param_value=$widget->get_text();
|
my $new_param_value=$widget->get_text();
|
$mpsoc->mpsoc_add_param($param,$new_param_value);
|
$mpsoc->object_add_attribute($attribut1,$param,$new_param_value);
|
set_state($state,"ref",10);
|
set_gui_status($mpsoc,"ref",$ref_delay);
|
|
|
|
|
});
|
});
|
|
|
|
|
}
|
}
|
elsif ($type eq "Combo-box"){
|
elsif ($type eq "Combo-box"){
|
my @combo_list=split(",",$content);
|
my @combo_list=split(",",$content);
|
my $pos=get_pos($value, @combo_list);
|
my $pos=get_pos($value, @combo_list) if(defined $value);
|
if(!defined $pos){
|
if(!defined $pos){
|
$mpsoc->mpsoc_add_param($param,$default);
|
$mpsoc->object_add_attribute($attribut1,$param,$default);
|
$pos=get_item_pos($default, @combo_list);
|
$pos=get_item_pos($default, @combo_list) if (defined $default);
|
|
|
}
|
}
|
#print " my $pos=get_item_pos($value, @combo_list);\n";
|
#print " my $pos=get_item_pos($value, @combo_list);\n";
|
$widget=gen_combo(\@combo_list, $pos);
|
$widget=gen_combo(\@combo_list, $pos);
|
$widget-> signal_connect("changed" => sub{
|
$widget-> signal_connect("changed" => sub{
|
my $new_param_value=$widget->get_active_text();
|
my $new_param_value=$widget->get_active_text();
|
$mpsoc->mpsoc_add_param($param,$new_param_value);
|
$mpsoc->object_add_attribute($attribut1,$param,$new_param_value);
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",$ref_delay);
|
|
|
|
|
});
|
});
|
|
|
}
|
}
|
Line 89... |
Line 94... |
$step=~ s/\D//g;
|
$step=~ s/\D//g;
|
$widget=gen_spin($min,$max,$step);
|
$widget=gen_spin($min,$max,$step);
|
$widget->set_value($value);
|
$widget->set_value($value);
|
$widget-> signal_connect("value_changed" => sub{
|
$widget-> signal_connect("value_changed" => sub{
|
my $new_param_value=$widget->get_value_as_int();
|
my $new_param_value=$widget->get_value_as_int();
|
$mpsoc->mpsoc_add_param($param,$new_param_value);
|
$mpsoc->object_add_attribute($attribut1,$param,$new_param_value);
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",$ref_delay);
|
|
|
});
|
});
|
|
|
# $box=def_label_spin_help_box ($param,$info, $value,$min,$max,$step, 2);
|
# $box=def_label_spin_help_box ($param,$info, $value,$min,$max,$step, 2);
|
}
|
}
|
Line 109... |
Line 114... |
$widget->pack_end( $check[$i], FALSE, FALSE, 0);
|
$widget->pack_end( $check[$i], FALSE, FALSE, 0);
|
|
|
my @chars = split("",$value);
|
my @chars = split("",$value);
|
#check if saved value match the size of check box
|
#check if saved value match the size of check box
|
if($chars[0] ne $content ) {
|
if($chars[0] ne $content ) {
|
$mpsoc->mpsoc_add_param($param,$default);
|
$mpsoc->object_add_attribute($attribut1,$param,$default);
|
$value=$default;
|
$value=$default;
|
@chars = split("",$value);
|
@chars = split("",$value);
|
}
|
}
|
#set initial value
|
#set initial value
|
|
|
Line 131... |
Line 136... |
|
|
for (my $i=$content-1; $i >= 0; $i--){
|
for (my $i=$content-1; $i >= 0; $i--){
|
if($check[$i]->get_active()) {$new_val="${new_val}1" ;}
|
if($check[$i]->get_active()) {$new_val="${new_val}1" ;}
|
else {$new_val="${new_val}0" ;}
|
else {$new_val="${new_val}0" ;}
|
}
|
}
|
$mpsoc->mpsoc_add_param($param,$new_val);
|
$mpsoc->object_add_attribute($attribut1,$param,$new_val);
|
#print "\$new_val=$new_val\n";
|
#print "\$new_val=$new_val\n";
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",$ref_delay);
|
});
|
});
|
}
|
}
|
|
|
|
|
|
|
|
|
}
|
}
|
|
elsif ( $type eq "DIR_path"){
|
|
$widget =get_dir_in_object ($mpsoc,$attribut1,$param,$value,'ref',10);
|
|
}
|
|
|
|
|
|
|
else {
|
else {
|
$widget =gen_label_in_left("unsuported widget type!");
|
$widget =gen_label_in_left("unsuported widget type!");
|
}
|
}
|
|
|
my $inf_bt= gen_button_message ($info,"icons/help.png");
|
my $inf_bt= gen_button_message ($info,"icons/help.png");
|
Line 184... |
Line 195... |
#############
|
#############
|
# get_soc_lists
|
# get_soc_lists
|
############
|
############
|
|
|
sub get_soc_list {
|
sub get_soc_list {
|
my $mpsoc=shift;
|
my ($mpsoc,$info)=@_;
|
|
|
|
|
|
my $path=$mpsoc->object_get_attribute('setting','soc_path');
|
|
|
my $path=$mpsoc->mpsoc_get_setting('soc_path');
|
|
$path =~ s/ /\\ /g;
|
$path =~ s/ /\\ /g;
|
my @socs;
|
my @socs;
|
my @files = glob "$path/*.SOC";
|
my @files = glob "$path/*.SOC";
|
for my $p (@files){
|
for my $p (@files){
|
|
|
# Read
|
# Read
|
my $soc = eval { do $p };
|
my $soc = eval { do $p };
|
|
if ($@ || !defined $soc){
|
|
add_info(\$info,"**Error reading $p file: $@\n");
|
|
next;
|
|
}
|
my $top=$soc->soc_get_top();
|
my $top=$soc->soc_get_top();
|
if (defined $top){
|
if (defined $top){
|
my @instance_list=$top->top_get_all_instances();
|
my @instance_list=$top->top_get_all_instances();
|
#check if the soc has ni port
|
#check if the soc has ni port
|
foreach my $instanc(@instance_list){
|
foreach my $instanc(@instance_list){
|
my $module=$top->top_get_def_of_instance($instanc,'module');
|
my $module=$top->top_get_def_of_instance($instanc,'module');
|
if($module eq 'ni')
|
if($module eq 'ni')
|
{
|
{
|
my $name=$soc->soc_get_soc_name();
|
my $name=$soc->object_get_attribute('soc_name');
|
$mpsoc->mpsoc_add_soc($name,$top);
|
$mpsoc->mpsoc_add_soc($name,$top);
|
#print" $name\n";
|
#print" $name\n";
|
}
|
}
|
}
|
}
|
|
|
Line 214... |
Line 231... |
|
|
|
|
|
|
|
|
|
|
#my @instance_list=$soc->soc_get_all_instances();
|
|
#my $i=0;
|
|
|
|
#check if the soc has ni port
|
|
#foreach my $instanc(@instance_list){
|
|
# my $module=$soc->soc_get_module($instanc);
|
|
# if($module eq 'ni')
|
|
# {
|
|
# my $name=$soc->soc_get_soc_name();
|
|
# $mpsoc->mpsoc_add_soc($name,$soc);
|
|
# #print" $name\n";
|
|
# }
|
|
#}
|
|
|
|
|
|
}#files
|
}#files
|
|
|
# initial default soc parameter
|
# initial default soc parameter
|
Line 256... |
Line 261... |
return ($box,$button);
|
return ($box,$button);
|
|
|
}
|
}
|
|
|
sub get_conflict_decision{
|
sub get_conflict_decision{
|
my ($mpsoc,$name,$inserted,$conflicts,$msg,$state)=@_;
|
my ($mpsoc,$name,$inserted,$conflicts,$msg)=@_;
|
$msg="\tThe inserted tile number(s) have been mapped previously to \n\t\t\"$msg\".\n\tDo you want to remove the conflicted tiles number(s) in newly \n\tinsterd range or remove them from the previous ones? ";
|
$msg="\tThe inserted tile number(s) have been mapped previously to \n\t\t\"$msg\".\n\tDo you want to remove the conflicted tiles number(s) in newly \n\tinsterd range or remove them from the previous ones? ";
|
|
|
my $wind=def_popwin_size(100,300,"warning");
|
my $wind=def_popwin_size(100,300,"warning");
|
my $label= gen_label_in_left($msg);
|
my $label= gen_label_in_left($msg);
|
my $table=def_table(2,6,FALSE);
|
my $table=def_table(2,6,FALSE);
|
Line 286... |
Line 291... |
$mpsoc->mpsoc_add_soc_tiles_num($p,\@diff) if(scalar @diff );
|
$mpsoc->mpsoc_add_soc_tiles_num($p,\@diff) if(scalar @diff );
|
$mpsoc->mpsoc_add_soc_tiles_num($p,undef) if(scalar @diff ==0 );
|
$mpsoc->mpsoc_add_soc_tiles_num($p,undef) if(scalar @diff ==0 );
|
}
|
}
|
}
|
}
|
$mpsoc->mpsoc_add_soc_tiles_num($name,$inserted) if(defined $inserted );
|
$mpsoc->mpsoc_add_soc_tiles_num($name,$inserted) if(defined $inserted );
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
$wind->destroy();
|
$wind->destroy();
|
|
|
});
|
});
|
|
|
$b2->signal_connect( "clicked"=> sub{#Remove Current
|
$b2->signal_connect( "clicked"=> sub{#Remove Current
|
my @new= get_diff_array($inserted,$conflicts);
|
my @new= get_diff_array($inserted,$conflicts);
|
$mpsoc->mpsoc_add_soc_tiles_num($name,\@new) if(scalar @new );
|
$mpsoc->mpsoc_add_soc_tiles_num($name,\@new) if(scalar @new );
|
$mpsoc->mpsoc_add_soc_tiles_num($name,undef) if(scalar @new ==0 );
|
$mpsoc->mpsoc_add_soc_tiles_num($name,undef) if(scalar @new ==0 );
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
$wind->destroy();
|
$wind->destroy();
|
|
|
});
|
});
|
|
|
$b3->signal_connect( "clicked"=> sub{
|
$b3->signal_connect( "clicked"=> sub{
|
Line 315... |
Line 320... |
# check_inserted_ip_nums
|
# check_inserted_ip_nums
|
##########
|
##########
|
|
|
|
|
sub check_inserted_ip_nums{
|
sub check_inserted_ip_nums{
|
my ($mpsoc,$name,$str,$state)=@_;
|
my ($mpsoc,$name,$str)=@_;
|
my @all_num=();
|
my @all_num=();
|
$str= remove_all_white_spaces ($str);
|
$str= remove_all_white_spaces ($str);
|
|
|
if($str !~ /^[0-9.:,]+$/){ message_dialog ("The Ip numbers contains invalid character" ); return; }
|
if($str !~ /^[0-9.:,]+$/){ message_dialog ("The Ip numbers contains invalid character" ); return; }
|
my @chunks=split(',',$str);
|
my @chunks=split(',',$str);
|
Line 340... |
Line 345... |
|
|
}else{message_dialog ("invalid range: [$p]" ); return; }
|
}else{message_dialog ("invalid range: [$p]" ); return; }
|
|
|
}
|
}
|
#check if range does not exceed the tile numbers
|
#check if range does not exceed the tile numbers
|
my $nx= $mpsoc->mpsoc_get_param("NX");
|
my $nx= $mpsoc->object_get_attribute('noc_param',"NX");
|
my $ny= $mpsoc->mpsoc_get_param("NY");
|
my $ny= $mpsoc->object_get_attribute('noc_param',"NY");
|
|
|
my $max_tile_num=$nx*$ny;
|
my $max_tile_num=$nx*$ny;
|
my @f=sort { $a <=> $b } @all_num;
|
my @f=sort { $a <=> $b } @all_num;
|
my @l;
|
my @l;
|
foreach my $num (@f){
|
foreach my $num (@f){
|
Line 370... |
Line 375... |
@conflicts= (defined $conflicts_msg)? (@conflicts,@c): @c;
|
@conflicts= (defined $conflicts_msg)? (@conflicts,@c): @c;
|
}
|
}
|
}#if
|
}#if
|
}
|
}
|
if (defined $conflicts_msg) {
|
if (defined $conflicts_msg) {
|
get_conflict_decision($mpsoc,$name,\@all_num,\@conflicts,$conflicts_msg,$state);
|
get_conflict_decision($mpsoc,$name,\@all_num,\@conflicts,$conflicts_msg);
|
|
|
}else {
|
}else {
|
#save the entered ips
|
#save the entered ips
|
if( scalar @all_num>0){ $mpsoc->mpsoc_add_soc_tiles_num($name,\@all_num);}
|
if( scalar @all_num>0){ $mpsoc->mpsoc_add_soc_tiles_num($name,\@all_num);}
|
else {$mpsoc->mpsoc_add_soc_tiles_num($name,undef);}
|
else {$mpsoc->mpsoc_add_soc_tiles_num($name,undef);}
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
}
|
}
|
|
|
|
|
|
|
}
|
}
|
Line 391... |
Line 396... |
#################
|
#################
|
# get_soc_parameter_setting
|
# get_soc_parameter_setting
|
################
|
################
|
|
|
sub get_soc_parameter_setting{
|
sub get_soc_parameter_setting{
|
my ($mpsoc,$soc_name,$state,$tile)=@_;
|
my ($mpsoc,$soc_name,$tile)=@_;
|
|
|
my $window = (defined $tile)? def_popwin_size(600,400,"Parameter setting for $soc_name located in tile($tile) "):def_popwin_size(600,400,"Default Parameter setting for $soc_name ");
|
my $window = (defined $tile)? def_popwin_size(600,400,"Parameter setting for $soc_name located in tile($tile) "):def_popwin_size(600,400,"Default Parameter setting for $soc_name ");
|
my $table = def_table(10, 7, TRUE);
|
my $table = def_table(10, 7, TRUE);
|
|
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
|
Line 423... |
Line 428... |
$table->attach_defaults ($entry, 3, 6, $row, $row+1);
|
$table->attach_defaults ($entry, 3, 6, $row, $row+1);
|
$entry-> signal_connect("changed" => sub{$param_value{$p}=$entry->get_text();});
|
$entry-> signal_connect("changed" => sub{$param_value{$p}=$entry->get_text();});
|
}
|
}
|
elsif ($type eq "Combo-box"){
|
elsif ($type eq "Combo-box"){
|
my @combo_list=split(",",$content);
|
my @combo_list=split(",",$content);
|
my $pos=get_item_pos($param_value{$p}, @combo_list);
|
my $pos=get_item_pos($param_value{$p}, @combo_list) if(defined $param_value{$p});
|
my $combo=gen_combo(\@combo_list, $pos);
|
my $combo=gen_combo(\@combo_list, $pos);
|
$table->attach_defaults ($combo, 3, 6, $row, $row+1);
|
$table->attach_defaults ($combo, 3, 6, $row, $row+1);
|
$combo-> signal_connect("changed" => sub{$param_value{$p}=$combo->get_active_text();});
|
$combo-> signal_connect("changed" => sub{$param_value{$p}=$combo->get_active_text();});
|
|
|
}
|
}
|
Line 459... |
Line 464... |
$row++;
|
$row++;
|
|
|
|
|
}
|
}
|
}
|
}
|
#my @parameters=$ip->ip_get_module_parameters($category,$module);
|
|
|
|
|
|
|
|
|
|
|
|
Line 504... |
Line 509... |
}
|
}
|
else {
|
else {
|
$top->top_add_custom_soc_param(\%param_value,$tile);
|
$top->top_add_custom_soc_param(\%param_value,$tile);
|
|
|
}
|
}
|
#set_state($soc_state,"refresh_soc",1);
|
#set_gui_status($mpsoc,"refresh_soc",1);
|
#$$refresh_soc->clicked;
|
#$$refresh_soc->clicked;
|
|
|
});
|
});
|
|
|
|
|
Line 524... |
Line 529... |
################
|
################
|
# tile_set_widget
|
# tile_set_widget
|
################
|
################
|
|
|
sub tile_set_widget{
|
sub tile_set_widget{
|
my ($mpsoc,$soc_name,$num,$table,$state,$show,$row)=@_;
|
my ($mpsoc,$soc_name,$num,$table,$show,$row)=@_;
|
#my $lable=gen_label_in_left($soc);
|
#my $lable=gen_label_in_left($soc);
|
my @all_num= $mpsoc->mpsoc_get_soc_tiles_num($soc_name);
|
my @all_num= $mpsoc->mpsoc_get_soc_tiles_num($soc_name);
|
my $init=compress_nums(@all_num);
|
my $init=compress_nums(@all_num);
|
my $entry;
|
my $entry;
|
if (defined $init){$entry=gen_entry($init) ;}
|
if (defined $init){$entry=gen_entry($init) ;}
|
Line 538... |
Line 543... |
#my $setting= def_image_button('icons/setting.png','setting');
|
#my $setting= def_image_button('icons/setting.png','setting');
|
|
|
|
|
my $button = def_colored_button($soc_name,$num);
|
my $button = def_colored_button($soc_name,$num);
|
$button->signal_connect("clicked"=> sub{
|
$button->signal_connect("clicked"=> sub{
|
get_soc_parameter_setting($mpsoc,$soc_name,$state,undef);
|
get_soc_parameter_setting($mpsoc,$soc_name,undef);
|
|
|
});
|
});
|
|
|
|
|
$set->signal_connect("clicked"=> sub{
|
$set->signal_connect("clicked"=> sub{
|
my $data=$entry->get_text();
|
my $data=$entry->get_text();
|
check_inserted_ip_nums($mpsoc,$soc_name,$data,$state);
|
check_inserted_ip_nums($mpsoc,$soc_name,$data);
|
|
|
|
|
|
|
});
|
});
|
$remove->signal_connect("clicked"=> sub{
|
$remove->signal_connect("clicked"=> sub{
|
$mpsoc->mpsoc_remove_soc($soc_name);
|
$mpsoc->mpsoc_remove_soc($soc_name);
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
|
|
});
|
});
|
|
|
|
|
if($show){
|
if($show){
|
Line 582... |
Line 587... |
##################
|
##################
|
# defualt_tilles_setting
|
# defualt_tilles_setting
|
###################
|
###################
|
|
|
sub defualt_tilles_setting {
|
sub defualt_tilles_setting {
|
my ($mpsoc,$state,$table,$show,$row)=@_;
|
my ($mpsoc,$table,$show,$row,$info)=@_;
|
|
|
#title
|
#title
|
my $separator1 = Gtk2::HSeparator->new;
|
my $separator1 = Gtk2::HSeparator->new;
|
my $separator2 = Gtk2::HSeparator->new;
|
my $separator2 = Gtk2::HSeparator->new;
|
my $title2=gen_label_in_center("Tile Configuration");
|
my $title2=gen_label_in_center("Tile Configuration");
|
Line 600... |
Line 605... |
|
|
|
|
my $label = gen_label_in_left("Tiles path:");
|
my $label = gen_label_in_left("Tiles path:");
|
my $entry = Gtk2::Entry->new;
|
my $entry = Gtk2::Entry->new;
|
my $browse= def_image_button("icons/browse.png");
|
my $browse= def_image_button("icons/browse.png");
|
my $file= $mpsoc->mpsoc_get_setting('soc_path');
|
my $file= $mpsoc->object_get_attribute('setting','soc_path');
|
if(defined $file){$entry->set_text($file);}
|
if(defined $file){$entry->set_text($file);}
|
|
|
|
|
$browse->signal_connect("clicked"=> sub{
|
$browse->signal_connect("clicked"=> sub{
|
my $entry_ref=$_[1];
|
my $entry_ref=$_[1];
|
Line 624... |
Line 629... |
|
|
|
|
if ( "ok" eq $dialog->run ) {
|
if ( "ok" eq $dialog->run ) {
|
$file = $dialog->get_filename;
|
$file = $dialog->get_filename;
|
$$entry_ref->set_text($file);
|
$$entry_ref->set_text($file);
|
$mpsoc->mpsoc_set_setting('soc_path',$file);
|
$mpsoc->object_add_attribute('setting','soc_path',$file);
|
$mpsoc->mpsoc_remove_all_soc();
|
$mpsoc->mpsoc_remove_all_soc();
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
#check_input_file($file,$socgen,$soc_state,$info);
|
#check_input_file($file,$socgen,$info);
|
#print "file = $file\n";
|
#print "file = $file\n";
|
}
|
}
|
$dialog->destroy;
|
$dialog->destroy;
|
|
|
|
|
Line 641... |
Line 646... |
|
|
|
|
|
|
$entry->signal_connect("activate"=>sub{
|
$entry->signal_connect("activate"=>sub{
|
my $file_name=$entry->get_text();
|
my $file_name=$entry->get_text();
|
$mpsoc->mpsoc_set_setting('soc_path',$file_name);
|
$mpsoc->object_add_attribute('setting','soc_path',$file_name);
|
$mpsoc->mpsoc_remove_all_soc();
|
$mpsoc->mpsoc_remove_all_soc();
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
#check_input_file($file_name,$socgen,$soc_state,$info);
|
#check_input_file($file_name,$socgen,$info);
|
});
|
});
|
|
|
|
|
|
|
if($show){
|
if($show){
|
Line 662... |
Line 667... |
|
|
|
|
|
|
my @socs=$mpsoc->mpsoc_get_soc_list();
|
my @socs=$mpsoc->mpsoc_get_soc_list();
|
if( scalar @socs == 0){
|
if( scalar @socs == 0){
|
@socs=get_soc_list($mpsoc);
|
@socs=get_soc_list($mpsoc,$info);
|
|
|
}
|
}
|
@socs=$mpsoc->mpsoc_get_soc_list();
|
@socs=$mpsoc->mpsoc_get_soc_list();
|
|
|
|
|
Line 680... |
Line 685... |
if($show){
|
if($show){
|
$table->attach_defaults ($lab1 ,0,3, $row,$row+1);
|
$table->attach_defaults ($lab1 ,0,3, $row,$row+1);
|
$table->attach_defaults ($lab2 ,5,10, $row,$row+1);$row++;
|
$table->attach_defaults ($lab2 ,5,10, $row,$row+1);$row++;
|
}
|
}
|
|
|
|
|
|
|
my $soc_num=0;
|
my $soc_num=0;
|
foreach my $soc_name (@socs){
|
foreach my $soc_name (@socs){
|
$row=tile_set_widget ($mpsoc,$soc_name,$soc_num,$table,$state,$show,$row);
|
$row=tile_set_widget ($mpsoc,$soc_name,$soc_num,$table,$show,$row);
|
$soc_num++;
|
$soc_num++;
|
|
|
|
|
|
|
|
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
return $row;
|
return $row;
|
|
|
|
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#######################
|
#######################
|
# noc_config
|
# noc_config
|
######################
|
######################
|
|
|
sub noc_config{
|
sub noc_config{
|
my ($mpsoc,$state)=@_;
|
my ($mpsoc,$table)=@_;
|
my $table=def_table(20,10,FALSE);# my ($row,$col,$homogeneous)=@_;
|
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
|
|
$scrolled_win->set_policy( "automatic", "automatic" );
|
|
$scrolled_win->add_with_viewport($table);
|
|
|
|
|
|
#title
|
#title
|
my $title=gen_label_in_center("NoC Configuration");
|
my $title=gen_label_in_center("NoC Configuration");
|
my $box=def_vbox(FALSE, 1);
|
my $box=def_vbox(FALSE, 1);
|
Line 738... |
Line 725... |
my $info;
|
my $info;
|
my $row=1;
|
my $row=1;
|
|
|
#parameter start
|
#parameter start
|
my $b1;
|
my $b1;
|
my $show_noc=$mpsoc->mpsoc_get_setting('show_noc_setting');
|
my $show_noc=$mpsoc->object_get_attribute('setting','show_noc_setting');
|
|
if(!defined $show_noc){
|
|
$show_noc=1;
|
|
$mpsoc->object_add_attribute('setting','show_noc_setting',$show_noc);
|
|
|
|
}
|
if($show_noc == 0){
|
if($show_noc == 0){
|
$b1= def_image_button("icons/down.png","NoC Parameters");
|
$b1= def_image_button("icons/down.png","NoC Parameters");
|
$label=gen_label_in_center(' ');
|
$label=gen_label_in_center(' ');
|
$table->attach_defaults ( $label , 2, 10, $row,$row+1);
|
$table->attach_defaults ( $label , 2, 10, $row,$row+1);
|
$table->attach_defaults ( $b1 , 0, 4, $row,$row+1);$row++;
|
$table->attach_defaults ( $b1 , 0, 4, $row,$row+1);$row++;
|
Line 755... |
Line 747... |
$default='"VC_BASED"';
|
$default='"VC_BASED"';
|
$content='"INPUT_QUEUED","VC_BASED"';
|
$content='"INPUT_QUEUED","VC_BASED"';
|
$type='Combo-box';
|
$type='Combo-box';
|
$info=" Input-queued: simple router with low performance and does not support fully adaptive routing.
|
$info=" Input-queued: simple router with low performance and does not support fully adaptive routing.
|
VC-based routers offer higher performance, fully adaptive routing and traffic isolation for different packet classes.";
|
VC-based routers offer higher performance, fully adaptive routing and traffic isolation for different packet classes.";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$show_noc);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_type');
|
my $router_type=$mpsoc->mpsoc_get_param("ROUTER_TYPE");
|
my $router_type=$mpsoc->object_get_attribute('noc_type',"ROUTER_TYPE");
|
|
|
|
|
#P port number
|
|
$label= 'Port Number';
|
|
$param= 'P';
|
|
$default=' 5';
|
|
$content='3,12,1';
|
|
$info= 'Number of NoC router port';
|
|
$type= 'Spin-button';
|
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,0);
|
|
|
|
|
|
|
|
#Routers per row
|
#Routers per row
|
$label= 'Routers per row';
|
$label= 'Routers per row';
|
$param= 'NX';
|
$param= 'NX';
|
$default=' 2';
|
$default=' 2';
|
$content='2,16,1';
|
$content='2,16,1';
|
$info= 'Number of NoC routers in row (X dimention)';
|
$info= 'Number of NoC routers in row (X dimention)';
|
$type= 'Spin-button';
|
$type= 'Spin-button';
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$show_noc);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param');
|
|
|
|
|
|
|
#Routers per column
|
#Routers per column
|
$label= 'Routers per column';
|
$label= 'Routers per column';
|
$param= 'NY';
|
$param= 'NY';
|
$default=' 2';
|
$default=' 2';
|
$content='2,16,1';
|
$content='2,16,1';
|
$info= 'Number of NoC routers in column (Y dimention)';
|
$info= 'Number of NoC routers in column (Y dimention)';
|
$type= 'Spin-button';
|
$type= 'Spin-button';
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$show_noc);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param');
|
|
|
if($router_type eq '"VC_BASED"'){
|
if($router_type eq '"VC_BASED"'){
|
#VC number per port
|
#VC number per port
|
my $v=$mpsoc->mpsoc_get_param('V');
|
my $v=$mpsoc->object_get_attribute('noc_param','V');
|
if(defined $v){ $mpsoc->mpsoc_add_param('V',2) if($v eq 1);}
|
if(defined $v){ $mpsoc->object_add_attribute('noc_param','V',2) if($v eq 1);}
|
$label='VC number per port';
|
$label='VC number per port';
|
$param='V';
|
$param='V';
|
$default='2';
|
$default='2';
|
$type='Spin-button';
|
$type='Spin-button';
|
$content='2,16,1';
|
$content='2,16,1';
|
$info='Number of Virtual Channel per each router port';
|
$info='Number of Virtual Channel per each router port';
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$show_noc);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param');
|
} else {
|
} else {
|
$mpsoc->mpsoc_add_param('V',1);
|
$mpsoc->object_add_attribute('noc_param','V',1);
|
$mpsoc->mpsoc_add_param('C',0);
|
$mpsoc->object_add_attribute('noc_param','C',0);
|
|
|
|
|
}
|
}
|
|
|
#buffer width per VC
|
#buffer width per VC
|
Line 815... |
Line 797... |
$param='B';
|
$param='B';
|
$default='4';
|
$default='4';
|
$content='2,256,1';
|
$content='2,256,1';
|
$type='Spin-button';
|
$type='Spin-button';
|
$info=($router_type eq '"VC_BASED"')? 'Buffer queue size per VC in flits' : 'Buffer queue size in flits';
|
$info=($router_type eq '"VC_BASED"')? 'Buffer queue size per VC in flits' : 'Buffer queue size in flits';
|
$row= noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$show_noc);
|
$row= noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param');
|
|
|
#packet payload width
|
#packet payload width
|
$label='payload width';
|
$label='payload width';
|
$param='Fpay';
|
$param='Fpay';
|
$default='32';
|
$default='32';
|
$content='32,256,32';
|
$content='32,256,32';
|
$type='Spin-button';
|
$type='Spin-button';
|
$info="The packet payload width in bits";
|
$info="The packet payload width in bits";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$show_noc);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info,$table,$row,$show_noc,'noc_param');
|
|
|
#topology
|
#topology
|
$label='Topology';
|
$label='Topology';
|
$param='TOPOLOGY';
|
$param='TOPOLOGY';
|
$default='"MESH"';
|
$default='"MESH"';
|
$content='"MESH","TORUS"';
|
$content='"MESH","TORUS"';
|
$type='Combo-box';
|
$type='Combo-box';
|
$info="NoC topology";
|
$info="NoC topology";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$show_noc);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param');
|
|
|
#routing algorithm
|
#routing algorithm
|
my $topology=$mpsoc->mpsoc_get_param('TOPOLOGY');
|
my $topology=$mpsoc->object_get_attribute('noc_param','TOPOLOGY');
|
$label='Routing Algorithm';
|
$label='Routing Algorithm';
|
$param="ROUTE_NAME";
|
$param="ROUTE_NAME";
|
$type="Combo-box";
|
$type="Combo-box";
|
if($router_type eq '"VC_BASED"'){
|
if($router_type eq '"VC_BASED"'){
|
$content=($topology eq '"MESH"')? '"XY","WEST_FIRST","NORTH_LAST","NEGETIVE_FIRST","DUATO"' :
|
$content=($topology eq '"MESH"')? '"XY","WEST_FIRST","NORTH_LAST","NEGETIVE_FIRST","DUATO"' :
|
Line 852... |
Line 834... |
|
|
|
|
}
|
}
|
$default=($topology eq '"MESH"')? '"XY"':'"TRANC_XY"';
|
$default=($topology eq '"MESH"')? '"XY"':'"TRANC_XY"';
|
$info="Select the routing algorithm: XY(DoR) , partially adaptive (Turn models). Fully adaptive (Duato) ";
|
$info="Select the routing algorithm: XY(DoR) , partially adaptive (Turn models). Fully adaptive (Duato) ";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$show_noc);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param');
|
|
|
|
|
|
#SSA
|
|
$label='SSA Ebable';
|
|
$param='SSA_EN';
|
|
$default='"NO"';
|
|
$content='"YES","NO"';
|
|
$type='Combo-box';
|
|
$info="Enable single cycle latency on packets traversing in the same direction using static straight allocator (SSA)";
|
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param');
|
|
|
|
|
|
|
|
|
|
|
if($show_noc == 1){
|
if($show_noc == 1){
|
$b1= def_image_button("icons/up.png","NoC Parameters");
|
$b1= def_image_button("icons/up.png","NoC Parameters");
|
$table->attach_defaults ( $b1 , 0, 2, $row,$row+1);$row++;
|
$table->attach_defaults ( $b1 , 0, 2, $row,$row+1);$row++;
|
}
|
}
|
$b1->signal_connect("clicked" => sub{
|
$b1->signal_connect("clicked" => sub{
|
$show_noc=($show_noc==1)?0:1;
|
$show_noc=($show_noc==1)?0:1;
|
$mpsoc->mpsoc_set_setting('show_noc_setting',$show_noc);
|
$mpsoc->object_add_attribute('setting','show_noc_setting',$show_noc);
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
|
|
});
|
});
|
|
|
#advance parameter start
|
#advance parameter start
|
my $advc;
|
my $advc;
|
my $adv_set=$mpsoc->mpsoc_get_setting('show_adv_setting');
|
my $adv_set=$mpsoc->object_get_attribute('setting','show_adv_setting');
|
if($adv_set == 0){
|
if($adv_set == 0){
|
$advc= def_image_button("icons/down.png","Advance Parameters");
|
$advc= def_image_button("icons/down.png","Advance Parameters");
|
$table->attach_defaults ( $advc , 0, 4, $row,$row+1);$row++;
|
$table->attach_defaults ( $advc , 0, 4, $row,$row+1);$row++;
|
|
|
}
|
}
|
|
|
|
|
|
|
#Fully and partially adaptive routing setting
|
#Fully and partially adaptive routing setting
|
my $route=$mpsoc->mpsoc_get_param("ROUTE_NAME");
|
my $route=$mpsoc->object_get_attribute('noc_param',"ROUTE_NAME");
|
if($route ne '"XY"' and $route ne '"TRANC_XY"' ){
|
if($route ne '"XY"' and $route ne '"TRANC_XY"' ){
|
$label="Congestion index";
|
$label="Congestion index";
|
$param="CONGESTION_INDEX";
|
$param="CONGESTION_INDEX";
|
$type="Spin-button";
|
$type="Spin-button";
|
$content="0,12,1";
|
$content="0,12,1";
|
$info="Congestion index determines how congestion information is collected from neighboring routers. Please refer to the usere manual for more information";
|
$info="Congestion index determines how congestion information is collected from neighboring routers. Please refer to the usere manual for more information";
|
$default=3;
|
$default=3;
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$adv_set);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
|
|
}
|
}
|
#Fully adaptive routing setting
|
#Fully adaptive routing setting
|
if( $route eq '"TRANC_DUATO"' or $route eq '"DUATO"' ){
|
if( $route eq '"TRANC_DUATO"' or $route eq '"DUATO"' ){
|
my $v=$mpsoc->mpsoc_get_param("V");
|
my $v=$mpsoc->object_get_attribute('noc_param',"V");
|
$label="Select Escap VC";
|
$label="Select Escap VC";
|
$param="ESCAP_VC_MASK";
|
$param="ESCAP_VC_MASK";
|
$type="Check-box";
|
$type="Check-box";
|
$content=$v;
|
$content=$v;
|
$default="$v\'b";
|
$default="$v\'b";
|
for (my $i=1; $i<=$v-1; $i++){$default= "${default}0";}
|
for (my $i=1; $i<=$v-1; $i++){$default= "${default}0";}
|
$default= "${default}1";
|
$default= "${default}1";
|
|
|
|
|
$info="Select the escap VC for fully adaptive routing.";
|
$info="Select the escap VC for fully adaptive routing.";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$adv_set,$adv_set);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,$adv_set,'noc_param');
|
|
|
}
|
}
|
|
|
# VC reallocation type
|
# VC reallocation type
|
$label=($router_type eq '"VC_BASED"')? 'VC reallocation type': 'Queue reallocation type';
|
$label=($router_type eq '"VC_BASED"')? 'VC reallocation type': 'Queue reallocation type';
|
$param='VC_REALLOCATION_TYPE';
|
$param='VC_REALLOCATION_TYPE';
|
$info="VC reallocation type: If set as atomic only empty VCs can be allocated for new packets. Whereas, in non-atomic a non-empty VC which has received the last packet tail flit can accept a new packet";
|
$info="VC reallocation type: If set as atomic only empty VCs can be allocated for new packets. Whereas, in non-atomic a non-empty VC which has received the last packet tail flit can accept a new packet";
|
$default='"NONATOMIC"';
|
$default='"NONATOMIC"';
|
$content='"ATOMIC","NONATOMIC"';
|
$content='"ATOMIC","NONATOMIC"';
|
$type='Combo-box';
|
$type='Combo-box';
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$adv_set);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
|
|
|
|
|
|
|
|
if ($router_type eq '"VC_BASED"'){
|
if ($router_type eq '"VC_BASED"'){
|
Line 926... |
Line 921... |
$param='COMBINATION_TYPE';
|
$param='COMBINATION_TYPE';
|
$default='"COMB_NONSPEC"';
|
$default='"COMB_NONSPEC"';
|
$content='"BASELINE","COMB_SPEC1","COMB_SPEC2","COMB_NONSPEC"';
|
$content='"BASELINE","COMB_SPEC1","COMB_SPEC2","COMB_NONSPEC"';
|
$type='Combo-box';
|
$type='Combo-box';
|
$info="The joint VC/ switch allocator type. using canonical combination is not recommanded";
|
$info="The joint VC/ switch allocator type. using canonical combination is not recommanded";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$adv_set);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
|
|
}
|
}
|
|
|
# Crossbar mux type
|
# Crossbar mux type
|
$label='Crossbar mux type';
|
$label='Crossbar mux type';
|
$param='MUX_TYPE';
|
$param='MUX_TYPE';
|
$default='"BINARY"';
|
$default='"BINARY"';
|
$content='"ONE_HOT","BINARY"';
|
$content='"ONE_HOT","BINARY"';
|
$type='Combo-box';
|
$type='Combo-box';
|
$info="Crossbar multiplexer type";
|
$info="Crossbar multiplexer type";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$adv_set);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
|
|
if($router_type eq '"VC_BASED"'){
|
if($router_type eq '"VC_BASED"'){
|
#class
|
#class
|
$label='class number';
|
$label='class number';
|
$param='C';
|
$param='C';
|
$default= 0;
|
$default= 0;
|
$info='Number of message classes. Each specific class can use different set of VC';
|
$info='Number of message classes. Each specific class can use different set of VC';
|
$content='0,16,1';
|
$content='0,16,1';
|
$type='Spin-button';
|
$type='Spin-button';
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$adv_set);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
|
|
|
|
my $class=$mpsoc->mpsoc_get_param("C");
|
my $class=$mpsoc->object_get_attribute('noc_param',"C");
|
my $v=$mpsoc->mpsoc_get_param("V");
|
my $v=$mpsoc->object_get_attribute('noc_param',"V");
|
$default= "$v\'b";
|
$default= "$v\'b";
|
for (my $i=1; $i<=$v; $i++){
|
for (my $i=1; $i<=$v; $i++){
|
$default= "${default}1";
|
$default= "${default}1";
|
}
|
}
|
#print "\$default=$default\n";
|
#print "\$default=$default\n";
|
Line 964... |
Line 959... |
$label="Class $i Permitted VCs";
|
$label="Class $i Permitted VCs";
|
$param="Cn_$i";
|
$param="Cn_$i";
|
$type="Check-box";
|
$type="Check-box";
|
$content=$v;
|
$content=$v;
|
$info="Select the permitted VCs which the message class $i can be sent via them.";
|
$info="Select the permitted VCs which the message class $i can be sent via them.";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$adv_set);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
|
|
|
|
}
|
}
|
|
|
|
|
Line 982... |
Line 977... |
$param='DEBUG_EN';
|
$param='DEBUG_EN';
|
$info= "Add extra verilog code for debuging NoC for simulation";
|
$info= "Add extra verilog code for debuging NoC for simulation";
|
$default='0';
|
$default='0';
|
$content='0,1';
|
$content='0,1';
|
$type='Combo-box';
|
$type='Combo-box';
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,$adv_set);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
|
|
|
|
|
|
|
|
|
|
Line 994... |
Line 989... |
$param="ADD_PIPREG_AFTER_CROSSBAR";
|
$param="ADD_PIPREG_AFTER_CROSSBAR";
|
$type="Check-box";
|
$type="Check-box";
|
$content=1;
|
$content=1;
|
$default="1\'b0";
|
$default="1\'b0";
|
$info="If ebabled it adds a pipline register at the output port of the router.";
|
$info="If ebabled it adds a pipline register at the output port of the router.";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,0);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
|
|
|
|
|
|
$label="Add pipeline reg befor crossbar";
|
|
$param="ADD_PIPREG_BEFORE_CROSSBAR";
|
|
$type="Check-box";
|
|
$content=1;
|
|
$default="1\'b0";
|
|
$info="If ebabled it adds a pipline register after the input memory sd ram.";
|
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,0);
|
|
|
|
|
|
|
|
if($adv_set == 1){
|
if($adv_set == 1){
|
$advc= def_image_button("icons/up.png","Advance Parameters");
|
$advc= def_image_button("icons/up.png","Advance Parameters");
|
$table->attach_defaults ( $advc , 0, 4, $row,$row+1);$row++;
|
$table->attach_defaults ( $advc , 0, 4, $row,$row+1);$row++;
|
}
|
}
|
$advc->signal_connect("clicked" => sub{
|
$advc->signal_connect("clicked" => sub{
|
$adv_set=($adv_set==1)?0:1;
|
$adv_set=($adv_set==1)?0:1;
|
$mpsoc->mpsoc_set_setting('show_adv_setting',$adv_set);
|
$mpsoc->object_add_attribute('setting','show_adv_setting',$adv_set);
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
|
|
|
|
});
|
});
|
|
|
|
|
#other fixed parameters
|
#other fixed parameters
|
|
|
Line 1030... |
Line 1017... |
$param='FIRST_ARBITER_EXT_P_EN';
|
$param='FIRST_ARBITER_EXT_P_EN';
|
$default= 0;
|
$default= 0;
|
$info='FIRST_ARBITER_EXT_P_EN';
|
$info='FIRST_ARBITER_EXT_P_EN';
|
$content='0,1';
|
$content='0,1';
|
$type="Combo-box";
|
$type="Combo-box";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,0);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info,$table,$row,0,'noc_param');
|
|
|
|
|
#ROUTE_TYPE
|
|
$param='ROUTE_TYPE';
|
|
$default='(ROUTE_NAME == "XY" || ROUTE_NAME == "TRANC_XY" )? "DETERMINISTIC" :
|
|
(ROUTE_NAME == "DUATO" || ROUTE_NAME == "TRANC_DUATO" )? "FULL_ADAPTIVE": "PAR_ADAPTIVE"';
|
|
$info='ROUTE_TYPE';
|
|
$type="Entry";
|
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,0);
|
|
|
|
# AVC_ATOMIC_EN
|
# AVC_ATOMIC_EN
|
$label='AVC_ATOMIC_EN';
|
$label='AVC_ATOMIC_EN';
|
$param='AVC_ATOMIC_EN';
|
$param='AVC_ATOMIC_EN';
|
$default= 0;
|
$default= 0;
|
$info='AVC_ATOMIC_EN';
|
$info='AVC_ATOMIC_EN';
|
$content='0,1';
|
$content='0,1';
|
$type="Combo-box";
|
$type="Combo-box";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,0);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,0,'noc_param');
|
|
|
|
|
#ROUTE_SUBFUNC
|
#ROUTE_SUBFUNC
|
$label='ROUTE_SUBFUNC';
|
$label='ROUTE_SUBFUNC';
|
$param='ROUTE_SUBFUNC';
|
$param='ROUTE_SUBFUNC';
|
$default= '"XY"';
|
$default= '"XY"';
|
$info='ROUTE_SUBFUNC';
|
$info='ROUTE_SUBFUNC';
|
$content='"XY"';
|
$content='"XY"';
|
$type="Combo-box";
|
$type="Combo-box";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $state,$table,$row,0);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,0,'noc_param');
|
|
|
|
return $row;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#######################
|
|
# get_config
|
|
######################
|
|
|
|
sub get_config{
|
|
my ($mpsoc,$info)=@_;
|
|
my $table=def_table(20,10,FALSE);# my ($row,$col,$homogeneous)=@_;
|
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
|
|
$scrolled_win->set_policy( "automatic", "automatic" );
|
|
$scrolled_win->add_with_viewport($table);
|
|
|
|
#noc_setting
|
|
my $row=noc_config ($mpsoc,$table);
|
|
|
|
|
#tile setting
|
#tile setting
|
my $tile_set;
|
my $tile_set;
|
my $show=$mpsoc->mpsoc_get_setting('show_tile_setting');
|
my $show=$mpsoc->object_get_attribute('setting','show_tile_setting');
|
|
|
if($show == 0){
|
if($show == 0){
|
$tile_set= def_image_button("icons/down.png","Tiles setting");
|
$tile_set= def_image_button("icons/down.png","Tiles setting");
|
$table->attach_defaults ( $tile_set , 0, 4, $row,$row+1);$row++;
|
$table->attach_defaults ( $tile_set , 0, 4, $row,$row+1);$row++;
|
|
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
$row=defualt_tilles_setting($mpsoc,$state,$table,$show,$row);
|
$row=defualt_tilles_setting($mpsoc,$table,$show,$row,$info);
|
|
|
|
|
|
|
|
|
|
|
Line 1088... |
Line 1107... |
$tile_set= def_image_button("icons/up.png","Tiles setting");
|
$tile_set= def_image_button("icons/up.png","Tiles setting");
|
$table->attach_defaults ( $tile_set , 0, 1, $row,$row+1);$row++;
|
$table->attach_defaults ( $tile_set , 0, 1, $row,$row+1);$row++;
|
}
|
}
|
$tile_set->signal_connect("clicked" => sub{
|
$tile_set->signal_connect("clicked" => sub{
|
$show=($show==1)?0:1;
|
$show=($show==1)?0:1;
|
$mpsoc->mpsoc_set_setting('show_tile_setting',$show);
|
$mpsoc->object_add_attribute('setting','show_tile_setting',$show);
|
set_state($state,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
|
|
|
|
});
|
});
|
|
|
|
|
Line 1119... |
Line 1138... |
#
|
#
|
###########
|
###########
|
|
|
sub gen_socs {
|
sub gen_socs {
|
my ($mpsoc,$info)=@_;
|
my ($mpsoc,$info)=@_;
|
|
my $path=$mpsoc->object_get_attribute('setting','soc_path');
|
my $path=$mpsoc->mpsoc_get_setting('soc_path');
|
|
$path=~ s/ /\\ /g;
|
$path=~ s/ /\\ /g;
|
my @socs;
|
my @socs;
|
my @files = glob "$path/*.SOC";
|
my @files = glob "$path/*.SOC";
|
my @soc_list=$mpsoc-> mpsoc_get_soc_list();
|
my @soc_list=$mpsoc-> mpsoc_get_soc_list();
|
my @used_socs;
|
my @used_socs;
|
Line 1137... |
Line 1155... |
}
|
}
|
|
|
for my $p (@files){
|
for my $p (@files){
|
# Read
|
# Read
|
my $soc = eval { do $p };
|
my $soc = eval { do $p };
|
my $name=$soc->soc_get_soc_name();
|
if ($@ || !defined $soc){
|
|
show_info(\$info,"**Error reading $p file: $@\n");
|
|
next;
|
|
}
|
|
my $name=$soc->object_get_attribute('soc_name');
|
if( grep (/^$name$/,@used_socs)){
|
if( grep (/^$name$/,@used_socs)){
|
#generate the soc
|
#generate the soc
|
generate_soc_files($mpsoc,$soc,$info);
|
generate_soc_files($mpsoc,$soc,$info);
|
|
|
|
|
Line 1159... |
Line 1181... |
# generate_soc
|
# generate_soc
|
#################
|
#################
|
|
|
sub generate_soc_files{
|
sub generate_soc_files{
|
my ($mpsoc,$soc,$info)=@_;
|
my ($mpsoc,$soc,$info)=@_;
|
my $mpsoc_name=$mpsoc->mpsoc_get_mpsoc_name();
|
my $mpsoc_name=$mpsoc->object_get_attribute('mpsoc_name');
|
my $soc_name=$soc->soc_get_soc_name();
|
my $soc_name=$soc->object_get_attribute('soc_name');
|
my $file_v=soc_generate_verilog($soc);
|
my ($file_v,$tmp)=soc_generate_verilog($soc);
|
|
|
# Write object file
|
# Write object file
|
open(FILE, ">lib/soc/$soc_name.SOC") || die "Can not open: $!";
|
open(FILE, ">lib/soc/$soc_name.SOC") || die "Can not open: $!";
|
|
print FILE perl_file_header("$soc_name.SOC");
|
print FILE Data::Dumper->Dump([\%$soc],[$soc_name]);
|
print FILE Data::Dumper->Dump([\%$soc],[$soc_name]);
|
close(FILE) || die "Error closing file: $!";
|
close(FILE) || die "Error closing file: $!";
|
|
|
# Write verilog file
|
# Write verilog file
|
open(FILE, ">lib/verilog/$soc_name.v") || die "Can not open: $!";
|
open(FILE, ">lib/verilog/$soc_name.v") || die "Can not open: $!";
|
Line 1245... |
Line 1268... |
# generate_mpsoc
|
# generate_mpsoc
|
#################
|
#################
|
|
|
sub generate_mpsoc{
|
sub generate_mpsoc{
|
my ($mpsoc,$info)=@_;
|
my ($mpsoc,$info)=@_;
|
my $name=$mpsoc->mpsoc_get_mpsoc_name();
|
my $name=$mpsoc->object_get_attribute('mpsoc_name');
|
my $size= (defined $name)? length($name) :0;
|
my $size= (defined $name)? length($name) :0;
|
if ($size >0){
|
if ($size >0){
|
my $file_v=mpsoc_generate_verilog($mpsoc);
|
gen_socs($mpsoc,$info);
|
|
my ($file_v,$tmp)=mpsoc_generate_verilog($mpsoc);
|
|
|
# Write object file
|
# Write object file
|
open(FILE, ">lib/mpsoc/$name.MPSOC") || die "Can not open: $!";
|
open(FILE, ">lib/mpsoc/$name.MPSOC") || die "Can not open: $!";
|
|
print FILE perl_file_header("$name.MPSOC");
|
print FILE Data::Dumper->Dump([\%$mpsoc],[$name]);
|
print FILE Data::Dumper->Dump([\%$mpsoc],[$name]);
|
close(FILE) || die "Error closing file: $!";
|
close(FILE) || die "Error closing file: $!";
|
|
|
# Write verilog file
|
# Write verilog file
|
open(FILE, ">lib/verilog/$name.v") || die "Can not open: $!";
|
open(FILE, ">lib/verilog/$name.v") || die "Can not open: $!";
|
Line 1271... |
Line 1296... |
my $project_dir = abs_path("$dir/../../");
|
my $project_dir = abs_path("$dir/../../");
|
my $target_dir = "$project_dir/mpsoc_work/MPSOC/$name";
|
my $target_dir = "$project_dir/mpsoc_work/MPSOC/$name";
|
mkpath("$target_dir/src_verilog/lib/",1,0755);
|
mkpath("$target_dir/src_verilog/lib/",1,0755);
|
mkpath("$target_dir/sw",1,0755);
|
mkpath("$target_dir/sw",1,0755);
|
|
|
gen_socs($mpsoc,$info);
|
#gen_socs($mpsoc,$info);
|
|
|
move ("$dir/lib/verilog/$name.v","$target_dir/src_verilog/");
|
move ("$dir/lib/verilog/$name.v","$target_dir/src_verilog/");
|
|
|
|
|
|
|
Line 1296... |
Line 1321... |
|
|
|
|
|
|
|
|
sub get_tile_LIST{
|
sub get_tile_LIST{
|
my ($mpsoc,$state,$x,$y,$soc_num,$row,$table)=@_;
|
my ($mpsoc,$x,$y,$soc_num,$row,$table)=@_;
|
my $instance_name=$mpsoc->mpsoc_get_instance_info($soc_num);
|
my $instance_name=$mpsoc->mpsoc_get_instance_info($soc_num);
|
if(!defined $instance_name){
|
if(!defined $instance_name){
|
$mpsoc->mpsoc_set_default_ip($soc_num);
|
$mpsoc->mpsoc_set_default_ip($soc_num);
|
$instance_name=$mpsoc->mpsoc_get_instance_info($soc_num);
|
$instance_name=$mpsoc->mpsoc_get_instance_info($soc_num);
|
|
|
Line 1314... |
Line 1339... |
my $entry=gen_entry($instance_name);
|
my $entry=gen_entry($instance_name);
|
$table->attach_defaults ( $entry, $col, $col+1 , $row, $row+1);$col+=2;
|
$table->attach_defaults ( $entry, $col, $col+1 , $row, $row+1);$col+=2;
|
$entry->signal_connect( 'changed'=> sub{
|
$entry->signal_connect( 'changed'=> sub{
|
my $new_instance=$entry->get_text();
|
my $new_instance=$entry->get_text();
|
$mpsoc->mpsoc_set_ip_inst_name($soc_num,$new_instance);
|
$mpsoc->mpsoc_set_ip_inst_name($soc_num,$new_instance);
|
set_state($state,"ref",20);
|
set_gui_status($mpsoc,"ref",20);
|
print "changed to $new_instance\n ";
|
print "changed to $new_instance\n ";
|
|
|
});
|
});
|
|
|
|
|
Line 1339... |
Line 1364... |
##########
|
##########
|
#
|
#
|
#########
|
#########
|
|
|
sub gen_tiles_LIST{
|
sub gen_tiles_LIST{
|
my ($mpsoc,$soc_state)=@_;
|
my ($mpsoc)=@_;
|
|
|
my $nx= $mpsoc->mpsoc_get_param("NX");
|
my $nx= $mpsoc->object_get_attribute('noc_param',"NX");
|
my $ny= $mpsoc->mpsoc_get_param("NY");
|
my $ny= $mpsoc->object_get_attribute('noc_param',"NY");
|
|
|
# print "($nx,$ny);\n";
|
# print "($nx,$ny);\n";
|
my $table=def_table($nx*$ny,4,FALSE);# my ($row,$col,$homogeneous)=@_;
|
my $table=def_table($nx*$ny,4,FALSE);# my ($row,$col,$homogeneous)=@_;
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
|
$scrolled_win->set_policy( "automatic", "automatic" );
|
$scrolled_win->set_policy( "automatic", "automatic" );
|
Line 1372... |
Line 1397... |
|
|
for (my $x=0; $x<$nx;$x++){
|
for (my $x=0; $x<$nx;$x++){
|
my $soc_num= $y*$nx+$x;
|
my $soc_num= $y*$nx+$x;
|
my $seph = Gtk2::HSeparator->new;
|
my $seph = Gtk2::HSeparator->new;
|
$table->attach_defaults ($seph, 0, 8 , $row, $row+1);$row++;
|
$table->attach_defaults ($seph, 0, 8 , $row, $row+1);$row++;
|
get_tile($mpsoc,$soc_state,$x,$y,$soc_num,$row,$table);$row++;
|
get_tile($mpsoc,$x,$y,$soc_num,$row,$table);$row++;
|
|
|
|
|
|
|
|
|
}}
|
}}
|
Line 1402... |
Line 1427... |
|
|
|
|
|
|
|
|
sub get_tile{
|
sub get_tile{
|
my ($mpsoc,$state,$tile,$x,$y)=@_;
|
my ($mpsoc,$tile,$x,$y)=@_;
|
|
|
|
|
my ($soc_name,$num)= $mpsoc->mpsoc_get_tile_soc_name($tile);
|
my ($soc_name,$num)= $mpsoc->mpsoc_get_tile_soc_name($tile);
|
|
|
my $button;
|
my $button;
|
Line 1446... |
Line 1471... |
|
|
my $param_setting=$mpsoc->mpsoc_get_tile_param_setting($tile);
|
my $param_setting=$mpsoc->mpsoc_get_tile_param_setting($tile);
|
@list=('Default','Custom');
|
@list=('Default','Custom');
|
$pos=(defined $param_setting)? get_scolar_pos($param_setting,@list): 0;
|
$pos=(defined $param_setting)? get_scolar_pos($param_setting,@list): 0;
|
my $nn=(defined $soc_name)? $soc_name : 'soc';
|
my $nn=(defined $soc_name)? $soc_name : 'soc';
|
my ($box2,$combo2)=gen_combo_help("Defualt: the tail will get deafualt parameter setting of $nn.\n Custom: it will allow custom parameter setting for this tile only." , \@list, $pos);
|
my ($box2,$combo2)=gen_combo_help("Defualt: the tail will get defualt parameter setting of $nn.\n Custom: it will allow custom parameter setting for this tile only." , \@list, $pos);
|
my $lable2=gen_label_in_left(" Parameter Setting:");
|
my $lable2=gen_label_in_left(" Parameter Setting:");
|
$table->attach_defaults($lable2,0,3,$row,$row+1);
|
$table->attach_defaults($lable2,0,3,$row,$row+1);
|
$table->attach_defaults($box2,3,7,$row,$row+1);$row++;
|
$table->attach_defaults($box2,3,7,$row,$row+1);$row++;
|
$combo2->signal_connect('changed'=>sub{
|
$combo2->signal_connect('changed'=>sub{
|
my $in=$combo2->get_active_text();
|
my $in=$combo2->get_active_text();
|
Line 1489... |
Line 1514... |
$window->add ($mtable);
|
$window->add ($mtable);
|
$window->show_all();
|
$window->show_all();
|
|
|
$ok-> signal_connect("clicked" => sub{
|
$ok-> signal_connect("clicked" => sub{
|
$window->destroy;
|
$window->destroy;
|
set_state($state,"refresh_soc",1);
|
set_gui_status($mpsoc,"refresh_soc",1);
|
my $soc_name=$combo->get_active_text();
|
my $soc_name=$combo->get_active_text();
|
my $setting=$combo2->get_active_text();
|
my $setting=$combo2->get_active_text();
|
if ($soc_name ne ' ' && $setting ne 'Default'){
|
if ($soc_name ne ' ' && $setting ne 'Default'){
|
get_soc_parameter_setting ($mpsoc,$soc_name,$state,$tile);
|
get_soc_parameter_setting ($mpsoc,$soc_name,$tile);
|
|
|
}
|
}
|
#save new values
|
#save new values
|
#$top->top_add_default_soc_param(\%param_value);
|
#$top->top_add_default_soc_param(\%param_value);
|
#set_state($soc_state,"refresh_soc",1);
|
#set_gui_status($mpsoc,"refresh_soc",1);
|
#$$refresh_soc->clicked;
|
#$$refresh_soc->clicked;
|
|
|
});
|
});
|
|
|
});
|
});
|
Line 1524... |
Line 1549... |
##########
|
##########
|
#
|
#
|
#########
|
#########
|
|
|
sub gen_tiles{
|
sub gen_tiles{
|
my ($mpsoc,$soc_state)=@_;
|
my ($mpsoc)=@_;
|
|
|
my $nx= $mpsoc->mpsoc_get_param("NX");
|
my $nx= $mpsoc->object_get_attribute('noc_param',"NX");
|
my $ny= $mpsoc->mpsoc_get_param("NY");
|
my $ny= $mpsoc->object_get_attribute('noc_param',"NY");
|
|
|
#print "($nx,$ny);\n";
|
#print "($nx,$ny);\n";
|
my $table=def_table($nx,$ny,FALSE);# my ($row,$col,$homogeneous)=@_;
|
my $table=def_table($nx,$ny,FALSE);# my ($row,$col,$homogeneous)=@_;
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
|
$scrolled_win->set_policy( "automatic", "automatic" );
|
$scrolled_win->set_policy( "automatic", "automatic" );
|
Line 1543... |
Line 1568... |
|
|
|
|
for (my $y=0;$y<$ny;$y++){
|
for (my $y=0;$y<$ny;$y++){
|
for (my $x=0; $x<$nx;$x++){
|
for (my $x=0; $x<$nx;$x++){
|
my $tile_num=($nx*$y)+ $x;
|
my $tile_num=($nx*$y)+ $x;
|
my $tile=get_tile($mpsoc,$soc_state,$tile_num,$x,$y);
|
my $tile=get_tile($mpsoc,$tile_num,$x,$y);
|
#print "($x,$y);\n";
|
#print "($x,$y);\n";
|
$table->attach_defaults ($tile, $x, $x+1 , $y, $y+1);
|
$table->attach_defaults ($tile, $x, $x+1 , $y, $y+1);
|
|
|
|
|
}}
|
}}
|
Line 1570... |
Line 1595... |
my $infc = interface->interface_new();
|
my $infc = interface->interface_new();
|
my $soc = ip->lib_new ();
|
my $soc = ip->lib_new ();
|
#my $soc = soc->soc_new();
|
#my $soc = soc->soc_new();
|
|
|
my $mpsoc= mpsoc->mpsoc_new();
|
my $mpsoc= mpsoc->mpsoc_new();
|
#my $soc= eval { do 'lib/soc/soc.SOC' };
|
|
|
|
my $soc_state= def_state("ideal");
|
set_gui_status($mpsoc,"ideal",0);
|
|
|
# main window
|
# main window
|
#my $window = def_win_size(1000,800,"Top");
|
#my $window = def_win_size(1000,800,"Top");
|
# The main table containg the lib tree, selected modules and info section
|
# The main table containg the lib tree, selected modules and info section
|
my $main_table = Gtk2::Table->new (25, 12, FALSE);
|
my $main_table = Gtk2::Table->new (25, 12, FALSE);
|
|
|
Line 1585... |
Line 1610... |
|
|
|
|
my $refresh = Gtk2::Button->new_from_stock('ref');
|
my $refresh = Gtk2::Button->new_from_stock('ref');
|
|
|
|
|
my $noc_conf_box=noc_config ($mpsoc,$soc_state);
|
my $noc_conf_box=get_config ($mpsoc,$info);
|
my $noc_tiles=gen_tiles($mpsoc,$soc_state);
|
my $noc_tiles=gen_tiles($mpsoc);
|
|
|
|
|
|
|
$main_table->set_row_spacings (4);
|
$main_table->set_row_spacings (4);
|
$main_table->set_col_spacings (1);
|
$main_table->set_col_spacings (1);
|
|
|
#my $device_win=show_active_dev($soc,$soc,$infc,$soc_state,\$refresh,$info);
|
#my $device_win=show_active_dev($soc,$soc,$infc,\$refresh,$info);
|
|
|
|
|
my $generate = def_image_button('icons/gen.png','Generate');
|
my $generate = def_image_button('icons/gen.png','Generate');
|
my $genbox=def_hbox(TRUE,0);
|
|
$genbox->pack_start($generate, FALSE, FALSE,0);
|
|
|
|
|
|
|
|
my $open = def_image_button('icons/browse.png','Load MPSoC');
|
my $open = def_image_button('icons/browse.png','Load MPSoC');
|
my $openbox=def_hbox(TRUE,0);
|
|
$openbox->pack_start($open, FALSE, FALSE,0);
|
|
|
|
|
|
|
my $entry=gen_entry_object($mpsoc,'soc_name',undef,undef,undef,undef);
|
|
my $entrybox=labele_widget_info(" MPSoC name:",$entry);
|
|
|
|
|
my ($entrybox,$entry) = def_h_labeled_entry('MPSoC name:');
|
|
$entry->signal_connect( 'changed'=> sub{
|
|
my $name=$entry->get_text();
|
|
$mpsoc->mpsoc_set_mpsoc_name($name);
|
|
});
|
|
|
|
#$table->attach_defaults ($event_box, $col, $col+1, $row, $row+1);
|
#$table->attach_defaults ($event_box, $col, $col+1, $row, $row+1);
|
$main_table->attach_defaults ($noc_conf_box , 0, 4, 0, 23);
|
$main_table->attach_defaults ($noc_conf_box , 0, 4, 0, 22);
|
$main_table->attach_defaults ($noc_tiles , 4, 12, 0, 23);
|
$main_table->attach_defaults ($noc_tiles , 4, 12, 0, 22);
|
$main_table->attach_defaults ($infobox , 0, 12, 23,24);
|
$main_table->attach_defaults ($infobox , 0, 12, 22,24);
|
$main_table->attach_defaults ($openbox,0, 3, 24,25);
|
$main_table->attach ($open,0, 3, 24,25,'expand','shrink',2,2);
|
$main_table->attach_defaults ($entrybox,3, 7, 24,25);
|
$main_table->attach_defaults ($entrybox,3, 7, 24,25);
|
|
|
$main_table->attach_defaults ($genbox, 10, 12, 24,25);
|
$main_table->attach ($generate, 10, 12, 24,25,'expand','shrink',2,2);
|
|
|
|
|
#referesh the mpsoc generator
|
#referesh the mpsoc generator
|
$refresh-> signal_connect("clicked" => sub{
|
$refresh-> signal_connect("clicked" => sub{
|
$noc_conf_box->destroy();
|
$noc_conf_box->destroy();
|
$noc_conf_box=noc_config ($mpsoc,$soc_state);
|
$noc_conf_box=get_config ($mpsoc,$info);
|
$main_table->attach_defaults ($noc_conf_box , 0, 4, 0, 23);
|
$main_table->attach_defaults ($noc_conf_box , 0, 4, 0, 22);
|
$noc_conf_box->show_all();
|
$noc_conf_box->show_all();
|
|
|
|
|
|
|
$noc_tiles->destroy();
|
$noc_tiles->destroy();
|
$noc_tiles=gen_tiles($mpsoc,$soc_state);
|
$noc_tiles=gen_tiles($mpsoc);
|
$main_table->attach_defaults ($noc_tiles , 4, 12, 0, 23);
|
$main_table->attach_defaults ($noc_tiles , 4, 12, 0, 22);
|
|
|
$main_table->show_all();
|
$main_table->show_all();
|
|
|
|
|
});
|
});
|
|
|
|
|
|
|
#check soc status every 0.5 second. referesh device table if there is any changes
|
#check soc status every 0.5 second. referesh device table if there is any changes
|
Glib::Timeout->add (100, sub{
|
Glib::Timeout->add (100, sub{
|
|
my ($state,$timeout)= get_gui_status($mpsoc);
|
|
|
my ($state,$timeout)= get_state($soc_state);
|
|
|
|
if ($timeout>0){
|
if ($timeout>0){
|
$timeout--;
|
$timeout--;
|
set_state($soc_state,$state,$timeout);
|
set_gui_status($mpsoc,$state,$timeout);
|
}
|
}
|
elsif( $state ne "ideal" ){
|
elsif( $state ne "ideal" ){
|
$refresh->clicked;
|
$refresh->clicked;
|
my $saved_name=$mpsoc->mpsoc_get_mpsoc_name();
|
my $saved_name=$mpsoc->object_get_attribute('mpsoc_name');
|
if(defined $saved_name) {$entry->set_text($saved_name);}
|
if(defined $saved_name) {$entry->set_text($saved_name);}
|
set_state($soc_state,"ideal",0);
|
set_gui_status($mpsoc,"ideal",0);
|
|
|
|
|
}
|
}
|
return TRUE;
|
return TRUE;
|
|
|
} );
|
} );
|
Line 1677... |
Line 1698... |
# wb_address_setting($mpsoc);
|
# wb_address_setting($mpsoc);
|
#
|
#
|
# });
|
# });
|
|
|
$open-> signal_connect("clicked" => sub{
|
$open-> signal_connect("clicked" => sub{
|
set_state($soc_state,"ref",5);
|
set_gui_status($mpsoc,"ref",5);
|
load_mpsoc($mpsoc,$soc_state);
|
load_mpsoc($mpsoc,$info);
|
|
|
});
|
});
|
|
|
|
|
my $sc_win = new Gtk2::ScrolledWindow (undef, undef);
|
my $sc_win = new Gtk2::ScrolledWindow (undef, undef);
|
Line 1706... |
Line 1727... |
#############
|
#############
|
# load_mpsoc
|
# load_mpsoc
|
#############
|
#############
|
|
|
sub load_mpsoc{
|
sub load_mpsoc{
|
my ($mpsoc,$soc_state)=@_;
|
my ($mpsoc,$info)=@_;
|
my $file;
|
my $file;
|
my $dialog = Gtk2::FileChooserDialog->new(
|
my $dialog = Gtk2::FileChooserDialog->new(
|
'Select a File', undef,
|
'Select a File', undef,
|
'open',
|
'open',
|
'gtk-cancel' => 'cancel',
|
'gtk-cancel' => 'cancel',
|
Line 1728... |
Line 1749... |
if ( "ok" eq $dialog->run ) {
|
if ( "ok" eq $dialog->run ) {
|
$file = $dialog->get_filename;
|
$file = $dialog->get_filename;
|
my ($name,$path,$suffix) = fileparse("$file",qr"\..[^.]*$");
|
my ($name,$path,$suffix) = fileparse("$file",qr"\..[^.]*$");
|
if($suffix eq '.MPSOC'){
|
if($suffix eq '.MPSOC'){
|
my $pp= eval { do $file };
|
my $pp= eval { do $file };
|
|
if ($@ || !defined $pp){
|
|
show_info(\$info,"**Error reading $file file: $@\n");
|
|
$dialog->destroy;
|
|
return;
|
|
}
|
|
|
|
|
clone_obj($mpsoc,$pp);
|
clone_obj($mpsoc,$pp);
|
set_state($soc_state,"load_file",0);
|
set_gui_status($mpsoc,"load_file",0);
|
|
|
}
|
}
|
}
|
}
|
$dialog->destroy;
|
$dialog->destroy;
|
|
|
|
|
Line 1746... |
Line 1775... |
|
|
##########
|
##########
|
sub copy_noc_files{
|
sub copy_noc_files{
|
my ($project_dir,$dest)=@_;
|
my ($project_dir,$dest)=@_;
|
|
|
my @noc_files=('/mpsoc/src_noc/arbiter.v',
|
my @noc_files=(
|
|
'/mpsoc/src_noc/arbiter.v',
|
'/mpsoc/src_noc/baseline.v',
|
'/mpsoc/src_noc/baseline.v',
|
'/mpsoc/src_noc/canonical_credit_count.v',
|
'/mpsoc/src_noc/canonical_credit_count.v',
|
'/mpsoc/src_noc/class_table.v',
|
'/mpsoc/src_noc/class_table.v',
|
'/mpsoc/src_noc/combined_vc_sw_alloc.v',
|
'/mpsoc/src_noc/combined_vc_sw_alloc.v',
|
'/mpsoc/src_noc/comb_nonspec.v',
|
'/mpsoc/src_noc/comb_nonspec.v',
|
Line 1767... |
Line 1797... |
'/mpsoc/src_noc/noc.v',
|
'/mpsoc/src_noc/noc.v',
|
'/mpsoc/src_noc/route_mesh.v',
|
'/mpsoc/src_noc/route_mesh.v',
|
'/mpsoc/src_noc/router.v',
|
'/mpsoc/src_noc/router.v',
|
'/mpsoc/src_noc/route_torus.v',
|
'/mpsoc/src_noc/route_torus.v',
|
'/mpsoc/src_noc/routing.v',
|
'/mpsoc/src_noc/routing.v',
|
'/mpsoc/src_noc/vc_alloc_request_gen.v');
|
'/mpsoc/src_noc/vc_alloc_request_gen.v',
|
|
'/mpsoc/src_noc/ss_allocator.v');
|
foreach my $f (@noc_files){
|
foreach my $f (@noc_files){
|
copy ("$project_dir$f",$dest);
|
copy ("$project_dir$f",$dest);
|
|
|
}
|
}
|
|
|