OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [perl_gui/] [lib/] [perl/] [mpsoc_gen.pl] - Diff between revs 48 and 54

Show entire file | Details | Blame | View Log

Rev 48 Rev 54
Line 778... Line 778...
    $info='0:disable, 1: enable. Add byte enable (BE) filed to header flit which shows the location of last valid byte in tail flit. It is needed once the send data unit is smaller than Fpay.';
    $info='0:disable, 1: enable. Add byte enable (BE) filed to header flit which shows the location of last valid byte in tail flit. It is needed once the send data unit is smaller than Fpay.';
    $content='0,1';
    $content='0,1';
    $type="Combo-box";
    $type="Combo-box";
    ($row,$coltmp)=add_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,undef,$show_noc,'noc_param');
    ($row,$coltmp)=add_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,undef,$show_noc,'noc_param');
 
 
    if($show_noc == 1){
 
        $b1= def_image_button("icons/up.png","NoC Parameters");
 
        $table->attach  ( $b1 , 0, 2, $row,$row+1,'fill','shrink',2,2);
 
        $row++;
 
 
    #CAST_TYPE
 
    $label='Casting Type';
 
    $param='CAST_TYPE';
 
    $default= '"UNICAST"';
 
    $info='Configure a NoC as Unicast, Multicast, or Broadcast NoC. In Unicast NoC, a packet can be sent to only one destination. In  Multicast, a single packet can have multiple target destination nodes, whereas,  Broadcast packets are sent to all other destination nodes. For Multicast and Broadcast NoC, only one copy of a packet must be injected into the source router. The routers in the path then fork the packets to different output ports when necessary. Multicast and Broadcast can be selected as FULL, where all destinations can be included in packet destination list, or as PARTIAL where a user-defined subset of nodes (defined with MCAST_ENDP_LIST parameter) can be targeted in destination lists. The other nodes not marked in MCAST_ENDP_LIST can only receive unicast packets. ';
 
    $content='"UNICAST","MULTICAST_PARTIAL","MULTICAST_FULL","BROADCAST_PARTIAL","BROADCAST_FULL"';
 
    $type="Combo-box";
 
    ($row,$coltmp)=add_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,undef,$show_noc,'noc_param',1);
 
 
 
 
 
    my $cast_type=$mpsoc->object_get_attribute('noc_param','CAST_TYPE');
 
    my ($NE, $NR, $RAw, $EAw, $Fw) = get_topology_info($mpsoc);
 
 
 
    my $cast = $mpsoc->object_get_attribute('noc_param',"MCAST_ENDP_LIST");
 
    if(!defined $cast){
 
            my $h=0;
 
            my $n="";
 
            for (my $i=0; $i<$NE; $i++){
 
                        $h+= (1<<$i%4);
 
                        if(($i+1) % 4==0){
 
                                $n="$h".$n if($h<10);
 
                                $n=chr($h-10+97).$n if($h>9);
 
                                $h=0;
 
                        }
 
                }
 
                $n="$h".$n if($h!=0);
 
                $n="'h".$n;
 
                $mpsoc->object_add_attribute('noc_param',"MCAST_ENDP_LIST",$n);
 
                $mpsoc->object_add_attribute_order('noc_param',"MCAST_ENDP_LIST");
 
        #       $mpsoc->object_add_attribute('noc_param',"MCAST_PRTLw",$NE);
 
        #       $mpsoc->object_add_attribute_order('noc_param',"MCAST_PRTLw");
 
                $cast=$n;
    }
    }
    $b1->signal_connect("clicked" => sub{
 
        $show_noc=($show_noc==1)?0:1;
 
        $mpsoc->object_add_attribute('setting','show_noc_setting',$show_noc);
 
        set_gui_status($mpsoc,"ref",1);
 
    });
 
 
 
    #advance parameter start
    if($cast_type eq '"MULTICAST_PARTIAL"' || $cast_type eq '"BROADCAST_PARTIAL"') {
    my $advc;
        #$table->attach  ( gen_label_help($info,"Muticast Node list"),0 , 2, $row,$row+1,'fill','shrink',2,2);    
    my $adv_set=$mpsoc->object_get_attribute('setting','show_adv_setting');
        $info='MCAST_ENDP_LIST is a one-hot coded number where the asserted bit indicates that the corresponding destination ID can be targeted in multicast/broadcast packets. The corresponding destinations with zero bit can only receive unicast packets.';
    if($adv_set == 0){
 
        $advc= def_image_button("icons/down.png","Advance Parameters");
        my $b1= def_image_button("icons/setting.png","Set");
        $table->attach ( $advc , 0, 2, $row,$row+1,'fill','shrink',2,2);
        my $bb= def_pack_hbox(FALSE,0,gen_label_in_left("$cast"),$b1);
 
        my $label=gen_label_in_left("Muticast Node list");
 
        my $inf_bt= (defined $info)? gen_button_message ($info,"icons/help.png"):gen_label_in_left(" ");
 
                attach_widget_to_table ($table,$row,$label,$inf_bt,$bb,0);
 
 
 
 
 
       # $table->attach  ( $bb , 2, 3, $row,$row+1,'fill','shrink',2,2);
        $row++;
        $row++;
 
 
 
         $b1->signal_connect("clicked" => sub{
 
                set_multicast_list($mpsoc);
 
 
 
                 });
    }
    }
 
 
 
 
 
 
 
    #advance parameter start
 
   # my $advc;
 
   # my $adv_set=$mpsoc->object_get_attribute('setting','show_adv_setting');
 
   #
 
   # if($adv_set == 0){    
 
   #     $advc= def_image_button("icons/down.png","Advance Parameters");
 
   #     $table->attach ( $advc , 0, 2, $row,$row+1,'fill','shrink',2,2);
 
   #     $row++;    
 
   # }
 
 
 
    my $adv_set= $show_noc;
    #SSA
    #SSA
    $label='SSA Enable';
    $label='SSA Enable';
    $param='SSA_EN';
    $param='SSA_EN';
    $default='"NO"';
    $default='"NO"';
    $content='"YES","NO"';
    $content='"YES","NO"';
Line 1004... Line 1054...
';
';
    $type= 'Spin-button';
    $type= 'Spin-button';
    #($row,$coltmp)=add_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$wrra_show,'noc_param',undef);  
    #($row,$coltmp)=add_param_widget ($mpsoc,$label,$param, $default,$type,$content,$info, $table,$row,$wrra_show,'noc_param',undef);  
 
 
 
 
 
    if($show_noc == 1){
    if($adv_set == 1){
        $b1= def_image_button("icons/up.png","NoC Parameters");
        $advc= def_image_button("icons/up.png","Advance Parameters");
        $table->attach  ( $b1 , 0, 2, $row,$row+1,'fill','shrink',2,2);
        $table->attach ( $advc , 0, 2, $row,$row+1,'fill','shrink',2,2);
 
        $row++;
        $row++;
    }
    }
    $advc->signal_connect("clicked" => sub{
    $b1->signal_connect("clicked" => sub{
        $adv_set=($adv_set==1)?0:1;
        $show_noc=($show_noc==1)?0:1;
        $mpsoc->object_add_attribute('setting','show_adv_setting',$adv_set);
        $mpsoc->object_add_attribute('setting','show_noc_setting',$show_noc);
        set_gui_status($mpsoc,"ref",1);
        set_gui_status($mpsoc,"ref",1);
    });
    });
 
 
 
 
 
 
 
 
 
  #  if($adv_set == 1){    
 
  #      $advc= def_image_button("icons/up.png","Advance Parameters");
 
  #      $table->attach ( $advc , 0, 2, $row,$row+1,'fill','shrink',2,2);
 
  #      $row++;
 
  #  }
 
  #  $advc->signal_connect("clicked" => sub{ 
 
  #      $adv_set=($adv_set==1)?0:1;
 
  #      $mpsoc->object_add_attribute('setting','show_adv_setting',$adv_set);
 
   #     set_gui_status($mpsoc,"ref",1);
 
  #  });
 
 
 
 
    #other fixed parameters       
    #other fixed parameters       
 
 
 
 
    # AVC_ATOMIC_EN
    # AVC_ATOMIC_EN
    $label='AVC_ATOMIC_EN';
    $label='AVC_ATOMIC_EN';
Line 1043... Line 1106...
 
 
    return $row;
    return $row;
}
}
 
 
 
 
 
 
 
 
 
sub set_multicast_list{
 
        my($mpsoc)=@_;
 
        my $window = def_popwin_size(50,40,"Select nodes invlove in multicasting ",'percent');
 
        my $table= def_table(10,10,FALSE);
 
        my $row=0;
 
        my $col=0;
 
 
 
        my $init = $mpsoc->object_get_attribute('noc_param',"MCAST_ENDP_LIST");
 
        $init =~ s/'h//g;
 
        my @arr= reverse split (//, $init);
 
 
 
 
 
        my $label = "Multicast Node list (hex fromat)";
 
    my ($Ebox,$entry) = def_h_labeled_entry ($label);
 
        $entry->set_sensitive (FALSE);
 
 
 
        my @sel_options= ("Select","All","None","2n","3n","4n","2n+1","3n+1","3n+2","4n+1","4n+2","4n+3");
 
        my $combo= gen_combo(\@sel_options, 0);
 
        $table->attach ($combo , 0, 1, $row,$row+1,'fill','shrink',2,2);
 
        #get the number of endpoints
 
        my ($NE, $NR, $RAw, $EAw, $Fw) = get_topology_info($mpsoc);
 
        my @check;
 
 
 
 
 
 
 
        my $sel_val="Init";
 
        for (my $i=0; $i<$NE; $i++){
 
                if($i%10 == 0){  $row++;$col=0;}
 
                my $box;
 
                my $l=$NE -$i-1;
 
 
 
                my $char = $arr[$l/4];
 
                $char=0 if (!defined $char);
 
                my $hex = hex($char);
 
                my $bit = ($hex >> ($l%4)) & 1;
 
                ($box,$check[$l])=def_h_labeled_checkbutton("$l");
 
                $table->attach ($box , $col, $col+1, $row,$row+1,'fill','shrink',2,2);
 
                $col++;
 
 
 
                if($bit==1){
 
                        $check[$l]->set_active(TRUE);
 
                }
 
 
 
                $check[$l]-> signal_connect("toggled" => sub{
 
                        get_multicast_val ($mpsoc,$entry,$NE,@check)if($sel_val eq "Select");
 
                });
 
        }
 
        $row++;
 
        $col=0;
 
 
 
        $sel_val="Select";
 
        get_multicast_val ($mpsoc,$entry,$NE,@check);
 
 
 
        $combo-> signal_connect("changed" => sub{
 
                $sel_val=$combo->get_active_text();
 
                my $n=1;
 
                my $r=0;
 
                return if ($sel_val eq "Select");
 
                if ($sel_val eq "None"){
 
                        for (my $i=0; $i<$NE; $i++){$check[$i]->set_active(FALSE)};
 
                        get_multicast_val ($mpsoc,$entry,$NE,@check);
 
                        $combo->set_active(0);
 
                        return;
 
                }
 
                ($n,$r)=sscanf("%dn+%d",$sel_val);
 
                if(!defined $r){
 
                        ($n,$r)=sscanf("%dn",$sel_val);
 
                        $r=0;
 
                        $n=1 if(!defined $n);
 
                }
 
 
 
                for (my $i=0; $i<$NE; $i++){
 
                        if($i % $n == $r){  $check[$i]->set_active(TRUE);}
 
                }
 
                $combo->set_active(0);
 
                get_multicast_val ($mpsoc,$entry,$NE,@check);
 
 
 
         });
 
 
 
 
 
 
 
        $table->attach ($Ebox , 0, 10, $row,$row+1,'fill','shrink',2,2);$row++;
 
 
 
        my $main_table=def_table(10,10,FALSE);
 
 
 
        my $ok = def_image_button('icons/select.png','OK');
 
        $main_table->attach_defaults ($table  , 0, 12, 0,11);
 
    $main_table->attach ($ok,5, 6, 11,12,'shrink','shrink',0,0);
 
 
 
        $ok->signal_connect('clicked', sub {
 
                my $s=get_multicast_val ($mpsoc,$entry,$NE,@check);
 
                my $n=$entry->get_text( );
 
                $mpsoc->object_add_attribute('noc_param',"MCAST_ENDP_LIST",$n);
 
        #       $mpsoc->object_add_attribute('noc_param',"MCAST_PRTLw",$s);
 
                set_gui_status($mpsoc,"ref",1);
 
                $window->destroy;
 
        });
 
 
 
 
 
 
 
 
 
        my $scrolled_win = gen_scr_win_with_adjst($mpsoc,'gen_multicast');
 
        add_widget_to_scrolled_win($main_table,$scrolled_win);
 
        $window->add($scrolled_win);
 
        $window->show_all();
 
}
 
 
 
sub get_multicast_val {
 
        my ($mpsoc,$entry,$NE,@check)=@_;
 
        my $n="";
 
        my $h=0;
 
        my $s=0;
 
        for (my $i=0; $i<$NE; $i++){
 
                        if($check[$i]->get_active()){$h+= (1<<$i%4);$s++;}
 
                if(($i+1) % 4==0){
 
                        $n="$h".$n if($h<10);
 
                        $n=chr($h-10+97).$n if($h>9);
 
                        $h=0;
 
                }
 
        }
 
 
 
        $n="$h".$n if($NE%4!=0);
 
        $n="'h".$n;
 
        $entry->set_text("$n");
 
        return $s;
 
 
 
}
#############
#############
# config_custom_topology_gui
# config_custom_topology_gui
############
############
 
 
sub config_custom_topology_gui{
sub config_custom_topology_gui{

powered by: WebSVN 2.1.0

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