Line 164... |
Line 164... |
$row++;
|
$row++;
|
}
|
}
|
return $row;
|
return $row;
|
}
|
}
|
|
|
sub attach_widget_to_table {
|
|
my ($table,$row,$label,$inf_bt,$widget)=@_;
|
|
my $tmp=gen_label_in_left(" ");
|
|
$table->attach ($label , 0, 4, $row,$row+1,'fill','shrink',2,2);
|
|
$table->attach ($inf_bt , 4, 5, $row,$row+1,'fill','shrink',2,2);
|
|
$table->attach ($widget , 5, 9, $row,$row+1,'fill','shrink',2,2);
|
|
$table->attach ($tmp , 9, 10, $row,$row+1,'fill','shrink',2,2);
|
|
}
|
|
|
|
|
|
sub initial_default_param{
|
sub initial_default_param{
|
my $mpsoc=shift;
|
my $mpsoc=shift;
|
my @socs=$mpsoc->mpsoc_get_soc_list();
|
my @socs=$mpsoc->mpsoc_get_soc_list();
|
Line 582... |
Line 575... |
|
|
});
|
});
|
|
|
|
|
if($show){
|
if($show){
|
$table->attach_defaults ( $button, 0, 4, $row,$row+1);
|
$table->attach ( $button, 0, 1, $row,$row+1,'fill','fill',2,2);
|
$table->attach_defaults ( $remove, 4, 5, $row,$row+1);
|
$table->attach ( $remove, 1, 2, $row,$row+1,'fill','shrink',2,2);
|
$table->attach_defaults ( $entry , 5, 9, $row,$row+1);
|
$table->attach ( $entry , 2, 3, $row,$row+1,'fill','shrink',2,2);
|
$table->attach_defaults ( $set, 9, 10, $row,$row+1);
|
$table->attach ( $set, 3, 4, $row,$row+1,'fill','shrink',2,2);
|
|
|
|
|
|
|
$row++;
|
$row++;
|
}
|
}
|
Line 616... |
Line 609... |
my $title2=gen_label_in_center("Tile Configuration");
|
my $title2=gen_label_in_center("Tile Configuration");
|
my $box1=def_vbox(FALSE, 1);
|
my $box1=def_vbox(FALSE, 1);
|
$box1->pack_start( $separator1, FALSE, FALSE, 3);
|
$box1->pack_start( $separator1, FALSE, FALSE, 3);
|
$box1->pack_start( $title2, FALSE, FALSE, 3);
|
$box1->pack_start( $title2, FALSE, FALSE, 3);
|
$box1->pack_start( $separator2, FALSE, FALSE, 3);
|
$box1->pack_start( $separator2, FALSE, FALSE, 3);
|
if($show){$table->attach_defaults ($box1 ,0,10, $row,$row+1);$row++;}
|
if($show){$table->attach_defaults ($box1 ,0,4, $row,$row+1);$row++;}
|
|
|
|
|
|
|
|
|
my $label = gen_label_in_left("Tiles path:");
|
my $label = gen_label_in_left("Tiles path:");
|
Line 675... |
Line 668... |
|
|
|
|
|
|
if($show){
|
if($show){
|
my $tmp=gen_label_in_left(" ");
|
my $tmp=gen_label_in_left(" ");
|
$table->attach_defaults ($label, 0, 4 , $row,$row+1);
|
$table->attach ($label, 0, 1 , $row,$row+1,'fill','shrink',2,2);
|
$table->attach_defaults ($tmp, 4, 5 , $row,$row+1);
|
$table->attach ($tmp, 1, 2 , $row,$row+1,'fill','shrink',2,2);
|
$table->attach_defaults ($entry, 5, 9 , $row,$row+1);
|
$table->attach ($entry, 2, 3 , $row,$row+1,'fill','shrink',2,2);
|
$table->attach_defaults ($browse, 9, 10, $row,$row+1);
|
$table->attach ($browse, 3, 4, $row,$row+1,'fill','shrink',2,2);
|
$row++;
|
$row++;
|
}
|
}
|
|
|
|
|
|
|
Line 700... |
Line 693... |
my $lab2=gen_label_help('Define the tile numbers that each IP is mapped to.
|
my $lab2=gen_label_help('Define the tile numbers that each IP is mapped to.
|
you can add individual numbers or ranges as follow
|
you can add individual numbers or ranges as follow
|
eg: 0,2,5:10
|
eg: 0,2,5:10
|
', ' Tile numbers ');
|
', ' Tile numbers ');
|
if($show){
|
if($show){
|
$table->attach_defaults ($lab1 ,0,3, $row,$row+1);
|
$table->attach_defaults ($lab1 ,0,1, $row,$row+1);
|
$table->attach_defaults ($lab2 ,5,10, $row,$row+1);$row++;
|
$table->attach_defaults ($lab2 ,2,3, $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,$show,$row);
|
$row=tile_set_widget ($mpsoc,$soc_name,$soc_num,$table,$show,$row);
|
Line 727... |
Line 720... |
my ($mpsoc,$table)=@_;
|
my ($mpsoc,$table)=@_;
|
|
|
|
|
|
|
#title
|
#title
|
|
my $row=0;
|
my $title=gen_label_in_center("NoC Configuration");
|
my $title=gen_label_in_center("NoC Configuration");
|
my $box=def_vbox(FALSE, 1);
|
$table->attach ($title , 0, 4, $row, $row+1,'expand','shrink',2,2); $row++;
|
$box->pack_start( $title, FALSE, FALSE, 3);
|
|
my $separator = Gtk2::HSeparator->new;
|
my $separator = Gtk2::HSeparator->new;
|
$box->pack_start( $separator, FALSE, FALSE, 3);
|
$table->attach ($separator , 0, 4 , $row, $row+1,'fill','fill',2,2); $row++;
|
$table->attach_defaults ($box , 0, 10, 0,1);
|
|
|
|
my $label;
|
my $label;
|
my $param;
|
my $param;
|
my $default;
|
my $default;
|
my $type;
|
my $type;
|
my $content;
|
my $content;
|
my $info;
|
my $info;
|
my $row=1;
|
|
|
|
#parameter start
|
#parameter start
|
my $b1;
|
my $b1;
|
my $show_noc=$mpsoc->object_get_attribute('setting','show_noc_setting');
|
my $show_noc=$mpsoc->object_get_attribute('setting','show_noc_setting');
|
if(!defined $show_noc){
|
if(!defined $show_noc){
|
Line 753... |
Line 745... |
|
|
}
|
}
|
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 ( $label , 2, 3, $row,$row+1 ,'fill','shrink',2,2);
|
$table->attach_defaults ( $b1 , 0, 4, $row,$row+1);$row++;
|
$table->attach ( $b1 , 0, 2, $row,$row+1,'fill','shrink',2,2);
|
|
$row++;
|
}
|
}
|
|
|
|
|
#Router type
|
#Router type
|
$label='Router Type';
|
$label='Router Type';
|
Line 769... |
Line 762... |
$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, $table,$row,$show_noc,'noc_type',1);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_type',1);
|
my $router_type=$mpsoc->object_get_attribute('noc_type',"ROUTER_TYPE");
|
my $router_type=$mpsoc->object_get_attribute('noc_type',"ROUTER_TYPE");
|
|
|
|
#topology
|
|
$label='Topology';
|
|
$param='TOPOLOGY';
|
|
$default='"MESH"';
|
|
$content='"MESH","TORUS","RING","LINE"';
|
|
$type='Combo-box';
|
|
$info="NoC topology";
|
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param',1);
|
|
|
|
my $topology=$mpsoc->object_get_attribute('noc_param','TOPOLOGY');
|
|
|
#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=($topology eq '"MESH"' || $topology eq '"TORUS"') ? '2,16,1':'2,64,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, $table,$row,$show_noc,'noc_param',1);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param',1);
|
|
|
|
|
|
|
#Routers per column
|
#Routers per column
|
|
if($topology eq '"MESH"' || $topology eq '"TORUS"') {
|
$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, $table,$row,$show_noc,'noc_param',1);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param',1);
|
|
} else {
|
|
$mpsoc->object_add_attribute('noc_param','NY',1);
|
|
}
|
|
|
if($router_type eq '"VC_BASED"'){
|
|
#VC number per port
|
#VC number per port
|
|
if($router_type eq '"VC_BASED"'){
|
my $v=$mpsoc->object_get_attribute('noc_param','V');
|
my $v=$mpsoc->object_get_attribute('noc_param','V');
|
if(defined $v){ $mpsoc->object_add_attribute('noc_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';
|
Line 805... |
Line 811... |
$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, $table,$row,$show_noc,'noc_param',1);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param',1);
|
} else {
|
} else {
|
$mpsoc->object_add_attribute('noc_param','V',1);
|
$mpsoc->object_add_attribute('noc_param','V',1);
|
$mpsoc->object_add_attribute('noc_param','C',0);
|
$mpsoc->object_add_attribute('noc_param','C',0);
|
|
|
|
|
}
|
}
|
|
|
#buffer width per VC
|
#buffer width per VC
|
$label=($router_type eq '"VC_BASED"')? 'Buffer flits per VC': "Buffer flits";
|
$label=($router_type eq '"VC_BASED"')? 'Buffer flits per VC': "Buffer flits";
|
$param='B';
|
$param='B';
|
Line 827... |
Line 831... |
$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,$table,$row,$show_noc,'noc_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info,$table,$row,$show_noc,'noc_param',undef);
|
|
|
#topology
|
|
$label='Topology';
|
|
$param='TOPOLOGY';
|
|
$default='"MESH"';
|
|
$content='"MESH","TORUS"';
|
|
$type='Combo-box';
|
|
$info="NoC topology";
|
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param',1);
|
|
|
|
#routing algorithm
|
#routing algorithm
|
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","ODD_EVEN","DUATO"' :
|
'"TRANC_XY","TRANC_WEST_FIRST","TRANC_NORTH_LAST","TRANC_NEGETIVE_FIRST","TRANC_DUATO"';
|
($topology eq '"TORUS"')? '"TRANC_XY","TRANC_WEST_FIRST","TRANC_NORTH_LAST","TRANC_NEGETIVE_FIRST","TRANC_DUATO"':
|
|
($topology eq '"RING"')? '"TRANC_XY"' : '"XY"';
|
|
|
|
|
}else{
|
}else{
|
$content=($topology eq '"MESH"')? '"XY","WEST_FIRST","NORTH_LAST","NEGETIVE_FIRST"' :
|
$content=($topology eq '"MESH"')? '"XY","WEST_FIRST","NORTH_LAST","NEGETIVE_FIRST","ODD_EVEN"' :
|
'"TRANC_XY","TRANC_WEST_FIRST","TRANC_NORTH_LAST","TRANC_NEGETIVE_FIRST"';
|
($topology eq '"TORUS"')? '"TRANC_XY","TRANC_WEST_FIRST","TRANC_NORTH_LAST","TRANC_NEGETIVE_FIRST"':
|
|
($topology eq '"RING"')? '"TRANC_XY"' : '"XY"';
|
|
|
|
|
}
|
}
|
$default=($topology eq '"MESH"')? '"XY"':'"TRANC_XY"';
|
$default=($topology eq '"MESH"' || $topology eq '"LINE"' )? '"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, $table,$row,$show_noc,'noc_param',1);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param',1);
|
|
|
|
|
#SSA
|
#SSA
|
Line 868... |
Line 866... |
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$show_noc,'noc_param',undef);
|
|
|
|
|
|
|
|
|
|
|
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 ( $b1 , 0, 2, $row,$row+1,'fill','shrink',2,2);
|
|
$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->object_add_attribute('setting','show_noc_setting',$show_noc);
|
$mpsoc->object_add_attribute('setting','show_noc_setting',$show_noc);
|
set_gui_status($mpsoc,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
|
|
});
|
});
|
|
|
|
|
#advance parameter start
|
#advance parameter start
|
my $advc;
|
my $advc;
|
my $adv_set=$mpsoc->object_get_attribute('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 ( $advc , 0, 2, $row,$row+1,'fill','shrink',2,2);
|
|
$row++;
|
}
|
}
|
|
|
|
|
|
|
#Fully and partially adaptive routing setting
|
#Fully and partially adaptive routing setting
|
my $route=$mpsoc->object_get_attribute('noc_param',"ROUTE_NAME");
|
my $route=$mpsoc->object_get_attribute('noc_param',"ROUTE_NAME");
|
|
|
$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;
|
if($route ne '"XY"' and $route ne '"TRANC_XY"' ){
|
if($route ne '"XY"' and $route ne '"TRANC_XY"' ){
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param',undef);
|
|
|
} else {
|
} else {
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,0,'noc_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,0,'noc_param',undef);
|
}
|
}
|
#Fully adaptive routing setting
|
|
|
|
|
#Fully adaptive routing setting
|
my $v=$mpsoc->object_get_attribute('noc_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.";
|
if( $route eq '"TRANC_DUATO"' or $route eq '"DUATO"' ){
|
if( $route eq '"TRANC_DUATO"' or $route eq '"DUATO"' ){
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set, 'noc_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set, 'noc_param',undef);
|
|
|
}
|
}
|
else{
|
else{
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,0, 'noc_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,0, 'noc_param',undef);
|
}
|
}
|
|
|
Line 937... |
Line 929... |
$content='"ATOMIC","NONATOMIC"';
|
$content='"ATOMIC","NONATOMIC"';
|
$type='Combo-box';
|
$type='Combo-box';
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param',undef);
|
|
|
|
|
|
|
|
|
|
|
#vc/sw allocator type
|
#vc/sw allocator type
|
$label = 'VC/SW combination type';
|
$label = 'VC/SW combination type';
|
$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";
|
if ($router_type eq '"VC_BASED"'){
|
if ($router_type eq '"VC_BASED"'){
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param',undef);
|
|
|
} else{
|
} else{
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,0,'noc_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,0,'noc_param',undef);
|
|
|
}
|
}
|
|
|
# Crossbar mux type
|
# Crossbar mux type
|
$label='Crossbar mux type';
|
$label='Crossbar mux type';
|
$param='MUX_TYPE';
|
$param='MUX_TYPE';
|
Line 964... |
Line 951... |
$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, $table,$row,$adv_set,'noc_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param',undef);
|
|
|
if($router_type eq '"VC_BASED"'){
|
|
#class
|
#class
|
|
if($router_type eq '"VC_BASED"'){
|
$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';
|
Line 990... |
Line 977... |
$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, $table,$row,$adv_set,'class_param',undef);
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'class_param',undef);
|
|
|
|
|
}
|
}
|
|
|
|
|
|
|
}#($router_type eq '"VC_BASED"')
|
}#($router_type eq '"VC_BASED"')
|
|
|
|
|
|
|
#simulation debuge enable
|
#simulation debuge enable
|
Line 1010... |
Line 993... |
$content='0,1';
|
$content='0,1';
|
$type='Combo-box';
|
$type='Combo-box';
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
|
|
|
|
|
#pipeline reg
|
|
|
|
|
$label="Add pipeline reg after crossbar";
|
$label="Add pipeline reg after crossbar";
|
$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 enabeled it adds a pipline register at the output port of the router.";
|
$info="If enabeled it adds a pipline register at the output port of the router.";
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param');
|
|
|
|
#FIRST_ARBITER_EXT_P_EN
|
|
$label='Swich allocator first level
|
|
arbiters extenal priority enable';
|
|
$param='FIRST_ARBITER_EXT_P_EN';
|
|
$default= 1;
|
|
$info='If set as 1 then the switch allocator\'s input (first) arbiters\' priority registers are enabled only when a request get both input and output arbiters\' grants';
|
|
$content='0,1';
|
|
$type="Combo-box";
|
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info,$table,$row,$adv_set,'noc_param');
|
|
|
|
|
|
#Arbiter type
|
|
$label='SW allocator arbiteration type';
|
|
$param='SWA_ARBITER_TYPE';
|
|
$default='"RRA"';
|
|
$content='"RRA","WRRA"'; #,"WRRA_CLASSIC"';
|
|
$type='Combo-box';
|
|
$info="Switch allocator arbitertion type:
|
|
RRA: Round robin arbiter. Only local fairness in a router.
|
|
WRRA: Weighted round robin arbiter. Results in global fairness in the NoC.
|
|
Switch allocation requests are grated acording to their weight which increases due to contention";
|
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$adv_set,'noc_param',1);
|
|
|
|
|
|
|
|
my $arbiter=$mpsoc->object_get_attribute('noc_param',"SWA_ARBITER_TYPE");
|
|
my $wrra_show = ($arbiter ne '"RRA"' && $adv_set == 1 )? 1 : 0;
|
|
# weight width
|
|
$label='Weight width';
|
|
$param='WEIGHTw';
|
|
$default='4';
|
|
$content='2,7,1';
|
|
$info= 'Maximum weight width';
|
|
$type= 'Spin-button';
|
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$wrra_show,'noc_param',undef);
|
|
|
|
#WRRA_CONFIG_INDEX
|
|
$label='Weight configuration index';
|
|
$param='WRRA_CONFIG_INDEX';
|
|
$default='0';
|
|
$content='0,7,1';
|
|
$info= 'WRRA_CONFIG_INDEX:
|
|
|
|
';
|
|
$type= 'Spin-button';
|
|
#$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$wrra_show,'noc_param',undef);
|
|
|
|
|
|
|
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 ( $advc , 0, 2, $row,$row+1,'fill','shrink',2,2);
|
|
$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->object_add_attribute('setting','show_adv_setting',$adv_set);
|
$mpsoc->object_add_attribute('setting','show_adv_setting',$adv_set);
|
set_gui_status($mpsoc,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
Line 1040... |
Line 1066... |
|
|
|
|
#other fixed parameters
|
#other fixed parameters
|
|
|
|
|
#FIRST_ARBITER_EXT_P_EN
|
|
$label='FIRST_ARBITER_EXT_P_EN';
|
|
$param='FIRST_ARBITER_EXT_P_EN';
|
|
$default= 0;
|
|
$info='FIRST_ARBITER_EXT_P_EN';
|
|
$content='0,1';
|
|
$type="Combo-box";
|
|
$row=noc_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info,$table,$row,0,'noc_param');
|
|
|
|
|
|
|
|
# AVC_ATOMIC_EN
|
# AVC_ATOMIC_EN
|
$label='AVC_ATOMIC_EN';
|
$label='AVC_ATOMIC_EN';
|
Line 1113... |
Line 1133... |
my $tile_set;
|
my $tile_set;
|
my $show=$mpsoc->object_get_attribute('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 ( $tile_set , 0, 2, $row,$row+1,'fill','shrink',2,2);
|
|
$row++;
|
|
|
}
|
}
|
|
|
|
|
|
|
Line 1133... |
Line 1154... |
|
|
|
|
#end tile setting
|
#end tile setting
|
if($show == 1){
|
if($show == 1){
|
$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 ( $tile_set , 0, 2, $row,$row+1,'fill','shrink',2,2);
|
|
$row++;
|
}
|
}
|
$tile_set->signal_connect("clicked" => sub{
|
$tile_set->signal_connect("clicked" => sub{
|
$show=($show==1)?0:1;
|
$show=($show==1)?0:1;
|
$mpsoc->object_add_attribute('setting','show_tile_setting',$show);
|
$mpsoc->object_add_attribute('setting','show_tile_setting',$show);
|
set_gui_status($mpsoc,"ref",1);
|
set_gui_status($mpsoc,"ref",1);
|
Line 1146... |
Line 1168... |
});
|
});
|
|
|
|
|
|
|
|
|
for(my $i=$row; $i<25; $i++){
|
#for(my $i=$row; $i<25; $i++){
|
my $empty_col=gen_label_in_left(' ');
|
#my $empty_col=gen_label_in_left(' ');
|
$table->attach_defaults ($empty_col , 0, 1, $i,$i+1);
|
#$table->attach_defaults ($empty_col , 0, 1, $i,$i+1);
|
|
|
}
|
#}
|
|
|
|
|
|
|
|
|
|
|
Line 1250... |
Line 1272... |
my ($file_v,$tmp)=soc_generate_verilog($soc,"$target_dir/sw");
|
my ($file_v,$tmp)=soc_generate_verilog($soc,"$target_dir/sw");
|
|
|
# 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 perl_file_header("$soc_name.SOC");
|
print FILE Data::Dumper->Dump([\%$soc],['mpsoc']);
|
print FILE Data::Dumper->Dump([\%$soc],['soc']);
|
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: $!";
|
print FILE $file_v;
|
print FILE $file_v;
|
Line 1298... |
Line 1320... |
move ("$dir/lib/verilog/$soc_name.v","$target_dir/src_verilog/tiles/");
|
move ("$dir/lib/verilog/$soc_name.v","$target_dir/src_verilog/tiles/");
|
copy_noc_files($project_dir,"$target_dir/src_verilog/lib");
|
copy_noc_files($project_dir,"$target_dir/src_verilog/lib");
|
|
|
|
|
# Write header file
|
# Write header file
|
generate_header_file($soc,$project_dir,$target_dir,$dir);
|
generate_header_file($soc,$project_dir,$target_dir,$target_dir,$dir);
|
|
|
|
|
|
|
|
|
|
|
Line 1323... |
Line 1345... |
my ($mpsoc,$info) = @_;
|
my ($mpsoc,$info) = @_;
|
my $name=$mpsoc->object_get_attribute('mpsoc_name');
|
my $name=$mpsoc->object_get_attribute('mpsoc_name');
|
$mpsoc->mpsoc_remove_all_soc_tops();
|
$mpsoc->mpsoc_remove_all_soc_tops();
|
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 perl_file_header("$name.MPSOC");
|
print FILE Data::Dumper->Dump([\%$mpsoc],[$name]);
|
print FILE Data::Dumper->Dump([\%$mpsoc],['mpsoc']);
|
close(FILE) || die "Error closing file: $!";
|
close(FILE) || die "Error closing file: $!";
|
get_soc_list($mpsoc,$info);
|
get_soc_list($mpsoc,$info);
|
|
|
}
|
}
|
|
|
Line 1435... |
Line 1457... |
sub mpsoc_mem_prog {
|
sub mpsoc_mem_prog {
|
my $string='
|
my $string='
|
#!/bin/sh
|
#!/bin/sh
|
|
|
|
|
JTAG_MAIN="$PRONOC_WORK/toolchain/bin/jtag_main"
|
#JTAG_INTFC="$PRONOC_WORK/toolchain/bin/JTAG_INTFC"
|
|
source ./jtag_intfc.sh
|
|
|
|
|
#reset and disable cpus, then release the reset but keep the cpus disabled
|
#reset and disable cpus, then release the reset but keep the cpus disabled
|
|
|
$JTAG_MAIN -n 127 -d "I:1,D:2:3,D:2:2,I:0"
|
$JTAG_INTFC -n 127 -d "I:1,D:2:3,D:2:2,I:0"
|
|
|
# jtag instruction
|
# jtag instruction
|
# 0: bypass
|
# 0: bypass
|
# 1: getting data
|
# 1: getting data
|
# jtag data :
|
# jtag data :
|
Line 1462... |
Line 1486... |
sh write_memory.sh
|
sh write_memory.sh
|
cd ..
|
cd ..
|
done
|
done
|
|
|
#Enable the cpu
|
#Enable the cpu
|
$JTAG_MAIN -n 127 -d "I:1,D:2:0,I:0"
|
$JTAG_INTFC -n 127 -d "I:1,D:2:0,I:0"
|
# I:1 set jtag_enable in active mode
|
# I:1 set jtag_enable in active mode
|
# D:2:0 load jtag_enable data register with 0x0 reset=0 disable=0
|
# D:2:0 load jtag_enable data register with 0x0 reset=0 disable=0
|
# I:0 set jtag_enable in bypass mode
|
# I:0 set jtag_enable in bypass mode
|
';
|
';
|
return $string;
|
return $string;
|
Line 1585... |
Line 1609... |
|
|
|
|
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;
|
|
my $topology=$mpsoc->object_get_attribute('noc_param','TOPOLOGY');
|
|
my $cordibate = ($topology eq '"RING"' || $topology eq '"LINE"' ) ? "" : "($x,$y)";
|
if( defined $soc_name){
|
if( defined $soc_name){
|
my $setting=$mpsoc->mpsoc_get_tile_param_setting($tile);
|
my $setting=$mpsoc->mpsoc_get_tile_param_setting($tile);
|
$button=($setting eq 'Custom')? def_colored_button("Tile $tile ($x,$y)*\n$soc_name",$num) : def_colored_button("Tile $tile ($x,$y)\n$soc_name",$num) ;
|
$button=($setting eq 'Custom')? def_colored_button("Tile $tile ${cordibate}*\n$soc_name",$num) : def_colored_button("Tile $tile ${cordibate}\n$soc_name",$num) ;
|
}else {
|
}else {
|
$button =def_colored_button("Tile $tile ($x,$y)\n",50) if(! defined $soc_name);
|
$button =def_colored_button("Tile $tile ${cordibate}\n",50) if(! defined $soc_name);
|
}
|
}
|
|
|
$button->signal_connect("clicked" => sub{
|
$button->signal_connect("clicked" => sub{
|
my $window = def_popwin_size(40,40,"Parameter setting for Tile $tile ",'percent');
|
my $window = def_popwin_size(40,40,"Parameter setting for Tile $tile ",'percent');
|
my $table = def_table(6, 2, TRUE);
|
my $table = def_table(6, 2, TRUE);
|
Line 1708... |
Line 1734... |
my $nx= $mpsoc->object_get_attribute('noc_param',"NX");
|
my $nx= $mpsoc->object_get_attribute('noc_param',"NX");
|
my $ny= $mpsoc->object_get_attribute('noc_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);
|
|
$scrolled_win->set_policy( "automatic", "automatic" );
|
|
$scrolled_win->add_with_viewport($table);
|
|
|
|
|
|
|
|
|
|
|
|
Line 1726... |
Line 1750... |
#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);
|
|
|
|
|
}}
|
}}
|
|
return $table;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
sub software_edit_mpsoc {
|
sub software_edit_mpsoc {
|
my $self=shift;
|
my $self=shift;
|
Line 1751... |
Line 1780... |
$table->attach ($make,9, 10, 1,2,'shrink','shrink',0,0);
|
$table->attach ($make,9, 10, 1,2,'shrink','shrink',0,0);
|
|
|
|
|
$make -> signal_connect("clicked" => sub{
|
$make -> signal_connect("clicked" => sub{
|
$app->do_save();
|
$app->do_save();
|
|
apend_to_textview($tview,' ');
|
run_make_file($sw,$tview);
|
run_make_file($sw,$tview);
|
|
|
});
|
});
|
|
|
}
|
}
|
|
|
|
|
|
|
|
#############
|
|
# load_mpsoc
|
|
#############
|
|
|
|
sub load_mpsoc{
|
|
my ($mpsoc,$info)=@_;
|
|
my $file;
|
|
my $dialog = Gtk2::FileChooserDialog->new(
|
|
'Select a File', undef,
|
|
'open',
|
|
'gtk-cancel' => 'cancel',
|
|
'gtk-ok' => 'ok',
|
|
);
|
|
|
|
my $filter = Gtk2::FileFilter->new();
|
|
$filter->set_name("MPSoC");
|
|
$filter->add_pattern("*.MPSOC");
|
|
$dialog->add_filter ($filter);
|
|
my $dir = Cwd::getcwd();
|
|
$dialog->set_current_folder ("$dir/lib/mpsoc") ;
|
|
my @newsocs=$mpsoc->mpsoc_get_soc_list();
|
|
add_info(\$info,'');
|
|
if ( "ok" eq $dialog->run ) {
|
|
$file = $dialog->get_filename;
|
|
my ($name,$path,$suffix) = fileparse("$file",qr"\..[^.]*$");
|
|
if($suffix eq '.MPSOC'){
|
|
my $pp= eval { do $file };
|
|
if ($@ || !defined $pp){
|
|
add_info(\$info,"**Error: cannot open $file file: $@\n");
|
|
$dialog->destroy;
|
|
return;
|
|
}
|
|
|
|
|
|
clone_obj($mpsoc,$pp);
|
|
#read save mpsoc socs
|
|
my @oldsocs=$mpsoc->mpsoc_get_soc_list();
|
|
#add exsiting SoCs and add them to mpsoc
|
|
|
|
my $error;
|
|
#print "old: @oldsocs\n new @newsocs \n";
|
|
foreach my $p (@oldsocs) {
|
|
#print "$p\n";
|
|
my @num= $mpsoc->mpsoc_get_soc_tiles_num($p);
|
|
if (scalar @num && ( grep (/^$p$/,@newsocs)==0)){
|
|
my $m="Processing tile $p that has been used for ties @num but is not located in librray anymore\n";
|
|
$error = (defined $error ) ? "$error $m" : $m;
|
|
}
|
|
$mpsoc->mpsoc_remove_soc ($p) if (grep (/^$p$/,@newsocs)==0);
|
|
|
|
|
|
}
|
|
@newsocs=get_soc_list($mpsoc,$info); # add all existing socs
|
|
add_info(\$info,"**Error: \n $error\n") if(defined $error);
|
|
|
|
set_gui_status($mpsoc,"load_file",0);
|
|
|
|
}
|
|
}
|
|
$dialog->destroy;
|
|
}
|
|
|
############
|
############
|
# main
|
# main
|
############
|
############
|
sub mpsocgen_main{
|
sub mpsocgen_main{
|
|
|
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 $mpsoc= mpsoc->mpsoc_new();
|
my $mpsoc= mpsoc->mpsoc_new();
|
|
|
|
|
set_gui_status($mpsoc,"ideal",0);
|
set_gui_status($mpsoc,"ideal",0);
|
|
|
# main window
|
|
#my $window = def_win_size(1000,800,"Top");
|
|
# 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);
|
|
|
# The box which holds the info, warning, error ... mesages
|
# The box which holds the info, warning, error ... mesages
|
my ($infobox,$info)= create_text();
|
my ($infobox,$info)= create_text();
|
|
|
|
|
my $refresh = Gtk2::Button->new_from_stock('ref');
|
|
|
|
|
|
my $noc_conf_box=get_config ($mpsoc,$info);
|
my $noc_conf_box=get_config ($mpsoc,$info);
|
my $noc_tiles=gen_tiles($mpsoc);
|
my $noc_tiles=gen_tiles($mpsoc);
|
|
|
my $scr_conf = new Gtk2::ScrolledWindow (undef, undef);
|
my $scr_conf = new Gtk2::ScrolledWindow (undef, undef);
|
$scr_conf->set_policy( "automatic", "automatic" );
|
$scr_conf->set_policy( "automatic", "automatic" );
|
$scr_conf->add_with_viewport($noc_conf_box);
|
$scr_conf->add_with_viewport($noc_conf_box);
|
|
|
|
my $scr_tile = new Gtk2::ScrolledWindow (undef, undef);
|
|
$scr_tile->set_policy( "automatic", "automatic" );
|
|
$scr_tile->add_with_viewport($noc_tiles);
|
|
|
$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,\$refresh,$info);
|
|
|
|
|
|
my $generate = def_image_button('icons/gen.png','Generate');
|
|
|
|
|
|
|
|
|
|
|
my $generate = def_image_button('icons/gen.png','Generate RTL');
|
my $open = def_image_button('icons/browse.png','Load MPSoC');
|
my $open = def_image_button('icons/browse.png','Load MPSoC');
|
my $compile = def_image_button('icons/run.png','Compile');
|
my $compile = def_image_button('icons/gate.png','Compile RTL');
|
my $software = def_image_button('icons/binary.png','Software');
|
my $software = def_image_button('icons/binary.png','Software');
|
my $entry=gen_entry_object($mpsoc,'mpsoc_name',undef,undef,undef,undef);
|
my $entry=gen_entry_object($mpsoc,'mpsoc_name',undef,undef,undef,undef);
|
my $entrybox=labele_widget_info(" MPSoC name:",$entry);
|
my $entrybox=labele_widget_info(" MPSoC name:",$entry);
|
|
|
|
my $h1=gen_hpaned($scr_conf,.3,$scr_tile);
|
|
|
#$table->attach_defaults ($event_box, $col, $col+1, $row, $row+1);
|
|
#$main_table->attach_defaults ($noc_conf_box , 0, 4, 0, 22);
|
|
#$main_table->attach_defaults ($noc_tiles , 4, 12, 0, 22);
|
|
#$main_table->attach_defaults ($infobox , 0, 12, 22,24);
|
|
|
|
my $h1=gen_hpaned($scr_conf,.3,$noc_tiles);
|
|
my $v2=gen_vpaned($h1,.55,$infobox);
|
my $v2=gen_vpaned($h1,.55,$infobox);
|
$main_table->attach_defaults ($v2 , 0, 12, 0,24);
|
|
|
|
|
|
|
|
|
|
|
|
|
$main_table->attach_defaults ($v2 , 0, 12, 0,24);
|
$main_table->attach ($open,0, 3, 24,25,'expand','shrink',2,2);
|
$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 ($generate, 8, 9, 24,25,'expand','shrink',2,2);
|
$main_table->attach ($generate, 8, 9, 24,25,'expand','shrink',2,2);
|
$main_table->attach ($software, 9, 10, 24,25,'expand','shrink',2,2);
|
$main_table->attach ($software, 9, 10, 24,25,'expand','shrink',2,2);
|
$main_table->attach ($compile, 10, 12, 24,25,'expand','shrink',2,2);
|
$main_table->attach ($compile, 10, 12, 24,25,'expand','shrink',2,2);
|
|
|
#referesh the mpsoc generator
|
|
$refresh-> signal_connect("clicked" => sub{
|
|
$noc_conf_box->destroy();
|
|
$noc_conf_box=get_config ($mpsoc,$info);
|
|
$scr_conf->add_with_viewport($noc_conf_box);
|
|
#$main_table->attach_defaults ($noc_conf_box , 0, 4, 0, 22);
|
|
#$noc_conf_box->show_all();
|
|
|
|
|
|
|
|
$noc_tiles->destroy();
|
|
$noc_tiles=gen_tiles($mpsoc);
|
|
#$h1->destroy();
|
|
#$h1=gen_hpaned($noc_conf_box,.3,$noc_tiles);
|
|
$h1 -> pack1($scr_conf, TRUE, TRUE);
|
|
$h1 -> pack2($noc_tiles, TRUE, TRUE);
|
|
|
|
$v2-> pack1($h1, TRUE, TRUE);
|
|
$h1->show_all;
|
|
#$main_table->attach_defaults ($noc_tiles , 4, 12, 0, 22);
|
|
|
|
$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{
|
Line 1880... |
Line 1921... |
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: $!";
|
set_gui_status($mpsoc,"ideal",0);
|
set_gui_status($mpsoc,"ideal",0);
|
}
|
}
|
elsif( $state ne "ideal" ){
|
elsif( $state ne "ideal" ){
|
$refresh->clicked;
|
$noc_conf_box->destroy();
|
|
$noc_conf_box=get_config ($mpsoc,$info);
|
|
$scr_conf->add_with_viewport($noc_conf_box);
|
|
$noc_tiles->destroy();
|
|
$noc_tiles=gen_tiles($mpsoc);
|
|
$scr_tile->add_with_viewport($noc_tiles);
|
|
$h1 -> pack1($scr_conf, TRUE, TRUE);
|
|
$h1 -> pack2($scr_tile, TRUE, TRUE);
|
|
$v2-> pack1($h1, TRUE, TRUE);
|
|
$h1->show_all;
|
|
$main_table->show_all();
|
my $saved_name=$mpsoc->object_get_attribute('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_gui_status($mpsoc,"ideal",0);
|
set_gui_status($mpsoc,"ideal",0);
|
|
|
|
|
Line 1894... |
Line 1945... |
} );
|
} );
|
|
|
|
|
$generate-> signal_connect("clicked" => sub{
|
$generate-> signal_connect("clicked" => sub{
|
generate_mpsoc($mpsoc,$info);
|
generate_mpsoc($mpsoc,$info);
|
$refresh->clicked;
|
set_gui_status($mpsoc,"refresh_soc",1);
|
|
|
});
|
});
|
|
|
# $wb-> signal_connect("clicked" => sub{
|
|
# wb_address_setting($mpsoc);
|
|
#
|
|
# });
|
|
|
|
$open-> signal_connect("clicked" => sub{
|
$open-> signal_connect("clicked" => sub{
|
set_gui_status($mpsoc,"ref",5);
|
set_gui_status($mpsoc,"ref",5);
|
load_mpsoc($mpsoc,$info);
|
load_mpsoc($mpsoc,$info);
|
|
|
});
|
});
|
|
|
|
|
$compile -> signal_connect("clicked" => sub{
|
$compile -> signal_connect("clicked" => sub{
|
|
$mpsoc->object_add_attribute('compile','compilers',"QuartusII,Verilator,Modelsim");
|
my $name=$mpsoc->object_get_attribute('mpsoc_name');
|
my $name=$mpsoc->object_get_attribute('mpsoc_name');
|
if (length($name)==0){
|
if (length($name)==0){
|
message_dialog("Please define the MPSoC name!");
|
message_dialog("Please define the MPSoC name!");
|
return ;
|
return ;
|
}
|
}
|
Line 1944... |
Line 1992... |
}
|
}
|
|
|
|
|
|
|
|
|
return $scrolled_win;
|
|
}
|
|
|
|
|
|
|
|
|
|
#############
|
|
# load_mpsoc
|
|
#############
|
|
|
|
sub load_mpsoc{
|
|
my ($mpsoc,$info)=@_;
|
|
my $file;
|
|
my $dialog = Gtk2::FileChooserDialog->new(
|
|
'Select a File', undef,
|
|
'open',
|
|
'gtk-cancel' => 'cancel',
|
|
'gtk-ok' => 'ok',
|
|
);
|
|
|
|
my $filter = Gtk2::FileFilter->new();
|
|
$filter->set_name("MPSoC");
|
|
$filter->add_pattern("*.MPSOC");
|
|
$dialog->add_filter ($filter);
|
|
my $dir = Cwd::getcwd();
|
|
$dialog->set_current_folder ("$dir/lib/mpsoc") ;
|
|
my @newsocs=$mpsoc->mpsoc_get_soc_list();
|
|
add_info(\$info,'');
|
|
if ( "ok" eq $dialog->run ) {
|
|
$file = $dialog->get_filename;
|
|
my ($name,$path,$suffix) = fileparse("$file",qr"\..[^.]*$");
|
|
if($suffix eq '.MPSOC'){
|
|
my $pp= eval { do $file };
|
|
if ($@ || !defined $pp){
|
|
add_info(\$info,"**Error: cannot open $file file: $@\n");
|
|
$dialog->destroy;
|
|
return;
|
|
}
|
|
|
|
|
|
clone_obj($mpsoc,$pp);
|
|
#read save mpsoc socs
|
|
my @oldsocs=$mpsoc->mpsoc_get_soc_list();
|
|
#add exsiting SoCs and add them to mpsoc
|
|
|
|
my $error;
|
|
#print "old: @oldsocs\n new @newsocs \n";
|
|
foreach my $p (@oldsocs) {
|
|
#print "$p\n";
|
|
my @num= $mpsoc->mpsoc_get_soc_tiles_num($p);
|
|
if (scalar @num && ( grep (/^$p$/,@newsocs)==0)){
|
|
my $m="Processing tile $p that has been used for ties @num but is not located in librray anymore\n";
|
|
$error = (defined $error ) ? "$error $m" : $m;
|
|
}
|
|
$mpsoc->mpsoc_remove_soc ($p) if (grep (/^$p$/,@newsocs)==0);
|
|
|
|
|
|
}
|
|
@newsocs=get_soc_list($mpsoc,$info); # add all existing socs
|
|
add_info(\$info,"**Error: \n $error\n") if(defined $error);
|
|
|
|
set_gui_status($mpsoc,"load_file",0);
|
|
|
|
}
|
|
}
|
|
$dialog->destroy;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|