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/] [topology_verilog_gen.pl] - Diff between revs 52 and 54

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 52 Rev 54
Line 21... Line 21...
        add_colored_info($info,"Error in creating $top: $r",'red');
        add_colored_info($info,"Error in creating $top: $r",'red');
                return;
                return;
    }
    }
    print $fd autogen_warning();
    print $fd autogen_warning();
    print $fd get_license_header($top);
    print $fd get_license_header($top);
 
        print $fd '
 
`include "pronoc_def.v"
 
';
 
 
    my $param_str ="\tparameter TOPOLOGY = \"$name\",
    my $param_str ="\tparameter TOPOLOGY = \"$name\",
\tparameter ROUTE_NAME = \"${name}_DETERMINISTIC\"";
\tparameter ROUTE_NAME = \"${name}_DETERMINISTIC\"";
 
 
   my @parameters=@{$self->object_get_attribute ('Verilog','Router_param')};
   my @parameters=@{$self->object_get_attribute ('Verilog','Router_param')};
Line 69... Line 71...
        *******************/
        *******************/
";
";
 
 
                $wires=$wires."\tinput  smartflit_chanel_t ${instance}_chan_in;\n";
                $wires=$wires."\tinput  smartflit_chanel_t ${instance}_chan_in;\n";
                $wires=$wires."\toutput smartflit_chanel_t ${instance}_chan_out;\n";
                $wires=$wires."\toutput smartflit_chanel_t ${instance}_chan_out;\n";
                $ports=$ports.",\n\t${instance}_chan_in,\n\t${instance}_chan_out";
                $wires=$wires."\toutput router_event_t ${instance}_router_event;\n";
 
                $ports=$ports.",\n\t${instance}_chan_in,\n\t${instance}_chan_out,\n\t${instance}_router_event";
 
 
                foreach my $d (@ports){
                foreach my $d (@ports){
                                my $range = ($d->{pwidth} eq 1)? " " :  " [$d->{pwidth}-1 : 0]";
                                my $range = ($d->{pwidth} eq 1)? " " :  " [$d->{pwidth}-1 : 0]";
                                my $type=$d->{type};
                                my $type=$d->{type};
                                my $ctype= ($type eq 'input')? 'output' : 'input';
                                my $ctype= ($type eq 'input')? 'output' : 'input';
Line 192... Line 195...
 
 
\twire [RAw-1 :  0] ${instance}_current_r_addr;
\twire [RAw-1 :  0] ${instance}_current_r_addr;
 
 
\tsmartflit_chanel_t    ${instance}_chan_in   [$Pnum-1 : 0];
\tsmartflit_chanel_t    ${instance}_chan_in   [$Pnum-1 : 0];
\tsmartflit_chanel_t    ${instance}_chan_out  [$Pnum-1 : 0];
\tsmartflit_chanel_t    ${instance}_chan_out  [$Pnum-1 : 0];
 
\trouter_event_t ${instance}_router_event [$Pnum-1 : 0];
 
 
";
";
 
 
 
 
 
 
Line 209... Line 213...
        )
        )
        $instance
        $instance
        (
        (
                .clk(${instance}_clk),
                .clk(${instance}_clk),
                .reset(${instance}_reset),
                .reset(${instance}_reset),
 
                .current_r_id($current_r),
                .current_r_addr  (${instance}_current_r_addr),
                .current_r_addr  (${instance}_current_r_addr),
                .chan_in   (${instance}_chan_in),
                .chan_in   (${instance}_chan_in),
                .chan_out  (${instance}_chan_out)
                .chan_out  (${instance}_chan_out),
 
                .router_event (${instance}_router_event)
        );
        );
";
";
 
 
 
 
$router_v= $router_v."
$router_v= $router_v."
Line 240... Line 246...
                if($ctype ne 'ENDP'){
                if($ctype ne 'ENDP'){
                        $router_v.=" \t\tassign ${instance}_chan_in [$i]   = ${cinstance}_chan_out [$cp];\n";
                        $router_v.=" \t\tassign ${instance}_chan_in [$i]   = ${cinstance}_chan_out [$cp];\n";
                }else{
                }else{
                        $router_v.=" \t\tassign ${instance}_chan_in [$i]  = ${cinstance}_chan_in;\n";
                        $router_v.=" \t\tassign ${instance}_chan_in [$i]  = ${cinstance}_chan_in;\n";
                        $router_v.=" \t\tassign ${cinstance}_chan_out = ${instance}_chan_out [$i];\n";
                        $router_v.=" \t\tassign ${cinstance}_chan_out = ${instance}_chan_out [$i];\n";
 
                        $router_v.=" \t\tassign ${cinstance}_router_event = ${instance}_router_event [$i];\n";
 
 
                }
                }
                my $cpplus=$cp+1;
                my $cpplus=$cp+1;
 
 
                #{name=> "flit_in_all", type=>"input", width=>"PFw", connect=>"flit_out_all",  pwidth=>"Fw" },
                #{name=> "flit_in_all", type=>"input", width=>"PFw", connect=>"flit_out_all",  pwidth=>"Fw" },
 
 
Line 307... Line 315...
        add_colored_info($info,"Error in creating $top: $r",'red');
        add_colored_info($info,"Error in creating $top: $r",'red');
                return;
                return;
    }
    }
    print $fd autogen_warning();
    print $fd autogen_warning();
    print $fd get_license_header($top);
    print $fd get_license_header($top);
 
        print $fd '
 
`include "pronoc_def.v"
 
';
 
 
    my $param_str ="\tparameter TOPOLOGY = \"$name\",
    my $param_str ="\tparameter TOPOLOGY = \"$name\",
\tparameter ROUTE_NAME = \"${name}_DETERMINISTIC\"";
\tparameter ROUTE_NAME = \"${name}_DETERMINISTIC\"";
 
 
   my @parameters=@{$self->object_get_attribute ('Verilog','Router_param')};
   my @parameters=@{$self->object_get_attribute ('Verilog','Router_param')};
Line 339... Line 349...
        my $i=0;
        my $i=0;
 
 
        my $ports="\treset,
        my $ports="\treset,
\tclk,
\tclk,
\tchan_in_all,
\tchan_in_all,
\tchan_out_all
\tchan_out_all,
 
\trouter_event
";
";
    my $ports_def="
    my $ports_def="
\tinput  reset;
\tinput  reset;
\tinput  clk;
\tinput  clk;
\tinput  smartflit_chanel_t chan_in_all  [NE-1 : 0];
\tinput  smartflit_chanel_t chan_in_all  [NE-1 : 0];
\toutput smartflit_chanel_t chan_out_all [NE-1 : 0];
\toutput smartflit_chanel_t chan_out_all [NE-1 : 0];
 
 
 
//Events
 
\toutput  router_event_t  router_event [NR-1 : 0][MAX_P-1 : 0];
 
 
//all routers port
//all routers port
\tsmartflit_chanel_t    router_chan_in   [NR-1 :0][MAX_P-1 : 0];
\tsmartflit_chanel_t    router_chan_in   [NR-1 :0][MAX_P-1 : 0];
\tsmartflit_chanel_t    router_chan_out  [NR-1 :0][MAX_P-1 : 0];
\tsmartflit_chanel_t    router_chan_out  [NR-1 :0][MAX_P-1 : 0];
 
 
 
 
\twire [RAw-1 : 0] current_r_addr [NR-1 : 0];
\twire [RAw-1 : 0] current_r_addr [NR-1 : 0];
 
 
 
 
";
";
 
 
Line 404... Line 419...
        genvar i;
        genvar i;
        generate
        generate
        ';
        ';
        my $offset=0;
        my $offset=0;
        my $assign="";
        my $assign="";
        my $assign_h="";
        my $assign_r2r="";
 
        my $assign_r2e="";
        my $init_h="";
        my $init_h="";
 
        my $init_gnd_h="";
        my %new_h;
        my %new_h;
        my $addr=0;
        my $addr=0;
        for ( my $i=2;$i<=12; $i++){
        for ( my $i=2;$i<=12; $i++){
                my $n= $self->object_get_attribute("ROUTER${i}","NUM");
                my $n= $self->object_get_attribute("ROUTER${i}","NUM");
                $n=0 if(!defined $n);
                $n=0 if(!defined $n);
Line 419... Line 436...
                                my $pos= ($offset==0)? $rr : $rr+$offset;
                                my $pos= ($offset==0)? $rr : $rr+$offset;
                                $new_h{"TNUM_${pos}"}="$Tnum";
                                $new_h{"TNUM_${pos}"}="$Tnum";
                                $new_h{"RNUM_${pos}"}="$rr";
                                $new_h{"RNUM_${pos}"}="$rr";
 
 
                                $init_h.="router${Tnum}[$rr]->current_r_addr=$addr;\n";
                                $init_h.="router${Tnum}[$rr]->current_r_addr=$addr;\n";
 
                                $init_h.="router${Tnum}[$rr]->current_r_id=$addr;\n";
                                $addr++;
                                $addr++;
                        }
                        }
                        $offset+=       $n;
                        $offset+=       $n;
                        $Tnum++;
                        $Tnum++;
                }
                }
Line 433... Line 451...
 
 
 
 
 
 
 
 
        $offset=0;
        $offset=0;
 
        my $R_num=0;
        for ( my $i=2;$i<=12; $i++){
        for ( my $i=2;$i<=12; $i++){
                my $n= $self->object_get_attribute("ROUTER${i}","NUM");
                my $n= $self->object_get_attribute("ROUTER${i}","NUM");
                $n=0 if(!defined $n);
                $n=0 if(!defined $n);
                if($n>0){
                if($n>0){
                        my $router_pos= ($offset==0)? 'i' : "i+$offset";
                        my $router_pos= ($offset==0)? 'i' : "i+$offset";
                        #my $instant=get_router_genvar_instance_v($self,$i,$router_pos,$NE,$NR,$MAX_P);
                        #my $instant=get_router_genvar_instance_v($self,$i,$router_pos,$NE,$NR,$MAX_P);
 
                        my $p = $i-1;
                        $routers=$routers."
                        $routers=$routers."
\tfor( i=0; i<$n; i=i+1) begin : router_${i}_port_lp
\tfor( i=0; i<$n; i=i+1) begin : router_${i}_port_lp
 
        localparam RID = $router_pos;
 
        assign current_r_addr [RID] = RID[RAw-1: 0];
 
 
        router_top #(
        router_top #(
                .P($i)
                .P($i)
        )
        )
        router_${i}_port
        router_${i}_port
        (
        (
                .clk(clk),
                .clk(clk),
                .reset(reset),
                .reset(reset),
                .current_r_addr($router_pos),
                .current_r_id(RID),
                .chan_in  (router_chan_in\[$router_pos\]),
                .current_r_addr(current_r_addr\[RID\]),
                .chan_out (router_chan_out\[$router_pos\])
                .chan_in  (router_chan_in \[RID\] \[$p : 0\]),
 
                .chan_out (router_chan_out\[RID\] \[$p : 0\]),
 
                .router_event(router_event\[RID\] \[$p : 0\])
        );
        );
 
 
 
 
 
 
\tend
\tend
                        ";
                        ";
 
 
                        for ( my $j=0;$j<$n; $j++){
                        for ( my $j=0;$j<$n; $j++){
                                my $rname ="ROUTER${i}_$j";
                                my $rname ="ROUTER${i}_$j";
                                my ($ass_v,$ass_h)=get_wires_assignment_genvar_v($self,$rname,0,\%new_h);
                                my ($ass_v,$r2r_h,$r2e_h, $int_h,$gnd_h);
 
                                ($ass_v,$r2r_h,$r2e_h, $int_h,$gnd_h,$R_num) = get_wires_assignment_genvar_v($self,$rname,0,\%new_h,$R_num);
 
 
                                $assign=$assign.$ass_v;
                                $assign=$assign.$ass_v;
                                $assign_h.=$ass_h;
                                $assign_r2r.=$r2r_h;
 
                                $assign_r2e.=$r2e_h;
 
                                $init_h.=$int_h;
 
                                $init_gnd_h.=$gnd_h;
                        }
                        }
 
 
                $offset+=       $n;
                $offset+=       $n;
 
 
                }
                }
Line 490... Line 516...
        (
        (
 
 
    reset,
    reset,
    clk,
    clk,
    chan_in_all,
    chan_in_all,
    chan_out_all
    chan_out_all,
 
    router_event
);
);
 
 
         function integer log2;
         function integer log2;
      input integer number; begin
      input integer number; begin
         log2=(number <=1) ? 1: 0;
         log2=(number <=1) ? 1: 0;
Line 537... Line 564...
    open $fd, ">$top" or $r = "$!\n";
    open $fd, ">$top" or $r = "$!\n";
    if(defined $r) {
    if(defined $r) {
        add_colored_info($info,"Error in creating $top: $r",'red');
        add_colored_info($info,"Error in creating $top: $r",'red');
                return;
                return;
    }
    }
 
 
 
  my $fr2r="";
 
  for (my $i=0;$i<$R_num ; $i++){
 
        $fr2r.="\n" if($i%10==0);
 
        $fr2r.=($i==0) ? "single_r2r$i" : ",single_r2r$i";
 
 
 
  }
 
 
 
  my $fr2e="";
 
  for (my $i=0;$i<$NE ; $i++){
 
        $fr2e.="\n" if($i%10==0);
 
        $fr2e.=($i==0) ? "single_r2e$i" : ",single_r2e$i";
 
  }
 
 
 
 
    print $fd "
    print $fd "
 
 
 
 
 
$assign_r2r
 
 
 
$assign_r2e
 
 
 
 
void topology_connect_all_nodes (void){
void (*r2r_func_ptr[$R_num])() = {$fr2r};
         $assign_h
void (*r2e_func_ptr[$NE])() = {$fr2e};
 
 
 
void topology_connect_r2r (int n){
 
         (*r2r_func_ptr[n])();
 
}
 
 
 
void topology_connect_r2e (int n){
 
         (*r2e_func_ptr[n])();
}
}
 
 
 
 
 
 
void topology_init(void){
void topology_init(void){
        $init_h
        $init_h
 
        R2R_TABLE_SIZ=$R_num;
 
        $init_gnd_h
}
}
";
";
    close $fd;
    close $fd;
        add_info($info,"$top file is created\n  ");
        add_info($info,"$top file is created\n  ");
 
 
Line 576... Line 633...
        router_${Pnum}_port
        router_${Pnum}_port
        (
        (
                .clk(clk),
                .clk(clk),
                .reset(reset),
                .reset(reset),
                .current_r_addr($router_pos),
                .current_r_addr($router_pos),
 
                .current_r_id($router_pos),
                .chan_in (router_chan_in\[$router_pos\]),
                .chan_in (router_chan_in\[$router_pos\]),
                .chan_out(router_chan_out\[$router_pos\])
                .chan_out(router_chan_out\[$router_pos\]),
 
                .router_event(router_event\[$router_pos\])
        );
        );
 
 
 
 
 
 
";
";
Line 591... Line 650...
 
 
}
}
 
 
 
 
sub get_wires_assignment_genvar_v{
sub get_wires_assignment_genvar_v{
        my ($self,$rname,$reverse,$cref)=@_;
        my ($self,$rname,$reverse,$cref,$R_num)=@_;
    $reverse = 0 if(!defined $reverse);
    $reverse = 0 if(!defined $reverse);
        my $instance= $self->object_get_attribute("$rname","NAME");
        my $instance= $self->object_get_attribute("$rname","NAME");
        my $Pnum=$self->object_get_attribute("$rname",'PNUM');
        my $Pnum=$self->object_get_attribute("$rname",'PNUM');
 
 
        #read ruter parameters and ports
        #read ruter parameters and ports
         my @parameters=@{$self->object_get_attribute ('Verilog','Router_param')};
         my @parameters=@{$self->object_get_attribute ('Verilog','Router_param')};
     my @ports= @{$self->object_get_attribute('Verilog','Router_ports')};
     my @ports= @{$self->object_get_attribute('Verilog','Router_ports')};
 
 
        my $assign="";
        my $assign="";
        my $ass_h="";
        my $r2e_h="";
 
        my $r2r_h="";
 
        my $init_h="";
 
        my $gnd_h="";
 
 
 
 
 
 
        my @ends=get_list_of_all_endpoints($self);
        my @ends=get_list_of_all_endpoints($self);
    my @routers=get_list_of_all_routers($self);
    my @routers=get_list_of_all_routers($self);
 
 
        my $pos = get_scolar_pos($rname,@routers);
        my $pos = get_scolar_pos($rname,@routers);
Line 625... Line 689...
                my ($cname,$pnode)=split(/\s*,\s*/,$connect);
                my ($cname,$pnode)=split(/\s*,\s*/,$connect);
                my $cinstance= $self->object_get_attribute("$cname","NAME");
                my $cinstance= $self->object_get_attribute("$cname","NAME");
                my $ctype = $self->object_get_attribute("$cname",'TYPE');
                my $ctype = $self->object_get_attribute("$cname",'TYPE');
                my ($cp)= sscanf("Port[%u]","$pnode");
                my ($cp)= sscanf("Port[%u]","$pnode");
                $assign.="//Connect $instance input ports $i to  $cinstance output ports $cp\n";
                $assign.="//Connect $instance input ports $i to  $cinstance output ports $cp\n";
                $ass_h.="//Connect $instance input ports $i to  $cinstance output ports $cp\n";
 
 
 
                my $cpos =($ctype eq 'ENDP')?  get_scolar_pos($cname,@ends) :  get_scolar_pos($cname,@routers);
                my $cpos =($ctype eq 'ENDP')?  get_scolar_pos($cname,@ends) :  get_scolar_pos($cname,@routers);
 
 
                my $cpplus=$cp+1;
                my $cpplus=$cp+1;
                my $cposplus = $cpos+1;
                my $cposplus = $cpos+1;
Line 641... Line 705...
                my $TNUM_cpos = $rinfo{"TNUM_${cpos}"};
                my $TNUM_cpos = $rinfo{"TNUM_${cpos}"};
                my $RNUM_cpos = $rinfo{"RNUM_${cpos}"};
                my $RNUM_cpos = $rinfo{"RNUM_${cpos}"};
 
 
                #$assign = $assign."//connet  $instance input port $i to  $cinstance output port $cp\n";
                #$assign = $assign."//connet  $instance input port $i to  $cinstance output port $cp\n";
                if($type  ne 'ENDP'  &&  $ctype eq 'ENDP'){
                if($type  ne 'ENDP'  &&  $ctype eq 'ENDP'){
 
 
                        $assign=  $assign."\t\tassign  router_chan_in \[$pos\]\[$i\] = chan_in_all \[$cpos\];\n" if($reverse==0);
                        $assign=  $assign."\t\tassign  router_chan_in \[$pos\]\[$i\] = chan_in_all \[$cpos\];\n" if($reverse==0);
                        $assign=  $assign."\t\tassign  chan_in_all \[$cpos\] = router_chan_in \[$pos\]\[$i\];\n" if($reverse==1);
                        $assign=  $assign."\t\tassign  chan_in_all \[$cpos\] = router_chan_in \[$pos\]\[$i\];\n" if($reverse==1);
 
 
                        $assign=  $assign."\t\tassign  chan_out_all \[$cpos\] = router_chan_out \[$pos\]\[$i\];\n" if($reverse==0);
                        $assign=  $assign."\t\tassign  chan_out_all \[$cpos\] = router_chan_out \[$pos\]\[$i\];\n" if($reverse==0);
                        $assign=  $assign."\t\tassign  router_chan_out \[$pos\]\[$i\] = chan_out_all \[$cpos\];\n" if($reverse==1);
                        $assign=  $assign."\t\tassign  router_chan_out \[$pos\]\[$i\] = chan_out_all \[$cpos\];\n" if($reverse==1);
 
 
                        $ass_h.=  "\tconnect_r2e($TNUM_pos,$RNUM_pos,$i,$cpos);\n"      if (defined $TNUM_pos);
                        $r2e_h.="//Connect $instance input ports $i to  $cinstance output ports $cp\n";
 
                        $r2e_h.=  "void single_r2e$cpos(void) {connect_r2e($TNUM_pos,$RNUM_pos,$i,$cpos);}\n"   if (defined $TNUM_pos);
 
 
 
 
                }elsif ($type  ne 'ENDP'  &&  $ctype ne 'ENDP'){
                }elsif ($type  ne 'ENDP'  &&  $ctype ne 'ENDP'){
                        $assign=  $assign."\t\tassign  router_chan_in \[$pos\]\[$i\] = router_chan_out \[$cpos\]\[$cp\];\n" if($reverse==0);
                        $assign=  $assign."\t\tassign  router_chan_in \[$pos\]\[$i\] = router_chan_out \[$cpos\]\[$cp\];\n" if($reverse==0);
                        $assign=  $assign."\t\tassign  router_chan_out \[$cpos\]\[$cp\] = router_chan_in \[$pos\]\[$i\];\n" if($reverse==1);
                        $assign=  $assign."\t\tassign  router_chan_out \[$cpos\]\[$cp\] = router_chan_in \[$pos\]\[$i\];\n" if($reverse==1);
                        $ass_h.=  "\tconect_r2r($TNUM_pos,$RNUM_pos,$i,$TNUM_cpos,$RNUM_cpos,$cp);\n" if (defined $TNUM_pos);
                        $r2r_h.="//Connect $instance input ports $i to  $cinstance output ports $cp\n";
 
                        $r2r_h.=  "void single_r2r$R_num(void){conect_r2r($TNUM_pos,$RNUM_pos,$i,$TNUM_cpos,$RNUM_cpos,$cp);}\n" if (defined $TNUM_pos);
 
                        $init_h.="\tr2r_cnt_all[$R_num] =(r2r_cnt_table_t){.id1=$pos, .t1=$TNUM_pos, .r1=$RNUM_pos, .p1=$i,.id2=$cpos, .t2=$TNUM_cpos, .r2=$RNUM_cpos, .p2=$cp };\n";
 
                        $R_num++;
                }
                }
 
 
 
 
 
 
 
 
Line 666... Line 734...
        }else {
        }else {
                        my $TNUM_pos  = $rinfo{"TNUM_${pos}" };
                        my $TNUM_pos  = $rinfo{"TNUM_${pos}" };
                        my $RNUM_pos  = $rinfo{"RNUM_${pos}" };
                        my $RNUM_pos  = $rinfo{"RNUM_${pos}" };
 
 
                        $assign = $assign."//Connect $instance port $i to  ground\n";
                        $assign = $assign."//Connect $instance port $i to  ground\n";
                        $ass_h.="//Connect $instance port $i to  ground\n";
 
                        $assign=  $assign."\t\tassign  router_chan_in  \[$pos\]\[$i\] ={SMARTFLIT_CHANEL_w{1'b0}};\n    " if($reverse==0);
                        $assign=  $assign."\t\tassign  router_chan_in  \[$pos\]\[$i\] ={SMARTFLIT_CHANEL_w{1'b0}};\n    " if($reverse==0);
                        $assign=  $assign."\t\tassign  router_chan_out \[$pos\]\[$i\] ={SMARTFLIT_CHANEL_w{1'b0}};\n    " if($reverse==1);
                        $assign=  $assign."\t\tassign  router_chan_out \[$pos\]\[$i\] ={SMARTFLIT_CHANEL_w{1'b0}};\n    " if($reverse==1);
                        $ass_h.=  "\tconnect_r2gnd($TNUM_pos,$RNUM_pos,$i);\n" if (defined $TNUM_pos);
 
 
                        $gnd_h.="//Connect $instance port $i to  ground\n";
 
                        $gnd_h.=  "\tconnect_r2gnd($TNUM_pos,$RNUM_pos,$i);\n" if (defined $TNUM_pos);
        }
        }
 
 
}
}
 
 
        return ($assign,$ass_h);
 
 
 
 
        return ($assign,$r2r_h,$r2e_h,$init_h,$gnd_h,$R_num);
}
}
 
 
 
 
 
 
 
 
Line 863... Line 934...
 
 
 
 
 
 
 
 
 print $fd "
 print $fd "
 
 
 
 `include \"pronoc_def.v\"
/*******************
/*******************
*  ${Vname}_look_ahead_routing
*  ${Vname}_look_ahead_routing
*******************/
*******************/
module ${Vname}_look_ahead_routing  #(
module ${Vname}_look_ahead_routing  #(
\tparameter RAw = 3,
\tparameter RAw = 3,
Line 889... Line 962...
\tinput reset,clk;
\tinput reset,clk;
 
 
        reg [EAw-1   :0] dest_e_addr_delay;
        reg [EAw-1   :0] dest_e_addr_delay;
        reg [EAw-1   :0] src_e_addr_delay;
        reg [EAw-1   :0] src_e_addr_delay;
 
 
        always @(posedge clk)begin
        always @ (`pronoc_clk_reset_edge )begin
                if(reset)begin
        if(`pronoc_reset)begin
                        dest_e_addr_delay<={EAw{1'b0}};
                        dest_e_addr_delay<={EAw{1'b0}};
                        src_e_addr_delay<={EAw{1'b0}};
                        src_e_addr_delay<={EAw{1'b0}};
                end else begin
                end else begin
                        dest_e_addr_delay<=dest_e_addr;
                        dest_e_addr_delay<=dest_e_addr;
                        src_e_addr_delay<=src_e_addr;
                        src_e_addr_delay<=src_e_addr;
Line 1105... Line 1178...
        $route_str=$route_str."\tendgenerate\n";
        $route_str=$route_str."\tendgenerate\n";
 
 
 
 
 
 
 print $fd "
 print $fd "
 
 `include \"pronoc_def.v\"
 
 
/*****************************
/*****************************
*       ${Vname}_look_ahead_routing_genvar
*       ${Vname}_look_ahead_routing_genvar
******************************/
******************************/
module ${Vname}_look_ahead_routing_genvar  #(
module ${Vname}_look_ahead_routing_genvar  #(
\tparameter RAw = 3,
\tparameter RAw = 3,
Line 1130... Line 1205...
\tinput reset,clk;
\tinput reset,clk;
 
 
        reg [EAw-1   :0] dest_e_addr_delay;
        reg [EAw-1   :0] dest_e_addr_delay;
        reg [EAw-1   :0] src_e_addr_delay;
        reg [EAw-1   :0] src_e_addr_delay;
 
 
        always @(posedge clk)begin
         always @ (`pronoc_clk_reset_edge )begin
                if(reset)begin
        if(`pronoc_reset) begin
                        dest_e_addr_delay<={EAw{1'b0}};
                        dest_e_addr_delay<={EAw{1'b0}};
                        src_e_addr_delay<={EAw{1'b0}};
                        src_e_addr_delay<={EAw{1'b0}};
                end else begin
                end else begin
                        dest_e_addr_delay<=dest_e_addr;
                        dest_e_addr_delay<=dest_e_addr;
                        src_e_addr_delay<=src_e_addr;
                        src_e_addr_delay<=src_e_addr;
Line 1212... Line 1287...
        add_colored_info($info,"Error in creating $top: $r",'red');
        add_colored_info($info,"Error in creating $top: $r",'red');
                return;
                return;
    }
    }
    print $fd autogen_warning();
    print $fd autogen_warning();
    print $fd get_license_header($top);
    print $fd get_license_header($top);
 
print $fd '
 
`include "pronoc_def.v"
 
';
 
 
 
 
 
 
 
 
 
 
Line 1306... Line 1383...
        genvar i;
        genvar i;
        generate
        generate
        ';
        ';
        my $offset=0;
        my $offset=0;
        my $assign="";
        my $assign="";
 
        my $R_num=0;
        for ( my $i=2;$i<=12; $i++){
        for ( my $i=2;$i<=12; $i++){
                my $n= $self->object_get_attribute("ROUTER${i}","NUM");
                my $n= $self->object_get_attribute("ROUTER${i}","NUM");
                $n=0 if(!defined $n);
                $n=0 if(!defined $n);
                if($n>0){
                if($n>0){
                        my $router_pos= ($offset==0)? 'i' : "i+$offset";
                        my $router_pos= ($offset==0)? 'i' : "i+$offset";
Line 1323... Line 1400...
\tend
\tend
                        ";
                        ";
 
 
                        for ( my $j=0;$j<$n; $j++){
                        for ( my $j=0;$j<$n; $j++){
                                my $rname ="ROUTER${i}_$j";
                                my $rname ="ROUTER${i}_$j";
                                my ($ass_v, $ass_h)=    get_wires_assignment_genvar_v($self,$rname,1);
                                my ($ass_v, $r2r_h,$r2e_h, $int_h,$gnd_h,$R_num)=       get_wires_assignment_genvar_v($self,$rname,1,undef,$R_num);
                                $assign=$assign.$ass_v;
                                $assign=$assign.$ass_v;
                        }
                        }
 
 
                $offset+=       $n;
                $offset+=       $n;
 
 
Line 1439... Line 1516...
 
 
 
 
 
 
}
}
 
 
 
sub add_noc_custom_h{
 
        my ($self,$info,$dir)=@_;
 
        my $name=$self->object_get_attribute('save_as');
 
        my $str="
 
                //do not modify this line ===${name}===
 
                #ifdef IS_${name}_noc
 
                        #include \"${name}_noc.h\"
 
                #endif
 
        ";
 
 
 
 
 
        my $file = "$dir/../../../src_verilator/topology/custom/custom.h";
 
        #check if ***$name**** exist in the file
 
        unless (-f $file){
 
                add_colored_info($info,"$file dose not exist\n",'red');
 
                return;
 
        }
 
        my $r = check_file_has_string($file, "===${name}===");
 
        if ($r==1){
 
                add_info($info,"The instance  ${name}_noc exists in $file. This file is not modified\n  ",'blue');
 
 
 
        }else{
 
                my $text = read_file_cntent($file,' ');
 
        my @a = split('endgenerate',$text);
 
        save_file($file,"$a[0] $str $a[1]");
 
        add_info($info,"$file has been modified. The  ${name}_noc has been added to the file\n  ",'blue');
 
 
 
        }
 
 
 
}
 
 
 
 
 
 
sub add_routing_instance_v{
sub add_routing_instance_v{
        my ($self,$info,$dir)=@_;
        my ($self,$info,$dir)=@_;
Line 1630... Line 1736...
                ${name}_noc_genvar the_noc
                ${name}_noc_genvar the_noc
                (
                (
                    .reset(reset),
                    .reset(reset),
                    .clk(clk),
                    .clk(clk),
                    .chan_in_all(chan_in_all),
                    .chan_in_all(chan_in_all),
                    .chan_out_all(chan_out_all)
                    .chan_out_all(chan_out_all),
 
                    .router_event(router_event)
                );
                );
    end
    end
 
 
    endgenerate
    endgenerate
 
 
Line 1672... Line 1779...
}
}
 
 
 
 
1
1
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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