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_modelsim/] [traffic_pattern.sv] - Diff between revs 54 and 56

Show entire file | Details | Blame | View Log

Rev 54 Rev 56
Line 4... Line 4...
* Author: alireza
* Author: alireza
*
*
* Description:
* Description:
***************************************/
***************************************/
 
 
`timescale  1ns/1ps
`include "pronoc_def.v"
 
 
 
 
 
 
/************************************
/************************************
 
 
Line 50... Line 50...
 
 
 
 
 
 
 // generate a random num between 0 to 99
 // generate a random num between 0 to 99
    always @(posedge clk ) begin
    always @(posedge clk ) begin
        if(en | reset) begin
        if(en | `pronoc_reset) begin
                rnd =     $urandom_range(99,0);
                rnd =     $urandom_range(99,0);
        end
        end
    end
    end
 
 
    always @(*) begin
    always @(*) begin
Line 72... Line 72...
 
 
        pck_dst_gen
        pck_dst_gen
 
 
*********************************/
*********************************/
module  pck_dst_gen
module  pck_dst_gen
        import pronoc_pkg::*;
 
        #(
        #(
    parameter NE=4,
    parameter NOC_ID=0,
    parameter TRAFFIC =   "RANDOM",
    parameter TRAFFIC =   "RANDOM",
    parameter MAX_PCK_NUM = 10000,
 
    parameter HOTSPOT_NODE_NUM =  4,
    parameter HOTSPOT_NODE_NUM =  4,
    parameter MCAST_TRAFFIC_RATIO =50,
    parameter MCAST_TRAFFIC_RATIO =50,
    parameter MCAST_PCK_SIZ_MIN = 2,
    parameter MCAST_PCK_SIZ_MIN = 2,
    parameter MCAST_PCK_SIZ_MAX = 4,
    parameter MCAST_PCK_SIZ_MAX = 4,
    parameter PCK_SIZw=5,
 
    parameter MIN_PACKET_SIZE=5,
    parameter MIN_PACKET_SIZE=5,
    parameter MAX_PACKET_SIZE=5,
    parameter MAX_PACKET_SIZE=5,
    parameter PCK_SIZ_SEL="random-discrete",
    parameter PCK_SIZ_SEL="random-discrete",
    parameter DISCRETE_PCK_SIZ_NUM=1
    parameter DISCRETE_PCK_SIZ_NUM=1
 
 
Line 105... Line 102...
    rnd_discrete
    rnd_discrete
 
 
 
 
);
);
 
 
 
    `NOC_CONF
 
 
    localparam      ADDR_DIMENSION =   (TOPOLOGY ==    "MESH" || TOPOLOGY ==  "TORUS") ? 2 : 1;  // "RING" and FULLY_CONNECT
    localparam      ADDR_DIMENSION =   (TOPOLOGY ==    "MESH" || TOPOLOGY ==  "TORUS") ? 2 : 1;  // "RING" and FULLY_CONNECT
 
 
 
 
 
 
 
 
    localparam  NEw= log2(NE),
    localparam  PCK_CNTw = log2(MAX_PCK_NUM+1),
                PCK_CNTw = log2(MAX_PCK_NUM+1),
 
                HOTSPOT_NUM= (TRAFFIC=="HOTSPOT")? HOTSPOT_NODE_NUM : 1;
                HOTSPOT_NUM= (TRAFFIC=="HOTSPOT")? HOTSPOT_NODE_NUM : 1;
 
 
    input                       reset,clk,en;
    input                       reset,clk,en;
    input   [NEw-1      :   0]  core_num;
    input   [NEw-1      :   0]  core_num;
    input   [PCK_CNTw-1 :   0]  pck_number;
    input   [PCK_CNTw-1 :   0]  pck_number;
Line 135... Line 132...
 
 
        wire [EAw-1      :   0] unicast_dest_e_addr;
        wire [EAw-1      :   0] unicast_dest_e_addr;
        wire [PCK_SIZw-1 : 0] pck_size_uni;
        wire [PCK_SIZw-1 : 0] pck_size_uni;
 
 
        pck_dst_gen_unicast #(
        pck_dst_gen_unicast #(
                .NE(NE),
                .NOC_ID(NOC_ID),
                .TRAFFIC(TRAFFIC),
                .TRAFFIC(TRAFFIC),
                .MAX_PCK_NUM(MAX_PCK_NUM),
 
                .HOTSPOT_NODE_NUM(HOTSPOT_NODE_NUM)
                .HOTSPOT_NODE_NUM(HOTSPOT_NODE_NUM)
        )
        )
        unicast
        unicast
        (
        (
                .en               (en              ),
                .en               (en              ),
Line 156... Line 152...
                .custom_traffic_t (custom_traffic_t),
                .custom_traffic_t (custom_traffic_t),
                .custom_traffic_en(custom_traffic_en)
                .custom_traffic_en(custom_traffic_en)
        );
        );
 
 
        pck_size_gen #(
        pck_size_gen #(
                .PCK_SIZw(PCK_SIZw),
                .NOC_ID(NOC_ID),
                .MIN(MIN_PACKET_SIZE),
                .MIN(MIN_PACKET_SIZE),
                .MAX(MAX_PACKET_SIZE),
                .MAX(MAX_PACKET_SIZE),
                .PCK_SIZ_SEL(PCK_SIZ_SEL),
                .PCK_SIZ_SEL(PCK_SIZ_SEL),
                .DISCRETE_PCK_SIZ_NUM(DISCRETE_PCK_SIZ_NUM)
                .DISCRETE_PCK_SIZ_NUM(DISCRETE_PCK_SIZ_NUM)
        )
        )
Line 172... Line 168...
                .pck_size(pck_size_uni) ,
                .pck_size(pck_size_uni) ,
                .rnd_discrete(rnd_discrete)
                .rnd_discrete(rnd_discrete)
        );
        );
 
 
 
 
 
 
 
 
 
 
 
 
        generate
        generate
        if(CAST_TYPE == "UNICAST") begin :uni
        if(CAST_TYPE == "UNICAST") begin :uni
                assign dest_e_addr =    unicast_dest_e_addr;
                assign dest_e_addr =    unicast_dest_e_addr;
                assign pck_size_o  =   pck_size_uni;
                assign pck_size_o  =   pck_size_uni;
        end else begin :multi
        end else begin :multi
Line 195... Line 187...
                                .T2(T2),
                                .T2(T2),
                                .T3(T3),
                                .T3(T3),
                                .NE(NE),
                                .NE(NE),
                                .EAw(EAw),
                                .EAw(EAw),
                                .TOPOLOGY(TOPOLOGY)
                                .TOPOLOGY(TOPOLOGY)
                        )enc
                ) enc (
                        (
 
                                .code(unicast_dest_e_addr),
                                .code(unicast_dest_e_addr),
                                .id(unicast_id_num)
                                .id(unicast_id_num)
                        );
                        );
 
 
 
 
                pck_size_gen #(
                pck_size_gen #(
 
                        .NOC_ID(NOC_ID),
                        .PCK_SIZw(PCK_SIZw),
                        .PCK_SIZw(PCK_SIZw),
                        .MIN(MCAST_PCK_SIZ_MIN),
                        .MIN(MCAST_PCK_SIZ_MIN),
                        .MAX(MCAST_PCK_SIZ_MAX),
                        .MAX(MCAST_PCK_SIZ_MAX),
                        .PCK_SIZ_SEL("random-range"),
                        .PCK_SIZ_SEL("random-range"),
                        .DISCRETE_PCK_SIZ_NUM(DISCRETE_PCK_SIZ_NUM)
                        .DISCRETE_PCK_SIZ_NUM(DISCRETE_PCK_SIZ_NUM)
                )
                ) mcast_pck_size (
                mcast_pck_size
 
                (
 
                        .reset(reset),
                        .reset(reset),
                        .clk(clk),
                        .clk(clk),
                        .en(en),
                        .en(en),
                        .pck_size(pck_size_mcast) ,
                        .pck_size(pck_size_mcast) ,
                        .rnd_discrete(rnd_discrete)
                        .rnd_discrete(rnd_discrete)
                );
                );
 
 
 
 
 
 
 
 
                always @(posedge clk ) begin
                always @(posedge clk ) begin
                        if(en | reset) begin
                        if(en | reset) begin
                                rnd_reg <=     $urandom_range(99,0);
                                rnd_reg <=     $urandom_range(99,0);
                        end
                        end
                end
                end
Line 296... Line 283...
        end endgenerate
        end endgenerate
 
 
endmodule
endmodule
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
module  pck_dst_gen_unicast
module  pck_dst_gen_unicast
        import pronoc_pkg::*;
 
        #(
        #(
    parameter NE=4,
    parameter NOC_ID=0,
    parameter TRAFFIC =   "RANDOM",
    parameter TRAFFIC =   "RANDOM",
    parameter MAX_PCK_NUM = 10000,
 
    parameter HOTSPOT_NODE_NUM =  4
    parameter HOTSPOT_NODE_NUM =  4
)(
)(
    en,
    en,
    current_e_addr,
    current_e_addr,
    core_num,
    core_num,
Line 330... Line 302...
    hotspot_info,
    hotspot_info,
        custom_traffic_t,
        custom_traffic_t,
        custom_traffic_en
        custom_traffic_en
);
);
 
 
 
    `NOC_CONF
    localparam      ADDR_DIMENSION =   (TOPOLOGY ==    "MESH" || TOPOLOGY ==  "TORUS") ? 2 : 1;  // "RING" and FULLY_CONNECT
    localparam      ADDR_DIMENSION =   (TOPOLOGY ==    "MESH" || TOPOLOGY ==  "TORUS") ? 2 : 1;  // "RING" and FULLY_CONNECT
 
 
 
 
    function integer log2;
    localparam  PCK_CNTw = log2(MAX_PCK_NUM+1),
      input integer number; begin
 
         log2=(number <=1) ? 1: 0;
 
         while(2**log2
 
            log2=log2+1;
 
         end
 
      end
 
    endfunction // log2
 
 
 
 
 
    localparam  NEw= log2(NE),
 
                PCK_CNTw = log2(MAX_PCK_NUM+1),
 
                HOTSPOT_NUM= (TRAFFIC=="HOTSPOT")? HOTSPOT_NODE_NUM : 1;
                HOTSPOT_NUM= (TRAFFIC=="HOTSPOT")? HOTSPOT_NODE_NUM : 1;
 
 
    input                       reset,clk,en;
    input                       reset,clk,en;
    input   [NEw-1      :   0]  core_num;
    input   [NEw-1      :   0]  core_num;
    input   [PCK_CNTw-1 :   0]  pck_number;
    input   [PCK_CNTw-1 :   0]  pck_number;
Line 364... Line 325...
 
 
     generate
     generate
     if ( ADDR_DIMENSION == 2) begin :two_dim
     if ( ADDR_DIMENSION == 2) begin :two_dim
 
 
        two_dimension_pck_dst_gen #(
        two_dimension_pck_dst_gen #(
                .NE(NE),
                        .NOC_ID(NOC_ID),
                .TRAFFIC(TRAFFIC),
                .TRAFFIC(TRAFFIC),
                .MAX_PCK_NUM(MAX_PCK_NUM),
 
                .HOTSPOT_NODE_NUM(HOTSPOT_NODE_NUM)
                .HOTSPOT_NODE_NUM(HOTSPOT_NODE_NUM)
 
 
        )
        )
        the_two_dimension_pck_dst_gen
        the_two_dimension_pck_dst_gen
        (
        (
Line 388... Line 348...
        );
        );
 
 
     end else begin : one_dim
     end else begin : one_dim
 
 
        one_dimension_pck_dst_gen #(
        one_dimension_pck_dst_gen #(
                        .NE(NE),
                .NOC_ID(NOC_ID),
                        .TRAFFIC(TRAFFIC),
                        .TRAFFIC(TRAFFIC),
                        .MAX_PCK_NUM(MAX_PCK_NUM),
 
                        .HOTSPOT_NODE_NUM(HOTSPOT_NODE_NUM)
                        .HOTSPOT_NODE_NUM(HOTSPOT_NODE_NUM)
        )
        )
        the_one_dimension_pck_dst_gen
        the_one_dimension_pck_dst_gen
        (
        (
            .reset(reset),
            .reset(reset),
Line 416... Line 375...
 
 
 
 
 
 
 
 
module two_dimension_pck_dst_gen
module two_dimension_pck_dst_gen
                import pronoc_pkg::*;
 
        #(
        #(
                parameter NE=4,
    parameter NOC_ID=0,
                parameter TRAFFIC =   "RANDOM",
                parameter TRAFFIC =   "RANDOM",
                parameter MAX_PCK_NUM = 10000,
 
                parameter HOTSPOT_NODE_NUM =  4
                parameter HOTSPOT_NODE_NUM =  4
 
 
)(
)(
    en,
    en,
    current_e_addr,
    current_e_addr,
Line 437... Line 394...
    hotspot_info,
    hotspot_info,
        custom_traffic_t,
        custom_traffic_t,
        custom_traffic_en
        custom_traffic_en
);
);
 
 
 
    `NOC_CONF
 
 
    function integer log2;
 
      input integer number; begin
 
         log2=(number <=1) ? 1: 0;
 
         while(2**log2
 
            log2=log2+1;
 
         end
 
      end
 
    endfunction // log2
 
 
 
 
 
    localparam NEw= log2(NE),
 
                PCK_CNTw = log2(MAX_PCK_NUM+1),
    localparam  PCK_CNTw = log2(MAX_PCK_NUM+1),
                HOTSPOT_NUM= (TRAFFIC=="HOTSPOT")? HOTSPOT_NODE_NUM : 1;
                HOTSPOT_NUM= (TRAFFIC=="HOTSPOT")? HOTSPOT_NODE_NUM : 1;
 
 
    input                       reset,clk,en;
    input                       reset,clk,en;
    input   [NEw-1      :   0]  core_num;
    input   [NEw-1      :   0]  core_num;
    input   [PCK_CNTw-1 :   0]  pck_number;
    input   [PCK_CNTw-1 :   0]  pck_number;
Line 462... Line 412...
    output                      valid_dst;
    output                      valid_dst;
    input hotspot_t  hotspot_info [HOTSPOT_NUM-1 : 0];
    input hotspot_t  hotspot_info [HOTSPOT_NUM-1 : 0];
        input  [NEw-1 : 0] custom_traffic_t;
        input  [NEw-1 : 0] custom_traffic_t;
        input  custom_traffic_en;
        input  custom_traffic_en;
 
 
    localparam
 
        NX = T1,
 
        NY = T2,
 
        NL = T3,
 
        NXw = log2(NX),
 
        NYw= log2(NY),
 
        NLw= log2(NL);
 
 
 
    wire [NXw-1 : 0] current_x;
    wire [NXw-1 : 0] current_x;
    wire [NYw-1 : 0] current_y;
    wire [NYw-1 : 0] current_y;
    wire [NLw-1  : 0] current_l;
    wire [NLw-1  : 0] current_l;
    wire [NXw-1 : 0] dest_x;
    wire [NXw-1 : 0] dest_x;
Line 508... Line 452...
    if (TRAFFIC == "RANDOM") begin
    if (TRAFFIC == "RANDOM") begin
 
 
        logic [6 : 0] rnd_reg;
        logic [6 : 0] rnd_reg;
 
 
        always @(posedge clk ) begin
        always @(posedge clk ) begin
                if(en | reset) begin
                if(en | `pronoc_reset) begin
                        rnd_reg =     $urandom_range(NE-1,0);
                        rnd_reg =     $urandom_range(NE-1,0);
                        if(SELF_LOOP_EN == "NO")        while(rnd_reg==core_num) rnd_reg =     $urandom_range(NE-1,0);// get a random IP core, make sure its not same as sender core
                        if(SELF_LOOP_EN == "NO")        while(rnd_reg==core_num) rnd_reg =     $urandom_range(NE-1,0);// get a random IP core, make sure its not same as sender core
 
 
                end
                end
        end
        end
Line 533... Line 477...
       );
       );
 
 
     end else if (TRAFFIC == "HOTSPOT") begin
     end else if (TRAFFIC == "HOTSPOT") begin
 
 
        hot_spot_dest_gen  #(
        hot_spot_dest_gen  #(
 
                        .NOC_ID(NOC_ID),
                        .HOTSPOT_NUM(HOTSPOT_NUM),
                        .HOTSPOT_NUM(HOTSPOT_NUM),
                        .NE(NE),
                        .NE(NE),
                        .NEw(NEw)
                        .NEw(NEw)
                )hspot
        ) hspot (
                (
 
                        .reset(reset),
                        .reset(reset),
                        .clk(clk),
                        .clk(clk),
                        .en(en),
                        .en(en),
                        .hotspot_info(hotspot_info),
                        .hotspot_info(hotspot_info),
                        .dest_ip_num (dest_ip_num),
                        .dest_ip_num (dest_ip_num),
Line 554... Line 498...
            .T2(T2),
            .T2(T2),
            .T3(T3),
            .T3(T3),
            .NE(NE),
            .NE(NE),
            .EAw(EAw),
            .EAw(EAw),
            .TOPOLOGY(TOPOLOGY)
            .TOPOLOGY(TOPOLOGY)
        )
        ) addr_encoder (
        addr_encoder
 
        (
 
            .id(dest_ip_num),
            .id(dest_ip_num),
            .code(dest_e_addr)
            .code(dest_e_addr)
        );
        );
 
 
 
 
 
 
    end else if( TRAFFIC == "TRANSPOSE1") begin
    end else if( TRAFFIC == "TRANSPOSE1") begin
 
 
        assign dest_x   = NX-current_y-1;
        assign dest_x   = NX-current_y-1;
        assign dest_y   = NY-current_x-1;
        assign dest_y   = NY-current_x-1;
        assign dest_l   = NL-current_l-1;
        assign dest_l   = NL-current_l-1;
Line 700... Line 641...
 
 
 
 
 
 
 
 
        end else if( TRAFFIC == "SHUFFLE") begin: shuffle
        end else if( TRAFFIC == "SHUFFLE") begin: shuffle
                //di = si−1 mod b
                //di = si−1 mod b
                for(i=1; i<(EAw); i=i+1'b1) begin :lp//reverse the address
                for(i=1; i<(EAw); i=i+1'b1) begin :lp//reverse the address
            assign dest_ip_num[i]  = current_e_addr [i-1];
            assign dest_ip_num[i]  = current_e_addr [i-1];
        end
        end
                assign dest_ip_num[0]  = current_e_addr [EAw-1];
                assign dest_ip_num[0]  = current_e_addr [EAw-1];
                 endp_addr_encoder #(
                 endp_addr_encoder #(
Line 788... Line 729...
 
 
************/
************/
 
 
 
 
module one_dimension_pck_dst_gen
module one_dimension_pck_dst_gen
import pronoc_pkg::*;
 
#(
#(
                parameter NE=4,
        parameter NOC_ID=0,
                parameter TRAFFIC =   "RANDOM",
                parameter TRAFFIC =   "RANDOM",
                parameter MAX_PCK_NUM = 10000,
 
                parameter HOTSPOT_NODE_NUM =  4
                parameter HOTSPOT_NODE_NUM =  4
 
 
)(
)(
    en,
    en,
    core_num,
    core_num,
Line 809... Line 748...
    hotspot_info,
    hotspot_info,
        custom_traffic_t,
        custom_traffic_t,
        custom_traffic_en
        custom_traffic_en
);
);
 
 
    function integer log2;
    `NOC_CONF
      input integer number; begin
 
         log2=(number <=1) ? 1: 0;
 
         while(2**log2
 
            log2=log2+1;
 
         end
 
      end
 
    endfunction // log2
 
 
 
 
 
     localparam
     localparam
        NEw= log2(NE),
 
        PCK_CNTw = log2(MAX_PCK_NUM+1),
        PCK_CNTw = log2(MAX_PCK_NUM+1),
        HOTSPOT_NUM= (TRAFFIC=="HOTSPOT")? HOTSPOT_NODE_NUM : 1;
        HOTSPOT_NUM= (TRAFFIC=="HOTSPOT")? HOTSPOT_NODE_NUM : 1;
 
 
    input   reset,clk,en;
    input   reset,clk,en;
    input   [NEw-1 : 0] core_num;
    input   [NEw-1 : 0] core_num;
Line 842... Line 773...
    generate
    generate
    if (TRAFFIC == "RANDOM") begin
    if (TRAFFIC == "RANDOM") begin
        logic [6 : 0] rnd_reg;
        logic [6 : 0] rnd_reg;
 
 
        always @(posedge clk ) begin
        always @(posedge clk ) begin
                if(en | reset) begin
                if(en | `pronoc_reset) begin
                        rnd_reg =     $urandom_range(NE-1,0);
                        rnd_reg =     $urandom_range(NE-1,0);
                        if(SELF_LOOP_EN == "NO")        while(rnd_reg==core_num) rnd_reg =     $urandom_range(NE-1,0);// get a random IP core, make sure its not same as sender core
                        if(SELF_LOOP_EN == "NO")        while(rnd_reg==core_num) rnd_reg =     $urandom_range(NE-1,0);// get a random IP core, make sure its not same as sender core
                end
                end
        end
        end
        assign dest_ip_num = rnd_reg;
        assign dest_ip_num = rnd_reg;
 
 
 
 
     end else if (TRAFFIC == "HOTSPOT") begin
     end else if (TRAFFIC == "HOTSPOT") begin
 
 
        hot_spot_dest_gen  #(
        hot_spot_dest_gen  #(
 
                .NOC_ID(NOC_ID),
                .HOTSPOT_NUM(HOTSPOT_NUM),
                .HOTSPOT_NUM(HOTSPOT_NUM),
                .NE(NE),
                .NE(NE),
                .NEw(NEw)
                .NEw(NEw)
                )hspot
                ) hspot (
                (
 
                .clk(clk),
                .clk(clk),
                .en(en),
                .en(en),
                .hotspot_info(hotspot_info),
                .hotspot_info(hotspot_info),
                .dest_ip_num (dest_ip_num),
                .dest_ip_num (dest_ip_num),
                .core_num(core_num),
                .core_num(core_num),
                .off_flag(off_flag)
                .off_flag(off_flag)
        );
        );
 
 
 
 
 
 
    end else if( TRAFFIC == "TRANSPOSE1") begin :tran1
    end else if( TRAFFIC == "TRANSPOSE1") begin :tran1
 
 
        assign dest_ip_num   = NE-core_num-1;
        assign dest_ip_num   = NE-core_num-1;
 
 
    end  else if( TRAFFIC == "BIT_REVERSE") begin :bitreverse
    end  else if( TRAFFIC == "BIT_REVERSE") begin :bitreverse
Line 891... Line 821...
        end else if( TRAFFIC == "NEIGHBOR")  begin :neighbor
        end else if( TRAFFIC == "NEIGHBOR")  begin :neighbor
                //dx = sx + 1 mod k
                //dx = sx + 1 mod k
                 assign dest_ip_num = ((core_num + 1) >= NE) ? 0 : (core_num + 1);
                 assign dest_ip_num = ((core_num + 1) >= NE) ? 0 : (core_num + 1);
 
 
        end else if( TRAFFIC == "SHUFFLE") begin: shuffle
        end else if( TRAFFIC == "SHUFFLE") begin: shuffle
                //di = si−1 mod b
                //di = si−1 mod b
                for(i=1; i<(NEw); i=i+1'b1) begin :lp
                for(i=1; i<(NEw); i=i+1'b1) begin :lp
            assign dest_ip_num[i]  = core_num [i-1];
            assign dest_ip_num[i]  = core_num [i-1];
        end
        end
                assign dest_ip_num[0]  = core_num [NEw-1];
                assign dest_ip_num[0]  = core_num [NEw-1];
 
 
Line 940... Line 870...
/***************************
/***************************
 *  pck_size_gen
 *  pck_size_gen
 * *************************/
 * *************************/
 
 
module pck_size_gen
module pck_size_gen
                import pronoc_pkg::*;
 
#(
#(
                parameter PCK_SIZw=4,
    parameter NOC_ID=0,
        parameter MIN = 2,
        parameter MIN = 2,
        parameter MAX = 5,
        parameter MAX = 5,
        parameter PCK_SIZ_SEL="random-discrete",
        parameter PCK_SIZ_SEL="random-discrete",
        parameter DISCRETE_PCK_SIZ_NUM=1
        parameter DISCRETE_PCK_SIZ_NUM=1
)
)
Line 956... Line 885...
    en,
    en,
    pck_size,
    pck_size,
    rnd_discrete
    rnd_discrete
);
);
 
 
 
        `NOC_CONF
 
 
        input rnd_discrete_t rnd_discrete [DISCRETE_PCK_SIZ_NUM-1: 0];
        input rnd_discrete_t rnd_discrete [DISCRETE_PCK_SIZ_NUM-1: 0];
 
 
 
 
    input reset, clk, en;
    input reset, clk, en;
    output [PCK_SIZw-1 : 0] pck_size;
    output [PCK_SIZw-1 : 0] pck_size;
Line 983... Line 914...
                                end
                                end
                        end//always
                        end//always
 
 
 
 
                        always @(posedge clk) begin
                        always @(posedge clk) begin
                                if(reset)  begin
                                if(`pronoc_reset)  begin
                                        rnd2<= 0;
                                        rnd2<= 0;
                                        rnd <= rnd_discrete[0].value;
                                        rnd <= rnd_discrete[0].value;
                                end else  begin
                                end else  begin
                                        if(en) rnd2<= $urandom_range(99,0);
                                        if(en) rnd2<= $urandom_range(99,0);
                                        rnd <= rnd_next;
                                        rnd <= rnd_next;
Line 1001... Line 932...
                if (MIN == MAX) begin :eq
                if (MIN == MAX) begin :eq
                assign pck_size = MIN;
                assign pck_size = MIN;
            end  else begin :noteq
            end  else begin :noteq
                reg [PCK_SIZw-1 : 0] rnd;
                reg [PCK_SIZw-1 : 0] rnd;
                always @(posedge clk) begin
                always @(posedge clk) begin
                    if(reset) rnd = MIN;
                    if(`pronoc_reset) rnd = MIN;
                    else if(en) rnd = $urandom_range(MAX,MIN);
                    else if(en) rnd = $urandom_range(MAX,MIN);
                end
                end
                assign pck_size = rnd;
                assign pck_size = rnd;
            end
            end
        end
        end
Line 1014... Line 945...
 
 
 
 
 
 
 
 
module hot_spot_dest_gen
module hot_spot_dest_gen
        import pronoc_pkg::*;
 
#(
#(
        parameter HOTSPOT_NUM=2,
   parameter NOC_ID=0,
        parameter NE=16,
   parameter HOTSPOT_NUM=2
        parameter NEw=4
) (
)
 
(
 
clk,
clk,
reset,
reset,
en,
en,
hotspot_info,
hotspot_info,
core_num,
core_num,
dest_ip_num,
dest_ip_num,
off_flag
off_flag
);
);
 
 
 
   `NOC_CONF
 
 
        input clk,en,reset;
        input clk,en,reset;
        input hotspot_t  hotspot_info [HOTSPOT_NUM-1 : 0];
        input hotspot_t  hotspot_info [HOTSPOT_NUM-1 : 0];
        input   [NEw-1 : 0] core_num;
        input   [NEw-1 : 0] core_num;
        output  [NEw-1 : 0] dest_ip_num;
        output  [NEw-1 : 0] dest_ip_num;
        output reg off_flag;
        output reg off_flag;
 
 
        logic [6 : 0] rnd_reg, hotspot_node;
        logic [6 : 0] rnd_reg, hotspot_node;
        reg [9 : 0] rnd1000;
        reg [9 : 0] rnd1000;
        always @(posedge clk ) begin
        always @(posedge clk ) begin
                if(en | reset) begin
                if(en | `pronoc_reset) begin
                        rnd_reg =     $urandom_range(NE-1,0);
                        rnd_reg =     $urandom_range(NE-1,0);
                        if(SELF_LOOP_EN == "NO")        while(rnd_reg==core_num) rnd_reg =     $urandom_range(NE-1,0);// get a random IP core, make sure its not same as sender core
                        if(SELF_LOOP_EN == "NO")        while(rnd_reg==core_num) rnd_reg =     $urandom_range(NE-1,0);// get a random IP core, make sure its not same as sender core
 
 
                        rnd1000 =     $urandom_range(999,0);// generate a random number between 0 & 1000
                        rnd1000 =     $urandom_range(999,0);// generate a random number between 0 & 1000
                end
                end

powered by: WebSVN 2.1.0

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