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/] [rtl/] [src_noc/] [multicast.sv] - Diff between revs 54 and 56

Show entire file | Details | Blame | View Log

Rev 54 Rev 56
Line 18... Line 18...
 
 
     look_ahead_routing
     look_ahead_routing
 
 
 *************************************/
 *************************************/
 
 
module multicast_routing
module multicast_routing # (
                import pronoc_pkg::*;
        parameter NOC_ID=0,
        #(
        parameter SW_LOC=0,
                parameter P = 5,
        parameter P=5
                parameter SW_LOC = 0
)(
                )
 
                (
 
                        current_r_addr,  //current router  address
                        current_r_addr,  //current router  address
                        dest_e_addr,  // destination endpoint address
                        dest_e_addr,  // destination endpoint address
                        destport
                        destport
                );
                );
 
 
 
        `NOC_CONF
 
 
        input   [RAw-1   :   0]  current_r_addr;
        input   [RAw-1   :   0]  current_r_addr;
        input   [DAw-1   :   0]  dest_e_addr;
        input   [DAw-1   :   0]  dest_e_addr;
        output  [DSTPw-1  :   0] destport;
        output  [DSTPw-1  :   0] destport;
 
 
        generate
        generate
        /* verilator lint_off WIDTH */
        /* verilator lint_off WIDTH */
        if(TOPOLOGY=="MESH") begin: mesh
        if(TOPOLOGY=="MESH") begin: mesh
        /* verilator lint_on WIDTH */
        /* verilator lint_on WIDTH */
                multicast_routing_mesh
                multicast_routing_mesh #(
                #(
                        .NOC_ID(NOC_ID),
                        .P(P) ,
                        .P(P) ,
                        .SW_LOC(SW_LOC)
                        .SW_LOC(SW_LOC)
                )
                ) routing (
                routing
 
                (
 
                        .current_r_addr(current_r_addr),  //current router  address
                        .current_r_addr(current_r_addr),  //current router  address
                        .dest_e_addr(dest_e_addr),  // destination endpoint address
                        .dest_e_addr(dest_e_addr),  // destination endpoint address
                        .destport(destport)
                        .destport(destport)
                );
                );
        /* verilator lint_off WIDTH */
        /* verilator lint_off WIDTH */
        end else if (TOPOLOGY == "FMESH") begin : fmesh
        end else if (TOPOLOGY == "FMESH") begin : fmesh
        /* verilator lint_on WIDTH */
        /* verilator lint_on WIDTH */
                multicast_routing_fmesh
                multicast_routing_fmesh #(
                #(
                        .NOC_ID(NOC_ID),
                        .P(P) ,
                        .P(P) ,
                        .SW_LOC(SW_LOC)
                        .SW_LOC(SW_LOC)
                )
                ) routing (
                routing
 
                (
 
                        .current_r_addr(current_r_addr),  //current router  address
                        .current_r_addr(current_r_addr),  //current router  address
                        .dest_e_addr(dest_e_addr),  // destination endpoint address
                        .dest_e_addr(dest_e_addr),  // destination endpoint address
                        .destport(destport)
                        .destport(destport)
                );
                );
 
 
Line 76... Line 72...
 
 
 
 
 
 
endmodule
endmodule
 
 
module multicast_routing_mesh
module multicast_routing_mesh   #(
        import pronoc_pkg::*;
        parameter NOC_ID=0,
        #(
        parameter SW_LOC=0,
                parameter P = 5,
        parameter P=5
                parameter SW_LOC = 0
) (
        )
 
        (
 
                current_r_addr,  //current router  address
                current_r_addr,  //current router  address
                dest_e_addr,  // destination endpoint address
                dest_e_addr,  // destination endpoint address
                destport
                destport
        );
        );
 
 
 
   `NOC_CONF
 
 
        input   [RAw-1   :   0]  current_r_addr;
        input   [RAw-1   :   0]  current_r_addr;
        input   [DAw-1   :   0]  dest_e_addr;
        input   [DAw-1   :   0]  dest_e_addr;
        output  [DSTPw-1  :   0] destport;
        output  [DSTPw-1  :   0] destport;
 
 
 
 
        localparam
        localparam
                NX = T1,
 
                NY = T2,
 
                RXw = log2(NX),
                RXw = log2(NX),
                RYw = log2(NY),
                RYw = log2(NY),
                EXw = RXw,
                EXw = RXw,
                EYw = RYw;
                EYw = RYw;
 
 
Line 134... Line 126...
 
 
 
 
                wire [NX-1 : 0] row_has_any_dest;
                wire [NX-1 : 0] row_has_any_dest;
                wire [NE-1 : 0] dest_mcast_all_endp;
                wire [NE-1 : 0] dest_mcast_all_endp;
 
 
                mcast_dest_list_decode decode (
                mcast_dest_list_decode #(
 
                        .NOC_ID(NOC_ID)
 
                ) decode (
                        .dest_e_addr(dest_e_addr),
                        .dest_e_addr(dest_e_addr),
                        .dest_o(dest_mcast_all_endp),
                        .dest_o(dest_mcast_all_endp),
                        .row_has_any_dest(row_has_any_dest),
                        .row_has_any_dest(row_has_any_dest),
                        .is_unicast()
                        .is_unicast()
                );
                );
Line 226... Line 220...
 
 
endmodule
endmodule
 
 
 
 
 
 
 
module multicast_routing_fmesh #(
 
        parameter NOC_ID=0,
 
        parameter SW_LOC=0,
module multicast_routing_fmesh
        parameter P=5
        import pronoc_pkg::*;
) (
        #(
 
        parameter P = 5,
 
        parameter SW_LOC = 0
 
        )
 
        (
 
        current_r_addr,  //current router  address
        current_r_addr,  //current router  address
        dest_e_addr,  // destination endpoint address
        dest_e_addr,  // destination endpoint address
        destport
        destport
        );
        );
 
 
 
        `NOC_CONF
 
 
        input   [RAw-1   :   0]  current_r_addr;
        input   [RAw-1   :   0]  current_r_addr;
        input   [DAw-1   :   0]  dest_e_addr;
        input   [DAw-1   :   0]  dest_e_addr;
        output  [DSTPw-1 :   0]  destport;
        output  [DSTPw-1 :   0]  destport;
 
 
        localparam Pw = log2(MAX_P_FMESH);
        localparam Pw = log2(MAX_P_FMESH);
 
 
        localparam
        localparam
                NX = T1,
 
                NY = T2,
 
                RXw = log2(NX),
                RXw = log2(NX),
                RYw = log2(NY),
                RYw = log2(NY),
                EXw = RXw,
                EXw = RXw,
                EYw = RYw;
                EYw = RYw;
 
 
Line 285... Line 274...
 
 
 
 
        wire [NX-1 : 0] row_has_any_dest;
        wire [NX-1 : 0] row_has_any_dest;
        wire [NE-1 : 0] dest_mcast_all_endp;
        wire [NE-1 : 0] dest_mcast_all_endp;
 
 
        mcast_dest_list_decode decode (
        mcast_dest_list_decode # (
 
                .NOC_ID(NOC_ID)
 
        ) decode (
                        .dest_e_addr(dest_e_addr),
                        .dest_e_addr(dest_e_addr),
                        .dest_o(dest_mcast_all_endp),
                        .dest_o(dest_mcast_all_endp),
                        .row_has_any_dest(row_has_any_dest),
                        .row_has_any_dest(row_has_any_dest),
                        .is_unicast()
                        .is_unicast()
                );
                );
Line 312... Line 303...
                        ADR = fmesh_addrencode(i),
                        ADR = fmesh_addrencode(i),
                        XX = ADR [NXw -1 : 0],
                        XX = ADR [NXw -1 : 0],
                        YY = ADR [NXw+NYw-1 : NXw],
                        YY = ADR [NXw+NYw-1 : NXw],
                        PP = ADR [NXw+NYw+Pw-1 : NXw+NYw];
                        PP = ADR [NXw+NYw+Pw-1 : NXw+NYw];
 
 
 
 
                /* verilator lint_off CMPCONST */
                /* verilator lint_off CMPCONST */
                assign y_plus[i]  = (current_rx ==      XX) && (current_ry >  YY);
                assign y_plus[i]  = (current_rx ==      XX) && (current_ry >  YY);
                /* verilator lint_on CMPCONST */
                /* verilator lint_on CMPCONST */
 
 
                /* verilator lint_off UNSIGNED */
                /* verilator lint_off UNSIGNED */
Line 324... Line 314...
                /* verilator lint_on UNSIGNED */
                /* verilator lint_on UNSIGNED */
 
 
                for(j=0;j
                for(j=0;j
                        assign local_p[j][i] = (current_rx      ==      XX) && (current_ry == YY) && (PP == j);
                        assign local_p[j][i] = (current_rx      ==      XX) && (current_ry == YY) && (PP == j);
                end
                end
 
 
 
 
 
 
        end//for ne
        end//for ne
 
 
        wire [MAX_P_FMESH-1 : 0] goto_local;
        wire [MAX_P_FMESH-1 : 0] goto_local;
        for(i=0; i
        for(i=0; i
                assign goto_local[i] = |(local_p[i] & dest_mcast_all_endp);// will be synthesized as single bit assign
                assign goto_local[i] = |(local_p[i] & dest_mcast_all_endp);// will be synthesized as single bit assign
Line 341... Line 328...
        wire goto_south = (|(y_min   & dest_mcast_all_endp)) | goto_local[SOUTH];
        wire goto_south = (|(y_min   & dest_mcast_all_endp)) | goto_local[SOUTH];
        wire goto_east  = (|(x_minus & row_has_any_dest))    | goto_local[EAST];
        wire goto_east  = (|(x_minus & row_has_any_dest))    | goto_local[EAST];
        wire goto_west  = (|(x_plus  & row_has_any_dest))    | goto_local[WEST];
        wire goto_west  = (|(x_plus  & row_has_any_dest))    | goto_local[WEST];
 
 
 
 
 
 
 
 
 
 
                reg [4  :   0] destport_tmp;
                reg [4  :   0] destport_tmp;
 
 
                always @(*) begin
                always @(*) begin
                        destport_tmp = {DSTPw{1'b0}};
                        destport_tmp = {DSTPw{1'b0}};
                        destport_tmp[LOCAL]=goto_local[LOCAL];
                        destport_tmp[LOCAL]=goto_local[LOCAL];
Line 385... Line 369...
                for(i=1;i
                for(i=1;i
                        assign destport[MSB_DSTP+i]=goto_local[i];
                        assign destport[MSB_DSTP+i]=goto_local[i];
                end
                end
 
 
 
 
 
 
        endgenerate
        endgenerate
 
 
endmodule
endmodule
 
 
 
 
module mcast_dest_list_decode
module mcast_dest_list_decode #(
                import pronoc_pkg::*;
        parameter NOC_ID=0
                (
) (
                dest_e_addr,
                dest_e_addr,
                dest_o,
                dest_o,
                row_has_any_dest,
                row_has_any_dest,
                is_unicast
                is_unicast
                );
                );
 
 
 
        `NOC_CONF
 
 
        input  [DAw-1 :0]  dest_e_addr;
        input  [DAw-1 :0]  dest_e_addr;
        output [NE-1 : 0]  dest_o;
        output [NE-1 : 0]  dest_o;
        output [NX-1 : 0] row_has_any_dest;
        output [NX-1 : 0] row_has_any_dest;
        output is_unicast;
        output is_unicast;
Line 525... Line 509...
 
 
        end
        end
 
 
        endgenerate
        endgenerate
 
 
 
 
endmodule
endmodule
 
 
 
 
 
 
 
 
module multicast_chan_in_process
module multicast_chan_in_process #(
                import pronoc_pkg::*;
        parameter NOC_ID=0,
        #(
        parameter SW_LOC=0,
                parameter P = 5,
        parameter P=5
                parameter SW_LOC = 0
) (
 
 
        )
 
        (
 
                endp_port,
                endp_port,
                current_r_addr,
                current_r_addr,
                chan_in,
                chan_in,
                chan_out,
                chan_out,
                clk
                clk
        );
        );
 
 
 
        `NOC_CONF
 
 
        input endp_port;
        input endp_port;
        input   [RAw-1   :   0]  current_r_addr;
        input   [RAw-1   :   0]  current_r_addr;
        input   flit_chanel_t chan_in;
        input   flit_chanel_t chan_in;
        input   clk;
        input   clk;
        output  flit_chanel_t chan_out;
        output  flit_chanel_t chan_out;
Line 558... Line 540...
        wire  [MCASTw-1   :   0]  mcast_dst_coded;
        wire  [MCASTw-1   :   0]  mcast_dst_coded;
        wire  [NE-1 : 0] dest_mcast_all_endp;
        wire  [NE-1 : 0] dest_mcast_all_endp;
        wire [NX-1 : 0] row_has_any_dest,row_has_any_dest_in;
        wire [NX-1 : 0] row_has_any_dest,row_has_any_dest_in;
        wire  [DSTPw-1  :   0] destport,destport_o;
        wire  [DSTPw-1  :   0] destport,destport_o;
 
 
 
 
 
 
        hdr_flit_t hdr_flit;
        hdr_flit_t hdr_flit;
        header_flit_info extract(
 
 
        header_flit_info #(
 
                .NOC_ID (NOC_ID)
 
        ) extract (
                        .flit(chan_in.flit),
                        .flit(chan_in.flit),
                        .hdr_flit(hdr_flit),
                        .hdr_flit(hdr_flit),
                        .data_o()
                        .data_o()
                );
                );
 
 
        mcast_dest_list_decode decoder
        mcast_dest_list_decode #(
        (
                .NOC_ID(NOC_ID)
 
        ) decoder (
                .dest_e_addr(hdr_flit.dest_e_addr),
                .dest_e_addr(hdr_flit.dest_e_addr),
                .dest_o(dest_mcast_all_endp),
                .dest_o(dest_mcast_all_endp),
                .row_has_any_dest(row_has_any_dest_in),
                .row_has_any_dest(row_has_any_dest_in),
                .is_unicast()
                .is_unicast()
        );
        );
 
 
        localparam MCASTw_= (MCASTw < DAw ) ? MCASTw : DAw;
        localparam MCASTw_= (MCASTw < DAw ) ? MCASTw : DAw;
 
 
        assign mcast_dst_coded = hdr_flit.dest_e_addr[MCASTw_-1:0];
        assign mcast_dst_coded = hdr_flit.dest_e_addr[MCASTw_-1:0];
 
 
 
 
        genvar i;
        genvar i;
        generate
        generate
        if(TOPOLOGY == "MESH") begin : mesh_
        if(TOPOLOGY == "MESH") begin : mesh_
                if(SW_LOC == LOCAL || SW_LOC > SOUTH) begin :endp
                if(SW_LOC == LOCAL || SW_LOC > SOUTH) begin :endp
 
 
Line 675... Line 658...
                wire [DAw-1 : 0] dest_e_addr = {row_has_any_dest,mcast_dst_coded};
                wire [DAw-1 : 0] dest_e_addr = {row_has_any_dest,mcast_dst_coded};
 
 
 
 
                multicast_routing
                multicast_routing
                #(
                #(
 
                        .NOC_ID(NOC_ID),
                        .P(P) ,
                        .P(P) ,
                        .SW_LOC(SW_LOC)
                        .SW_LOC(SW_LOC)
                )
                )
                routing
                routing
                (
                (
Line 698... Line 682...
                        end
                        end
                end
                end
 
 
 
 
 
 
 
 
 
 
 
 
        //synthesis translate_off
        //synthesis translate_off
        if(DEBUG_EN) begin :debg
        if(DEBUG_EN) begin :debg
                always @(posedge clk) begin
                always @(posedge clk) begin
                        /* verilator lint_off WIDTH */
                        /* verilator lint_off WIDTH */
                        if(CAST_TYPE == "MULTICAST_FULL" || CAST_TYPE == "MULTICAST_PARTIAL")
                        if(CAST_TYPE == "MULTICAST_FULL" || CAST_TYPE == "MULTICAST_PARTIAL")
Line 731... Line 712...
        endgenerate
        endgenerate
endmodule
endmodule
 
 
 
 
 
 
 
module multicast_dst_sel # (
 
        parameter NOC_ID=0
module multicast_dst_sel
)(
                import pronoc_pkg::*;
 
        (
 
 
 
                destport_in,
                destport_in,
                destport_out
                destport_out
        );
        );
 
 
 
        `NOC_CONF
 
 
        input  [DSTPw-1 : 0] destport_in;
        input  [DSTPw-1 : 0] destport_in;
        output [DSTPw-1 : 0] destport_out;
        output [DSTPw-1 : 0] destport_out;
 
 
 
 
        wire  [DSTPw-1 : 0] arb_in, arb_out;
        wire  [DSTPw-1 : 0] arb_in, arb_out;

powered by: WebSVN 2.1.0

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