// synthesis translate_off
|
// synthesis translate_off
|
`timescale 1ns/1ns
|
`timescale 1ns/1ns
|
|
|
`define STND_DEV_EN
|
`define STND_DEV_EN
|
|
|
module testbench_noc;
|
module testbench_noc;
|
|
|
import pronoc_pkg::*;
|
import pronoc_pkg::*;
|
`define INCLUDE_SIM_PARAM
|
`define INCLUDE_SIM_PARAM
|
`include "sim_param.sv" //will be generated by ProNoC GUI
|
`include "sim_param.sv" //will be generated by ProNoC GUI
|
// simulation parameter setting
|
// simulation parameter setting
|
// injected packet class percentage
|
// injected packet class percentage
|
localparam
|
localparam
|
C0_p=100,
|
C0_p=100,
|
C1_p=0,
|
C1_p=0,
|
C2_p=0,
|
C2_p=0,
|
C3_p=0;
|
C3_p=0;
|
|
|
|
|
localparam RATIOw=$clog2(100);
|
localparam RATIOw=$clog2(100);
|
|
|
|
|
reg reset ,clk;
|
reg reset ,clk;
|
reg start,stop;
|
reg start,stop;
|
wire sent_done;
|
wire sent_done;
|
reg done;
|
reg done;
|
reg [RATIOw-1:0] ratio;
|
reg [RATIOw-1:0] ratio;
|
|
|
|
|
|
|
|
|
initial begin
|
initial begin
|
clk = 1'b0;
|
clk = 1'b0;
|
forever clk = #10 ~clk;
|
forever clk = #10 ~clk;
|
end
|
end
|
|
|
|
|
|
|
initial begin
|
initial begin
|
reset = 1'b1;
|
reset = 1'b1;
|
start = 1'b0;
|
start = 1'b0;
|
stop = 1'b0;
|
stop = 1'b0;
|
ratio =INJRATIO;
|
ratio =INJRATIO;
|
#80
|
#80
|
@(posedge clk) reset = 1'b0;
|
@(posedge clk) reset = 1'b0;
|
#200
|
#200
|
@(posedge clk) start = 1'b1;
|
@(posedge clk) start = 1'b1;
|
@(posedge clk) start = 1'b0;
|
@(posedge clk) start = 1'b0;
|
@(posedge sent_done)
|
@(posedge sent_done)
|
stop=1;//stop all packet injectprs
|
stop=1;//stop all packet injectprs
|
@(posedge done) //wait for all sent flits to be received at their destination
|
@(posedge done) //wait for all sent flits to be received at their destination
|
#450
|
#450
|
@(posedge clk)
|
@(posedge clk)
|
$stop;
|
$stop;
|
end
|
end
|
|
|
|
|
localparam
|
localparam
|
/* verilator lint_off WIDTH */
|
/* verilator lint_off WIDTH */
|
|
|
|
|
DISTw = (TOPOLOGY=="FATTREE" || TOPOLOGY == "TREE") ? $clog2(2*L+1): $clog2(NR+1),
|
DISTw = (TOPOLOGY=="FATTREE" || TOPOLOGY == "TREE") ? $clog2(2*L+1): $clog2(NR+1),
|
/* verilator lint_on WIDTH */
|
/* verilator lint_on WIDTH */
|
|
|
Cw = (C>1)? $clog2(C): 1,
|
Cw = (C>1)? $clog2(C): 1,
|
// NEw = log2(NE),
|
// NEw = log2(NE),
|
|
|
NEV = NE * V,
|
NEV = NE * V,
|
NEFw = NE * Fw,
|
NEFw = NE * Fw,
|
PCK_CNTw= $clog2(MAX_PCK_NUM+1),
|
PCK_CNTw= $clog2(MAX_PCK_NUM+1),
|
CLK_CNTw= $clog2(MAX_SIM_CLKs+1),
|
CLK_CNTw= $clog2(MAX_SIM_CLKs+1),
|
PCK_SIZw= $clog2(MAX_PCK_SIZ+1),
|
PCK_SIZw= $clog2(MAX_PCK_SIZ+1),
|
AVG_PCK_SIZ = (MAX_PACKET_SIZE + MIN_PACKET_SIZE)/2 ;
|
AVG_PCK_SIZ = (MAX_PACKET_SIZE + MIN_PACKET_SIZE)/2 ;
|
|
|
|
|
typedef struct {
|
typedef struct {
|
logic [PCK_CNTw-1 :0] pck_num;
|
logic [PCK_CNTw-1 :0] pck_num;
|
integer flit_num;
|
integer flit_num;
|
integer worst_latency;
|
integer worst_latency;
|
integer min_latency;
|
integer min_latency;
|
real sum_clk_h2h;
|
real sum_clk_h2h;
|
real sum_clk_h2t;
|
real sum_clk_h2t;
|
real sum_clk_per_hop;
|
real sum_clk_per_hop;
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
real sum_clk_pow2;
|
real sum_clk_pow2;
|
`endif
|
`endif
|
} statistic_t;
|
} statistic_t;
|
|
|
|
|
typedef struct {
|
typedef struct {
|
real avg_latency_per_hop;
|
real avg_latency_per_hop;
|
real avg_latency_flit;
|
real avg_latency_flit;
|
real avg_latency_pck;
|
real avg_latency_pck;
|
real avg_throughput;
|
real avg_throughput;
|
real avg_pck_siz;
|
real avg_pck_siz;
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
real std_dev;
|
real std_dev;
|
`endif
|
`endif
|
} avg_st_t;
|
} avg_st_t;
|
|
|
integer m,c;
|
integer m,c;
|
localparam STAT_NUM= (C==0)? 1 : C;
|
localparam STAT_NUM= (C==0)? 1 : C;
|
statistic_t sent_stat [NE][STAT_NUM];
|
statistic_t sent_stat [NE][STAT_NUM];
|
statistic_t rsvd_stat [NE][STAT_NUM];
|
statistic_t rsvd_stat [NE][STAT_NUM];
|
statistic_t sent_stat_class [NE];
|
statistic_t sent_stat_class [NE];
|
statistic_t rsvd_stat_class [NE];
|
statistic_t rsvd_stat_class [NE];
|
statistic_t sent_stat_per_class [STAT_NUM];
|
statistic_t sent_stat_per_class [STAT_NUM];
|
statistic_t rsvd_stat_per_class [STAT_NUM];
|
statistic_t rsvd_stat_per_class [STAT_NUM];
|
statistic_t rsvd_stat_total;
|
statistic_t rsvd_stat_total;
|
statistic_t sent_stat_total;
|
statistic_t sent_stat_total;
|
|
|
initial begin
|
initial begin
|
reset_st (rsvd_stat_total);
|
reset_st (rsvd_stat_total);
|
reset_st (sent_stat_total);
|
reset_st (sent_stat_total);
|
for(m=0;m
|
for(m=0;m
|
for (c=0;c
|
for (c=0;c
|
reset_st(sent_stat[m][c]);
|
reset_st(sent_stat[m][c]);
|
reset_st(rsvd_stat[m][c]);
|
reset_st(rsvd_stat[m][c]);
|
end
|
end
|
reset_st(rsvd_stat_class[m]);
|
reset_st(rsvd_stat_class[m]);
|
reset_st(sent_stat_class[m]);
|
reset_st(sent_stat_class[m]);
|
end
|
end
|
for (c=0; c
|
for (c=0; c
|
reset_st(sent_stat_per_class [c]);
|
reset_st(sent_stat_per_class [c]);
|
reset_st(rsvd_stat_per_class [c]);
|
reset_st(rsvd_stat_per_class [c]);
|
end
|
end
|
end
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
task reset_st;
|
task reset_st;
|
output statistic_t stat_in;
|
output statistic_t stat_in;
|
begin
|
begin
|
stat_in.pck_num={PCK_CNTw{1'b0}};
|
stat_in.pck_num={PCK_CNTw{1'b0}};
|
stat_in.flit_num=0;
|
stat_in.flit_num=0;
|
stat_in.worst_latency=0;
|
stat_in.worst_latency=0;
|
stat_in.min_latency=0;
|
stat_in.min_latency=0;
|
stat_in.sum_clk_h2h=0;
|
stat_in.sum_clk_h2h=0;
|
stat_in.sum_clk_h2t=0;
|
stat_in.sum_clk_h2t=0;
|
stat_in.sum_clk_per_hop=0;
|
stat_in.sum_clk_per_hop=0;
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
stat_in.sum_clk_pow2=0;
|
stat_in.sum_clk_pow2=0;
|
`endif
|
`endif
|
end
|
end
|
endtask
|
endtask
|
|
|
|
|
|
|
|
reg print_router_st;
|
|
|
smartflit_chanel_t chan_in_all [NE-1 : 0];
|
smartflit_chanel_t chan_in_all [NE-1 : 0];
|
smartflit_chanel_t chan_out_all [NE-1 : 0];
|
smartflit_chanel_t chan_out_all [NE-1 : 0];
|
|
router_event_t router_event [NR-1 : 0] [MAX_P-1 : 0];
|
|
|
|
|
|
|
|
|
wire [NE-1 : 0] hdr_flit_sent;
|
wire [NE-1 : 0] hdr_flit_sent;
|
wire [EAw-1 : 0] dest_e_addr [NE-1 :0];
|
wire [DAw-1 : 0] dest_e_addr [NE-1 :0];
|
wire [EAw-1 : 0] src_e_addr [NE-1 :0];
|
wire [EAw-1 : 0] src_e_addr [NE-1 :0];
|
wire [Cw-1 : 0] pck_class_in [NE-1 :0];
|
wire [Cw-1 : 0] pck_class_in [NE-1 :0];
|
wire [Cw-1 : 0] flit_out_class [NE-1 :0];
|
wire [Cw-1 : 0] flit_out_class [NE-1 :0];
|
wire [NEw-1 : 0] src_id [NE-1 :0];
|
wire [NEw-1 : 0] src_id [NE-1 :0];
|
|
|
wire [PCK_SIZw-1: 0] pck_size_in [NE-1 :0];
|
wire [PCK_SIZw-1: 0] pck_size_in [NE-1 :0];
|
wire [PCK_SIZw-1: 0] pck_size_o [NE-1 :0];
|
wire [PCK_SIZw-1: 0] pck_size_o [NE-1 :0];
|
|
wire [NEw-1 : 0] mcast_dst_num [NE-1 :0];
|
|
|
// wire [NE-1 :0] report;
|
// wire [NE-1 :0] report;
|
reg [CLK_CNTw-1 :0] clk_counter;
|
reg [CLK_CNTw-1 :0] clk_counter;
|
|
|
|
|
|
|
wire [PCK_CNTw-1 :0] pck_counter [NE-1 :0];
|
wire [PCK_CNTw-1 :0] pck_counter [NE-1 :0];
|
wire [NE-1 :0] noc_report;
|
wire [NE-1 :0] noc_report;
|
wire [NE-1 :0] update;
|
wire [NE-1 :0] update;
|
wire [CLK_CNTw-1 :0] time_stamp_h2t [NE-1 :0];
|
wire [CLK_CNTw-1 :0] time_stamp_h2t [NE-1 :0];
|
wire [CLK_CNTw-1 :0] time_stamp_h2h [NE-1 :0];
|
wire [CLK_CNTw-1 :0] time_stamp_h2h [NE-1 :0];
|
wire [DISTw-1 :0] distance [NE-1 :0];
|
wire [DISTw-1 :0] distance [NE-1 :0];
|
wire [Cw-1 :0] pck_class_out [NE-1 :0];
|
wire [Cw-1 :0] pck_class_out [NE-1 :0];
|
|
|
reg count_en;
|
reg count_en;
|
//reg [NE-1 : 0] start_o;
|
//reg [NE-1 : 0] start_o;
|
logic [DELAYw-1 : 0] start_delay [NE-1 : 0];
|
logic [DELAYw-1 : 0] start_delay [NE-1 : 0];
|
|
|
|
|
|
|
|
|
integer rsv_size_array [MAX_PACKET_SIZE - MIN_PACKET_SIZE : 0];
|
integer rsv_size_array [MAX_PACKET_SIZE - MIN_PACKET_SIZE : 0];
|
|
|
|
|
|
|
always @(posedge clk or posedge reset) begin
|
always @(posedge clk or posedge reset) begin
|
if (reset) begin
|
if (reset) begin
|
count_en <=1'b0;
|
count_en <=1'b0;
|
end else begin
|
end else begin
|
if(start) count_en <=1'b1;
|
if(start) count_en <=1'b1;
|
else if(noc_report) count_en <=1'b0;
|
else if(noc_report) count_en <=1'b0;
|
end
|
end
|
end//always
|
end//always
|
|
|
|
|
noc_top
|
noc_top
|
the_noc
|
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)
|
);
|
);
|
|
|
|
|
|
|
always @ (posedge clk or posedge reset)begin
|
always @ (posedge clk or posedge reset)begin
|
if (reset ) begin clk_counter <= 0; end
|
if (reset ) begin clk_counter <= 0; end
|
else begin
|
else begin
|
if (count_en) clk_counter <= clk_counter+1'b1;
|
if (count_en) clk_counter <= clk_counter+1'b1;
|
|
|
end
|
end
|
end
|
end
|
|
|
|
|
|
|
function integer addrencode;
|
function integer addrencode;
|
input integer pos,k,n,kw;
|
input integer pos,k,n,kw;
|
integer pow,i,tmp;begin
|
integer pow,i,tmp;begin
|
addrencode=0;
|
addrencode=0;
|
pow=1;
|
pow=1;
|
for (i = 0; i
|
for (i = 0; i
|
tmp=(pos/pow);
|
tmp=(pos/pow);
|
tmp=tmp%k;
|
tmp=tmp%k;
|
tmp=tmp<
|
tmp=tmp<
|
addrencode=addrencode | tmp;
|
addrencode=addrencode | tmp;
|
pow=pow * k;
|
pow=pow * k;
|
end
|
end
|
end
|
end
|
endfunction
|
endfunction
|
|
|
|
|
genvar i;
|
genvar i;
|
wire [NE-1 : 0] valid_dst;
|
wire [NE-1 : 0] valid_dst;
|
|
|
generate
|
generate
|
for(i=0; i< NE; i=i+1) begin : endpoints
|
for(i=0; i< NE; i=i+1) begin : endpoints
|
|
|
wire [EAw-1 : 0] current_e_addr [NE-1 : 0];
|
wire [EAw-1 : 0] current_e_addr [NE-1 : 0];
|
|
|
endp_addr_encoder #(
|
endp_addr_encoder #(
|
.TOPOLOGY(TOPOLOGY),
|
.TOPOLOGY(TOPOLOGY),
|
.T1(T1),
|
.T1(T1),
|
.T2(T2),
|
.T2(T2),
|
.T3(T3),
|
.T3(T3),
|
.EAw(EAw),
|
.EAw(EAw),
|
.NE(NE)
|
.NE(NE)
|
)
|
)
|
encoder
|
encoder
|
(
|
(
|
.id(i[NEw-1 : 0]),
|
.id(i[NEw-1 : 0]),
|
.code(current_e_addr[i])
|
.code(current_e_addr[i])
|
);
|
);
|
|
|
|
|
|
|
|
|
traffic_gen_top #(
|
traffic_gen_top #(
|
.MAX_RATIO(100)
|
.MAX_RATIO(100),
|
|
.ENDP_ID(i)
|
)
|
)
|
the_traffic_gen
|
the_traffic_gen
|
(
|
(
|
.ratio (ratio),
|
.ratio (ratio),
|
.pck_size_in(pck_size_in[i]),
|
.pck_size_in(pck_size_in[i]),
|
.current_e_addr(current_e_addr[i]),
|
.current_e_addr(current_e_addr[i]),
|
.dest_e_addr(dest_e_addr[i]),
|
.dest_e_addr(dest_e_addr[i]),
|
.pck_class_in(pck_class_in[i]),
|
.pck_class_in(pck_class_in[i]),
|
.init_weight({{(WEIGHTw-1){1'b0}},1'b1}),
|
.init_weight({{(WEIGHTw-1){1'b0}},1'b1}),
|
.hdr_flit_sent(hdr_flit_sent[i]),
|
.hdr_flit_sent(hdr_flit_sent[i]),
|
.pck_number(pck_counter[i]),
|
.pck_number(pck_counter[i]),
|
.reset(reset),
|
.reset(reset),
|
.clk(clk),
|
.clk(clk),
|
.start(start),
|
.start(start),
|
.stop(stop | ~valid_dst[i]),
|
.stop(stop | ~valid_dst[i]),
|
.sent_done(),
|
.sent_done(),
|
.update(update[i]),
|
.update(update[i]),
|
.time_stamp_h2h(time_stamp_h2h[i]),
|
.time_stamp_h2h(time_stamp_h2h[i]),
|
.time_stamp_h2t(time_stamp_h2t[i]),
|
.time_stamp_h2t(time_stamp_h2t[i]),
|
.distance(distance[i]),
|
.distance(distance[i]),
|
.src_e_addr(src_e_addr[i] ),
|
.src_e_addr(src_e_addr[i] ),
|
.pck_class_out(pck_class_out[i]),
|
.pck_class_out(pck_class_out[i]),
|
.report (1'b0),
|
.report (1'b0),
|
.pck_size_o(pck_size_o[i]),
|
.pck_size_o(pck_size_o[i]),
|
.chan_in(chan_out_all[i]),
|
.chan_in(chan_out_all[i]),
|
.chan_out(chan_in_all[i]),
|
.chan_out(chan_in_all[i]),
|
.start_delay(start_delay[i]),
|
.start_delay(start_delay[i]),
|
.flit_out_class(flit_out_class[i]),
|
.flit_out_class(flit_out_class[i]),
|
.flit_out_wr(),
|
.flit_out_wr(),
|
.flit_in_wr()
|
.flit_in_wr(),
|
|
.mcast_dst_num_o(mcast_dst_num[i])
|
|
|
);
|
);
|
|
|
endp_addr_decoder #(
|
endp_addr_decoder #(
|
.TOPOLOGY(TOPOLOGY),
|
.TOPOLOGY(TOPOLOGY),
|
.T1(T1),
|
.T1(T1),
|
.T2(T2),
|
.T2(T2),
|
.T3(T3),
|
.T3(T3),
|
.EAw(EAw),
|
.EAw(EAw),
|
.NE(NE)
|
.NE(NE)
|
)
|
)
|
decoder
|
decoder
|
(
|
(
|
.id(src_id[i]),
|
.id(src_id[i]),
|
.code(src_e_addr[i])
|
.code(src_e_addr[i])
|
);
|
);
|
|
|
|
|
pck_class_in_gen #(
|
pck_class_in_gen #(
|
.C(C),
|
.C(C),
|
.C0_p(C0_p),
|
.C0_p(C0_p),
|
.C1_p(C1_p),
|
.C1_p(C1_p),
|
.C2_p(C2_p),
|
.C2_p(C2_p),
|
.C3_p(C3_p)
|
.C3_p(C3_p)
|
)
|
)
|
the_pck_class_in_gen
|
the_pck_class_in_gen
|
(
|
(
|
.en(hdr_flit_sent[i]),
|
.en(hdr_flit_sent[i]),
|
.pck_class_o(pck_class_in[i]),
|
.pck_class_o(pck_class_in[i]),
|
.reset(reset),
|
.reset(reset),
|
.clk(clk)
|
.clk(clk)
|
);
|
);
|
|
|
|
|
|
|
|
|
pck_dst_gen #(
|
pck_dst_gen #(
|
.NE(NE),
|
.NE(NE),
|
.MAX_PCK_NUM(MAX_PCK_NUM),
|
.MAX_PCK_NUM(MAX_PCK_NUM),
|
.TRAFFIC(TRAFFIC),
|
.TRAFFIC(TRAFFIC),
|
.HOTSPOT_NODE_NUM(HOTSPOT_NODE_NUM)
|
.HOTSPOT_NODE_NUM(HOTSPOT_NODE_NUM),
|
|
.MCAST_TRAFFIC_RATIO(MCAST_TRAFFIC_RATIO),
|
|
.MCAST_PCK_SIZ_MIN(MCAST_PCK_SIZ_MIN),
|
|
.MCAST_PCK_SIZ_MAX(MCAST_PCK_SIZ_MAX),
|
|
.PCK_SIZw(PCK_SIZw),
|
|
.MIN_PACKET_SIZE(MIN_PACKET_SIZE),
|
|
.MAX_PACKET_SIZE(MAX_PACKET_SIZE),
|
|
.PCK_SIZ_SEL(PCK_SIZ_SEL),
|
|
.DISCRETE_PCK_SIZ_NUM(DISCRETE_PCK_SIZ_NUM)
|
)
|
)
|
the_pck_dst_gen
|
the_pck_dst_gen
|
(
|
(
|
.reset(reset),
|
.reset(reset),
|
.clk(clk),
|
.clk(clk),
|
.en(hdr_flit_sent[i]),
|
.en(hdr_flit_sent[i]),
|
.core_num(i[NEw-1 : 0]),
|
.core_num(i[NEw-1 : 0]),
|
.pck_number(pck_counter[i]),
|
.pck_number(pck_counter[i]),
|
.current_e_addr(current_e_addr[i]),
|
.current_e_addr(current_e_addr[i]),
|
.dest_e_addr(dest_e_addr[i]),
|
.dest_e_addr(dest_e_addr[i]),
|
.valid_dst(valid_dst[i]),
|
.valid_dst(valid_dst[i]),
|
.hotspot_info(hotspot_info),
|
.hotspot_info(hotspot_info),
|
|
.pck_size_o( pck_size_in[i]) ,
|
|
.rnd_discrete(rnd_discrete),
|
.custom_traffic_t(custom_traffic_t[i]), // defined in sim_param.sv
|
.custom_traffic_t(custom_traffic_t[i]), // defined in sim_param.sv
|
.custom_traffic_en(custom_traffic_en[i]) // defined in sim_param.sv
|
.custom_traffic_en(custom_traffic_en[i]) // defined in sim_param.sv
|
);
|
);
|
|
|
pck_size_gen #(
|
|
.PCK_SIZw(PCK_SIZw),
|
|
.MIN(MIN_PACKET_SIZE),
|
|
.MAX(MAX_PACKET_SIZE),
|
|
.PCK_SIZ_SEL(PCK_SIZ_SEL),
|
|
.DISCRETE_PCK_SIZ_NUM(DISCRETE_PCK_SIZ_NUM)
|
|
)
|
|
the_pck_siz_gen
|
|
(
|
|
.reset(reset),
|
|
.clk(clk),
|
|
.en(hdr_flit_sent[i]),
|
|
.pck_size( pck_size_in[i]) ,
|
|
.rnd_discrete(rnd_discrete)
|
|
);
|
|
|
|
end
|
end
|
endgenerate
|
endgenerate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
real sum_clk_h2h,sum_clk_h2t;
|
real sum_clk_h2h,sum_clk_h2t;
|
real sum_clk_pow2;
|
real sum_clk_pow2;
|
real sum_clk_pow2_per_class [C-1 : 0];
|
real sum_clk_pow2_per_class [C-1 : 0];
|
real sum_clk_per_hop;
|
real sum_clk_per_hop;
|
integer total_rsv_pck_num_per_class [C-1 : 0];
|
integer total_rsv_pck_num_per_class [C-1 : 0];
|
real sum_clk_h2h_per_class [C-1 : 0];
|
real sum_clk_h2h_per_class [C-1 : 0];
|
real sum_clk_h2t_per_class [C-1 : 0];
|
real sum_clk_h2t_per_class [C-1 : 0];
|
real sum_clk_per_hop_per_class [C-1 : 0];
|
real sum_clk_per_hop_per_class [C-1 : 0];
|
integer rsvd_core_total_rsv_pck_num [NE-1 : 0];
|
integer rsvd_core_total_rsv_pck_num [NE-1 : 0];
|
integer rsvd_core_worst_delay [NE-1 : 0];
|
integer rsvd_core_worst_delay [NE-1 : 0];
|
integer sent_core_worst_delay [NE-1 : 0];
|
integer sent_core_worst_delay [NE-1 : 0];
|
integer total_active_endp;
|
integer total_active_endp;
|
integer total_rsv_pck_num,total_rsv_flit_number;
|
integer total_rsv_pck_num,total_rsv_flit_number;
|
integer total_sent_pck_num,total_sent_flit_number;
|
integer total_sent_pck_num,total_sent_flit_number,total_expect_rsv_flit_num;
|
|
|
integer core_num,k;
|
integer core_num,k;
|
always @(posedge clk or posedge reset)begin
|
always @(posedge clk or posedge reset)begin
|
if (reset) begin
|
if (reset) begin
|
total_rsv_pck_num=0;
|
total_rsv_pck_num=0;
|
total_sent_pck_num=0;
|
total_sent_pck_num=0;
|
sum_clk_h2h=0;
|
sum_clk_h2h=0;
|
sum_clk_h2t=0;
|
sum_clk_h2t=0;
|
sum_clk_pow2=0;
|
sum_clk_pow2=0;
|
sum_clk_per_hop=0;
|
sum_clk_per_hop=0;
|
total_sent_flit_number=0;
|
total_sent_flit_number=0;
|
total_rsv_flit_number=0;
|
total_rsv_flit_number=0;
|
|
total_expect_rsv_flit_num=0;
|
for (k=0;k
|
for (k=0;k
|
sum_clk_pow2_per_class[k]=0;
|
sum_clk_pow2_per_class[k]=0;
|
total_rsv_pck_num_per_class[k]=0;
|
total_rsv_pck_num_per_class[k]=0;
|
sum_clk_h2h_per_class [k]=0;
|
sum_clk_h2h_per_class [k]=0;
|
sum_clk_h2t_per_class [k]=0;
|
sum_clk_h2t_per_class [k]=0;
|
sum_clk_per_hop_per_class[k]=0;
|
sum_clk_per_hop_per_class[k]=0;
|
end
|
end
|
for (k=0;k
|
for (k=0;k
|
rsvd_core_total_rsv_pck_num[k]=0;
|
rsvd_core_total_rsv_pck_num[k]=0;
|
rsvd_core_worst_delay[k]=0;
|
rsvd_core_worst_delay[k]=0;
|
sent_core_worst_delay[k]=0;
|
sent_core_worst_delay[k]=0;
|
end
|
end
|
for (k=0; k<= MAX_PACKET_SIZE - MIN_PACKET_SIZE; k++) rsv_size_array[k]=0;
|
for (k=0; k<= MAX_PACKET_SIZE - MIN_PACKET_SIZE; k++) rsv_size_array[k]=0;
|
|
|
end
|
end
|
|
|
|
|
for (core_num=0; core_num
|
for (core_num=0; core_num
|
if(chan_in_all[core_num].flit_chanel.flit_wr)begin
|
if(chan_in_all[core_num].flit_chanel.flit_wr)begin
|
total_sent_flit_number+=1;
|
total_sent_flit_number+=1;
|
|
if (CAST_TYPE != "UNICAST") total_expect_rsv_flit_num+=mcast_dst_num[core_num];
|
|
else total_expect_rsv_flit_num++;
|
|
|
|
|
if (C>1) sent_stat [core_num][flit_out_class[core_num]].flit_num++;
|
if (C>1) sent_stat [core_num][flit_out_class[core_num]].flit_num++;
|
else sent_stat [core_num][0].flit_num++;
|
else sent_stat [core_num][0].flit_num++;
|
if(chan_in_all[core_num].flit_chanel.flit[Fw-1])begin
|
if(chan_in_all[core_num].flit_chanel.flit[Fw-1])begin
|
total_sent_pck_num+=1;
|
total_sent_pck_num+=1;
|
if (C>1) sent_stat [core_num][flit_out_class[core_num]].pck_num++;
|
if (C>1) sent_stat [core_num][flit_out_class[core_num]].pck_num++;
|
else sent_stat [core_num][0].pck_num++;
|
else sent_stat [core_num][0].pck_num++;
|
|
|
end
|
end
|
end
|
end
|
|
|
if(chan_out_all[core_num].flit_chanel.flit_wr)begin
|
if(chan_out_all[core_num].flit_chanel.flit_wr)begin
|
total_rsv_flit_number+=1;
|
total_rsv_flit_number+=1;
|
if (C>1) rsvd_stat [core_num][pck_class_out[core_num]].flit_num++;
|
if (C>1) rsvd_stat [core_num][pck_class_out[core_num]].flit_num++;
|
else rsvd_stat [core_num][0].flit_num++;
|
else rsvd_stat [core_num][0].flit_num++;
|
end
|
end
|
|
|
|
|
if( update [core_num] ) begin
|
if( update [core_num] ) begin
|
total_rsv_pck_num = total_rsv_pck_num+1;
|
total_rsv_pck_num = total_rsv_pck_num+1;
|
|
|
if (AVG_LATENCY_METRIC == "HEAD_2_TAIL")
|
if (AVG_LATENCY_METRIC == "HEAD_2_TAIL")
|
update_statistic (
|
update_statistic (
|
core_num,
|
core_num,
|
pck_class_out[core_num],
|
pck_class_out[core_num],
|
$itor(time_stamp_h2h[core_num]),
|
$itor(time_stamp_h2h[core_num]),
|
$itor(time_stamp_h2t[core_num]),
|
$itor(time_stamp_h2t[core_num]),
|
src_id[core_num],
|
src_id[core_num],
|
time_stamp_h2t[core_num],
|
time_stamp_h2t[core_num],
|
distance[core_num]
|
distance[core_num]
|
);
|
);
|
else
|
else
|
update_statistic (
|
update_statistic (
|
core_num,
|
core_num,
|
pck_class_out[core_num],
|
pck_class_out[core_num],
|
$itor(time_stamp_h2h[core_num]),
|
$itor(time_stamp_h2h[core_num]),
|
$itor(time_stamp_h2t[core_num]),
|
$itor(time_stamp_h2t[core_num]),
|
src_id[core_num],
|
src_id[core_num],
|
time_stamp_h2h[core_num],
|
time_stamp_h2h[core_num],
|
distance[core_num]
|
distance[core_num]
|
);
|
);
|
|
|
|
|
if((total_rsv_pck_num & 'hffff )==0 ) $display(" packet received total=%0d",total_rsv_pck_num);
|
if((total_rsv_pck_num & 'hffff )==0 ) $display(" packet received total=%0d",total_rsv_pck_num);
|
sum_clk_h2h += time_stamp_h2h[core_num];
|
sum_clk_h2h += time_stamp_h2h[core_num];
|
sum_clk_h2t += time_stamp_h2t[core_num];
|
sum_clk_h2t += time_stamp_h2t[core_num];
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
sum_clk_pow2+=time_stamp_h2h[core_num] * time_stamp_h2h[core_num];
|
sum_clk_pow2+=time_stamp_h2h[core_num] * time_stamp_h2h[core_num];
|
sum_clk_pow2_per_class[pck_class_out[core_num]]+=time_stamp_h2h[core_num] * time_stamp_h2h[core_num];
|
sum_clk_pow2_per_class[pck_class_out[core_num]]+=time_stamp_h2h[core_num] * time_stamp_h2h[core_num];
|
`endif
|
`endif
|
sum_clk_per_hop+= $itor(time_stamp_h2h[core_num])/$itor(distance[core_num]);
|
if(distance[core_num] > 0) sum_clk_per_hop+= $itor(time_stamp_h2h[core_num])/$itor(distance[core_num]);
|
total_rsv_pck_num_per_class[pck_class_out[core_num]]+=1;
|
total_rsv_pck_num_per_class[pck_class_out[core_num]]+=1;
|
sum_clk_h2h_per_class[pck_class_out[core_num]]+=time_stamp_h2h[core_num] ;
|
sum_clk_h2h_per_class[pck_class_out[core_num]]+=time_stamp_h2h[core_num] ;
|
sum_clk_h2t_per_class[pck_class_out[core_num]]+=time_stamp_h2t[core_num] ;
|
sum_clk_h2t_per_class[pck_class_out[core_num]]+=time_stamp_h2t[core_num] ;
|
sum_clk_per_hop_per_class[pck_class_out[core_num]]+= $itor(time_stamp_h2h[core_num])/$itor(distance[core_num]);
|
if(distance[core_num]>0) sum_clk_per_hop_per_class[pck_class_out[core_num]]+= $itor(time_stamp_h2h[core_num])/$itor(distance[core_num]);
|
rsvd_core_total_rsv_pck_num[core_num]+=1;
|
rsvd_core_total_rsv_pck_num[core_num]+=1;
|
if (rsvd_core_worst_delay[core_num] < time_stamp_h2t[core_num]) rsvd_core_worst_delay[core_num] = ( AVG_LATENCY_METRIC == "HEAD_2_TAIL")? time_stamp_h2t[core_num] : time_stamp_h2h[core_num];
|
if (rsvd_core_worst_delay[core_num] < time_stamp_h2t[core_num]) rsvd_core_worst_delay[core_num] = ( AVG_LATENCY_METRIC == "HEAD_2_TAIL")? time_stamp_h2t[core_num] : time_stamp_h2h[core_num];
|
if (sent_core_worst_delay[src_id[core_num]] < time_stamp_h2t[core_num]) sent_core_worst_delay[src_id[core_num]] = (AVG_LATENCY_METRIC == "HEAD_2_TAIL")? time_stamp_h2t[core_num] : time_stamp_h2h[core_num];
|
if (sent_core_worst_delay[src_id[core_num]] < time_stamp_h2t[core_num]) sent_core_worst_delay[src_id[core_num]] = (AVG_LATENCY_METRIC == "HEAD_2_TAIL")? time_stamp_h2t[core_num] : time_stamp_h2h[core_num];
|
if (pck_size_o[core_num] >= MIN_PACKET_SIZE && pck_size_o[core_num] <=MAX_PACKET_SIZE) rsv_size_array[pck_size_o[core_num]-MIN_PACKET_SIZE] = rsv_size_array[pck_size_o[core_num]-MIN_PACKET_SIZE]+1;
|
if (pck_size_o[core_num] >= MIN_PACKET_SIZE && pck_size_o[core_num] <=MAX_PACKET_SIZE) rsv_size_array[pck_size_o[core_num]-MIN_PACKET_SIZE] = rsv_size_array[pck_size_o[core_num]-MIN_PACKET_SIZE]+1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end
|
end
|
end
|
end
|
end//always
|
end//always
|
|
|
|
|
|
|
|
|
|
|
|
|
integer rsv_ideal_cnt,total_rsv_flit_number_old;
|
integer rsv_ideal_cnt,total_rsv_flit_number_old;
|
reg all_done_reg;
|
reg all_done_reg;
|
wire all_done_in;
|
wire all_done_in;
|
assign all_done_in = (clk_counter > STOP_SIM_CLK) || ( total_sent_pck_num > STOP_PCK_NUM );
|
assign all_done_in = (clk_counter > STOP_SIM_CLK) || ( total_sent_pck_num > STOP_PCK_NUM );
|
assign sent_done = all_done_in & ~ all_done_reg;
|
assign sent_done = all_done_in & ~ all_done_reg;
|
always @(posedge clk or posedge reset)begin
|
always @(posedge clk or posedge reset)begin
|
if(reset) begin
|
if(reset) begin
|
all_done_reg <= 1'b0;
|
all_done_reg <= 1'b0;
|
rsv_ideal_cnt<=0;
|
rsv_ideal_cnt<=0;
|
done<=1'b0;
|
done<=1'b0;
|
total_rsv_flit_number_old<=0;
|
total_rsv_flit_number_old<=0;
|
end else begin
|
end else begin
|
all_done_reg <= all_done_in;
|
all_done_reg <= all_done_in;
|
total_rsv_flit_number_old<=total_rsv_flit_number;
|
total_rsv_flit_number_old<=total_rsv_flit_number;
|
if(all_done_in) begin //All injectors stopped injecting packets
|
if(all_done_in) begin //All injectors stopped injecting packets
|
if(total_rsv_flit_number_old==total_rsv_flit_number) rsv_ideal_cnt<=rsv_ideal_cnt+1;//count the number of cycle when no flit is received by any injector
|
if(total_rsv_flit_number_old==total_rsv_flit_number) rsv_ideal_cnt<=rsv_ideal_cnt+1;//count the number of cycle when no flit is received by any injector
|
else rsv_ideal_cnt=0;
|
else rsv_ideal_cnt=0;
|
if(total_sent_flit_number == total_rsv_flit_number) begin // All injected packets are consumed
|
if(total_expect_rsv_flit_num == total_rsv_flit_number) begin // All injected packets are consumed
|
done<=1'b1;
|
done<=1'b1;
|
end
|
end
|
if(rsv_ideal_cnt >= 100) begin // Injectors stopped sending packets, number of received and sent flits are not equal yet and for 100 cycles no flit is consumed.
|
if(rsv_ideal_cnt >= 100) begin // Injectors stopped sending packets, number of received and sent flits are not equal yet and for 100 cycles no flit is consumed.
|
$display ("ERROR: The number of sent (%d) & received flits (%d) were not equal at the end of simulation",total_sent_flit_number ,total_rsv_flit_number);
|
done<=1'b1;
|
|
#100 $display ("ERROR: The number of expected (%d) & received flits (%d) were not equal at the end of simulation",total_expect_rsv_flit_num ,total_rsv_flit_number);
|
|
|
$stop;
|
$stop;
|
end
|
end
|
end
|
end
|
end
|
end
|
end
|
end
|
|
|
initial total_active_endp=0;
|
initial total_active_endp=0;
|
|
|
|
|
real avg_throughput,avg_latency_flit,avg_latency_pck,std_dev,avg_latency_per_hop,min_avg_latency_per_class;
|
real avg_throughput,avg_latency_flit,avg_latency_pck,std_dev,avg_latency_per_hop,min_avg_latency_per_class;
|
|
|
|
|
initial begin
|
initial begin
|
for(m=0;m
|
for(m=0;m
|
end
|
end
|
|
|
|
|
|
initial print_router_st=1'b0;
|
|
|
//report
|
//report
|
always @( posedge done) begin
|
always @( posedge done) begin
|
|
|
|
|
for (core_num=0; core_num
|
for (core_num=0; core_num
|
if(pck_counter[core_num]>0) total_active_endp = total_active_endp +1;
|
if(pck_counter[core_num]>0) total_active_endp = total_active_endp +1;
|
end
|
end
|
|
|
avg_throughput= ((total_sent_flit_number*100)/total_active_endp )/clk_counter;
|
avg_throughput= ((total_sent_flit_number*100)/total_active_endp )/clk_counter;
|
avg_latency_flit =sum_clk_h2h/$itor(total_rsv_pck_num);
|
avg_latency_flit =sum_clk_h2h/$itor(total_rsv_pck_num);
|
avg_latency_pck =sum_clk_h2t/$itor(total_rsv_pck_num);
|
avg_latency_pck =sum_clk_h2t/$itor(total_rsv_pck_num);
|
avg_latency_per_hop = sum_clk_per_hop/$itor(total_rsv_pck_num);
|
avg_latency_per_hop = sum_clk_per_hop/$itor(total_rsv_pck_num);
|
$display("simulation results-------------------");
|
$display("simulation results-------------------");
|
$display("\tSimulation clock cycles:%0d",clk_counter);
|
$display("\tSimulation clock cycles:%0d",clk_counter);
|
|
|
|
print_router_st=1'b1;
|
|
#1
|
|
|
/*
|
/*
|
$display(" total sent/received packets:%d/%d",total_sent_pck_num,total_rsv_pck_num);
|
$display(" total sent/received packets:%d/%d",total_sent_pck_num,total_rsv_pck_num);
|
$display(" total sent/received flits:%d/%d",total_sent_flit_number,total_rsv_flit_number);
|
$display(" total sent/received flits:%d/%d",total_sent_flit_number,total_rsv_flit_number);
|
$display(" Total active Endpoint: %d \n",total_active_endp);
|
$display(" Total active Endpoint: %d \n",total_active_endp);
|
$display(" Avg throughput is: %f (flits/clk/Total active Endpoint %%)", avg_throughput);
|
$display(" Avg throughput is: %f (flits/clk/Total active Endpoint %%)", avg_throughput);
|
|
|
|
|
|
|
$display("\nall : ");
|
$display("\nall : ");
|
$display(" Total number of packet = %d \n average latency per hop = %f ",total_rsv_pck_num,avg_latency_per_hop);
|
$display(" Total number of packet = %d \n average latency per hop = %f ",total_rsv_pck_num,avg_latency_per_hop);
|
$display(" average packet latency = %f \n average flit latency = %f ",avg_latency_pck, avg_latency_flit);
|
$display(" average packet latency = %f \n average flit latency = %f ",avg_latency_pck, avg_latency_flit);
|
*/
|
*/
|
$display("\n\tTotal injected packet in different size:");
|
$display("\n\tTotal injected packet in different size:");
|
for (m=0;m<=(MAX_PACKET_SIZE - MIN_PACKET_SIZE);m++) begin
|
|
$write("\tflit_size,");
|
$write("\tflit_size,");
|
|
for (m=0;m<=(MAX_PACKET_SIZE - MIN_PACKET_SIZE);m++) begin
|
if(rsv_size_array[m]>0)$write("%0d,",m+ MIN_PACKET_SIZE);
|
if(rsv_size_array[m]>0)$write("%0d,",m+ MIN_PACKET_SIZE);
|
end
|
end
|
for (m=0;m<=(MAX_PACKET_SIZE - MIN_PACKET_SIZE);m++) begin
|
|
$write("\n\t#pck,");
|
$write("\n\t#pck,");
|
|
for (m=0;m<=(MAX_PACKET_SIZE - MIN_PACKET_SIZE);m++) begin
|
if(rsv_size_array[m]>0)$write("%0d,",rsv_size_array[m]);
|
if(rsv_size_array[m]>0)$write("%0d,",rsv_size_array[m]);
|
end
|
end
|
|
|
// if(ratio==RATIO_INIT) first_avg_latency_flit=avg_latency_flit;
|
// if(ratio==RATIO_INIT) first_avg_latency_flit=avg_latency_flit;
|
//`ifdef STND_DEV_EN
|
//`ifdef STND_DEV_EN
|
//std_dev= standard_dev( sum_clk_pow2,total_rsv_pck_num, avg_latency_flit);
|
//std_dev= standard_dev( sum_clk_pow2,total_rsv_pck_num, avg_latency_flit);
|
//$display(" standard_dev = %f",std_dev);
|
//$display(" standard_dev = %f",std_dev);
|
//`endif
|
//`endif
|
|
$display("\n\n\tEndpoints' statistics");
|
$write("\n\n\t#node,sent_stat.pck_num,rsvd_stat.pck_num,sent_stat.flit_num,rsvd_stat.flit_num,sent_stat.worst_latency,rsvd_stat.worst_latency,sent_stat.min_latency,rsvd_stat.min_latency,avg_latency_per_hop,avg_latency_flit,avg_latency_pck,avg_throughput(%%),avg_pck_size,");
|
$write("\t#node,sent_stat.pck_num,rsvd_stat.pck_num,sent_stat.flit_num,rsvd_stat.flit_num,sent_stat.worst_latency,rsvd_stat.worst_latency,sent_stat.min_latency,rsvd_stat.min_latency,avg_latency_per_hop,avg_latency_flit,avg_latency_pck,avg_throughput(%%),avg_pck_size,");
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
$write("avg.std_dev");
|
$write("avg.std_dev");
|
`endif
|
`endif
|
$write("\n");
|
$write("\n");
|
|
|
|
|
|
|
|
|
|
|
for (m=0; m
|
for (m=0; m
|
for (c=0; c
|
for (c=0; c
|
merge_statistic (rsvd_stat_class[m],rsvd_stat[m][c],rsvd_stat_class[m]);
|
merge_statistic (rsvd_stat_class[m],rsvd_stat[m][c],rsvd_stat_class[m]);
|
merge_statistic (sent_stat_class[m],sent_stat[m][c],sent_stat_class[m]);
|
merge_statistic (sent_stat_class[m],sent_stat[m][c],sent_stat_class[m]);
|
if(C>1) begin
|
if(C>1) begin
|
merge_statistic (rsvd_stat_per_class[c],rsvd_stat[m][c],rsvd_stat_per_class[c]);
|
merge_statistic (rsvd_stat_per_class[c],rsvd_stat[m][c],rsvd_stat_per_class[c]);
|
merge_statistic (sent_stat_per_class[c],sent_stat[m][c],sent_stat_per_class[c]);
|
merge_statistic (sent_stat_per_class[c],sent_stat[m][c],sent_stat_per_class[c]);
|
end
|
end
|
end
|
end
|
end
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (m=0; m
|
for (m=0; m
|
|
|
merge_statistic (rsvd_stat_total,rsvd_stat_class[m],rsvd_stat_total);
|
merge_statistic (rsvd_stat_total,rsvd_stat_class[m],rsvd_stat_total);
|
merge_statistic (sent_stat_total,sent_stat_class[m],sent_stat_total);
|
merge_statistic (sent_stat_total,sent_stat_class[m],sent_stat_total);
|
|
|
end
|
end
|
|
|
$write("\ttotal,");
|
$write("\ttotal,");
|
print_st_single (clk_counter, rsvd_stat_total,sent_stat_total);
|
print_st_single (clk_counter, rsvd_stat_total,sent_stat_total);
|
|
|
if(C>1)begin
|
if(C>1)begin
|
for (c=0; c
|
for (c=0; c
|
$write("\ttotal_class%0d,",c);
|
$write("\ttotal_class%0d,",c);
|
print_st_single (clk_counter, rsvd_stat_per_class[c],sent_stat_per_class[c]);
|
print_st_single (clk_counter, rsvd_stat_per_class[c],sent_stat_per_class[c]);
|
end
|
end
|
end
|
end
|
|
|
for (m=0; m
|
for (m=0; m
|
$write("\t%0d,",m);
|
$write("\t%0d,",m);
|
if(C>1) begin
|
if(C>1) begin
|
print_st_single (clk_counter, rsvd_stat_class[m],sent_stat_class[m] );
|
print_st_single (clk_counter, rsvd_stat_class[m],sent_stat_class[m] );
|
end else begin
|
end else begin
|
print_st_single (clk_counter, rsvd_stat[m][0],sent_stat[m][0] );
|
print_st_single (clk_counter, rsvd_stat[m][0],sent_stat[m][0] );
|
end
|
end
|
end
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
/*
|
min_avg_latency_per_class=1000000;
|
min_avg_latency_per_class=1000000;
|
for(m=0;m
|
for(m=0;m
|
avg_throughput = (total_rsv_pck_num_per_class[m]>0)? ((total_rsv_pck_num_per_class[m]*AVG_PCK_SIZ*100)/total_active_endp )/clk_counter:0;
|
avg_throughput = (total_rsv_pck_num_per_class[m]>0)? ((total_rsv_pck_num_per_class[m]*AVG_PCK_SIZ*100)/total_active_endp )/clk_counter:0;
|
avg_latency_flit = (total_rsv_pck_num_per_class[m]>0)? sum_clk_h2h_per_class[m]/total_rsv_pck_num_per_class[m]:0;
|
avg_latency_flit = (total_rsv_pck_num_per_class[m]>0)? sum_clk_h2h_per_class[m]/total_rsv_pck_num_per_class[m]:0;
|
avg_latency_pck = (total_rsv_pck_num_per_class[m]>0)? sum_clk_h2t_per_class[m]/total_rsv_pck_num_per_class[m]:0;
|
avg_latency_pck = (total_rsv_pck_num_per_class[m]>0)? sum_clk_h2t_per_class[m]/total_rsv_pck_num_per_class[m]:0;
|
avg_latency_per_hop = (total_rsv_pck_num_per_class[m]>0)? sum_clk_per_hop_per_class[m]/total_rsv_pck_num_per_class[m]:0;
|
avg_latency_per_hop = (total_rsv_pck_num_per_class[m]>0)? sum_clk_per_hop_per_class[m]/total_rsv_pck_num_per_class[m]:0;
|
if(AVG_LATENCY_METRIC == "HEAD_2_TAIL") begin
|
if(AVG_LATENCY_METRIC == "HEAD_2_TAIL") begin
|
$display ("\nclass : %d ",m);
|
$display ("\nclass : %d ",m);
|
$display (" Total number of packet = %d \n avg_throughput = %f \n average latency per hop = %f \n average latency = %f",total_rsv_pck_num_per_class[m],avg_throughput,avg_latency_per_hop,avg_latency_pck);
|
$display (" Total number of packet = %d \n avg_throughput = %f \n average latency per hop = %f \n average latency = %f",total_rsv_pck_num_per_class[m],avg_throughput,avg_latency_per_hop,avg_latency_pck);
|
|
|
end else begin
|
end else begin
|
|
|
$display ("\nclass : %d ",m);
|
$display ("\nclass : %d ",m);
|
$display (" Total number of packet = %d \n avg_throughput = %f \n average latency per hop = %f \n average latency = %f",total_rsv_pck_num_per_class[m],avg_throughput,avg_latency_per_hop,avg_latency_flit);
|
$display (" Total number of packet = %d \n avg_throughput = %f \n average latency per hop = %f \n average latency = %f",total_rsv_pck_num_per_class[m],avg_throughput,avg_latency_per_hop,avg_latency_flit);
|
end
|
end
|
if(min_avg_latency_per_class > avg_latency_flit) min_avg_latency_per_class=avg_latency_flit;
|
if(min_avg_latency_per_class > avg_latency_flit) min_avg_latency_per_class=avg_latency_flit;
|
|
|
//#if (STND_DEV_EN)
|
//#if (STND_DEV_EN)
|
//std_dev= (total_rsv_pck_num_per_class[i]>0)? standard_dev( sum_clk_pow2_per_class[i],total_rsv_pck_num_per_class[i], avg_latency_flit):0;
|
//std_dev= (total_rsv_pck_num_per_class[i]>0)? standard_dev( sum_clk_pow2_per_class[i],total_rsv_pck_num_per_class[i], avg_latency_flit):0;
|
// sprintf(file_name,"%s_std%u.txt",out_file_name,i);
|
// sprintf(file_name,"%s_std%u.txt",out_file_name,i);
|
// update_file( file_name,avg_throughput,std_dev);
|
// update_file( file_name,avg_throughput,std_dev);
|
|
|
//#endif
|
//#endif
|
end//for
|
end//for
|
|
|
|
|
|
|
for (m=0;m
|
for (m=0;m
|
$display ("\n\nEndpoint %d",m);
|
$display ("\n\nEndpoint %d",m);
|
$display ("\n\ttotal number of received packets: %d",rsvd_core_total_rsv_pck_num[m]);
|
$display ("\n\ttotal number of received packets: %d",rsvd_core_total_rsv_pck_num[m]);
|
$display ("\n\tworst-case-delay of received packets (clks): %d",rsvd_core_worst_delay[m] );
|
$display ("\n\tworst-case-delay of received packets (clks): %d",rsvd_core_worst_delay[m] );
|
$display ("\n\ttotal number of sent packets: %d",pck_counter[m]);
|
$display ("\n\ttotal number of sent packets: %d",pck_counter[m]);
|
$display ("\n\tworst-case-delay of sent packets (clks): %d",sent_core_worst_delay[m] );
|
$display ("\n\tworst-case-delay of sent packets (clks): %d",sent_core_worst_delay[m] );
|
end
|
end
|
|
|
*/
|
*/
|
|
|
end
|
end
|
|
|
|
|
|
|
|
|
|
|
initial begin
|
initial begin
|
|
display_noc_parameters();
|
//print_parameter
|
|
$display ("NoC parameters:----------------");
|
|
$display ("\tTopology: %s",TOPOLOGY);
|
|
$display ("\tRouting algorithm: %s",ROUTE_NAME);
|
|
$display ("\tVC_per port: %0d", V);
|
|
$display ("\tNon-local port buffer_width per VC: %0d", B);
|
|
$display ("\tLocal port buffer_width per VC: %0d", LB);
|
|
if(TOPOLOGY=="MESH" || TOPOLOGY=="TORUS")begin
|
|
$display ("\tRouter num in row: %0d",T1);
|
|
$display ("\tRouter num in column: %0d",T2);
|
|
$display ("\tEndpoint num per router: %0d",T3);
|
|
end else if (TOPOLOGY=="RING" || TOPOLOGY == "LINE") begin
|
|
$display ("\tTotal Router num: %0d",T1);
|
|
$display ("\tEndpoint num per router: %0d",T3);
|
|
end else if (TOPOLOGY == "TREE" || TOPOLOGY == "FATTREE")begin
|
|
$display ("\tK: %0d",T1);
|
|
$display ("\tL: %0d",T2);
|
|
end else begin //CUSTOM
|
|
$display ("\tTotal Endpoints number: %0d",T1);
|
|
$display ("\tTotal Routers number: %0d",T2);
|
|
end
|
|
$display ("\tNumber of Class: %0d", C);
|
|
$display ("\tFlit data width: %0d", Fpay);
|
|
$display ("\tVC reallocation mechanism: %s", VC_REALLOCATION_TYPE);
|
|
$display ("\tVC/sw combination mechanism: %s", COMBINATION_TYPE);
|
|
$display ("\tAVC_ATOMIC_EN:%0d", AVC_ATOMIC_EN);
|
|
$display ("\tCongestion Index:%0d",CONGESTION_INDEX);
|
|
$display ("\tADD_PIPREG_AFTER_CROSSBAR:%0d",ADD_PIPREG_AFTER_CROSSBAR);
|
|
$display ("\tSSA_EN enabled:%s",SSA_EN);
|
|
$display ("\tSwitch allocator arbitration type:%s",SWA_ARBITER_TYPE);
|
|
$display ("\tMinimum supported packet size:%0d flit(s)",MIN_PCK_SIZE);
|
|
$display ("\tLoop back is enabled:%s",SELF_LOOP_EN);
|
|
$display ("\tNumber of multihop bypass (SMART max):%0d",SMART_MAX);
|
|
$display ("NoC parameters:----------------");
|
|
$display ("Simulation parameters-------------");
|
$display ("Simulation parameters-------------");
|
if(DEBUG_EN)
|
if(DEBUG_EN)
|
$display ("\tDebuging is enabled");
|
$display ("\tDebuging is enabled");
|
else
|
else
|
$display ("\tDebuging is disabled");
|
$display ("\tDebuging is disabled");
|
|
|
//if( AVG_LATENCY_METRIC == "HEAD_2_TAIL") $display ("\tOutput is the average latency on sending the packet header until receiving tail");
|
//if( AVG_LATENCY_METRIC == "HEAD_2_TAIL") $display ("\tOutput is the average latency on sending the packet header until receiving tail");
|
//else $display ("\tOutput is the average latency on sending the packet header until receiving header flit at destination node");
|
//else $display ("\tOutput is the average latency on sending the packet header until receiving header flit at destination node");
|
$display ("\tTraffic pattern:%s",TRAFFIC);
|
$display ("\tTraffic pattern:%s",TRAFFIC);
|
if(C>0) $display ("\ttraffic percentage of class 0 is : %0d", C0_p);
|
if(C>0) $display ("\ttraffic percentage of class 0 is : %0d", C0_p);
|
if(C>1) $display ("\ttraffic percentage of class 1 is : %0d", C1_p);
|
if(C>1) $display ("\ttraffic percentage of class 1 is : %0d", C1_p);
|
if(C>2) $display ("\ttraffic percentage of class 2 is : %0d", C2_p);
|
if(C>2) $display ("\ttraffic percentage of class 2 is : %0d", C2_p);
|
if(C>3) $display ("\ttraffic percentage of class 3 is : %0d", C3_p);
|
if(C>3) $display ("\ttraffic percentage of class 3 is : %0d", C3_p);
|
if(TRAFFIC == "HOTSPOT")begin
|
if(TRAFFIC == "HOTSPOT")begin
|
//$display ("\tHot spot percentage: %u\n", HOTSPOT_PERCENTAGE);
|
//$display ("\tHot spot percentage: %u\n", HOTSPOT_PERCENTAGE);
|
$display ("\tNumber of hot spot cores: %0d", HOTSPOT_NODE_NUM);
|
$display ("\tNumber of hot spot cores: %0d", HOTSPOT_NODE_NUM);
|
end
|
end
|
|
if (CAST_TYPE != "UNICAST")begin
|
|
$display ("\tMULTICAST traffic ratio: %d(%%), min: %d, max: %d\n", MCAST_TRAFFIC_RATIO,MCAST_PCK_SIZ_MIN,MCAST_PCK_SIZ_MAX);
|
|
end
|
|
|
|
|
|
|
//$display ("\tTotal packets sent by one router: %u\n", TOTAL_PKT_PER_ROUTER);
|
//$display ("\tTotal packets sent by one router: %u\n", TOTAL_PKT_PER_ROUTER);
|
$display ("\tSimulation timeout =%0d", STOP_SIM_CLK);
|
$display ("\tSimulation timeout =%0d", STOP_SIM_CLK);
|
$display ("\tSimulation ends on total packet num of =%0d", STOP_PCK_NUM);
|
$display ("\tSimulation ends on total packet num of =%0d", STOP_PCK_NUM);
|
$display ("\tPacket size (min,max,average) in flits: (%0d,%0d,%0d)",MIN_PACKET_SIZE,MAX_PACKET_SIZE,AVG_PCK_SIZ);
|
$display ("\tPacket size (min,max,average) in flits: (%0d,%0d,%0d)",MIN_PACKET_SIZE,MAX_PACKET_SIZE,AVG_PCK_SIZ);
|
$display ("\tPacket injector FIFO width in flit:%0d\n\n",TIMSTMP_FIFO_NUM);
|
$display ("\tPacket injector FIFO width in flit:%0d\n\n",TIMSTMP_FIFO_NUM);
|
$display ("\tFlit injection ratio per router is =%f (flits/clk/Total Endpoint %%)",ratio);
|
$display ("\tFlit injection ratio per router is =%f (flits/clk/Total Endpoint %%)",ratio);
|
|
|
$display ("Simulation parameters-------------");
|
$display ("Simulation parameters-------------");
|
|
|
end//initial
|
end//initial
|
|
|
|
|
|
|
|
|
|
|
task update_statistic;
|
task update_statistic;
|
input integer core_num;
|
input integer core_num;
|
input [Cw-1 : 0] class_num;
|
input [Cw-1 : 0] class_num;
|
input real clk_num_h2h;
|
input real clk_num_h2h;
|
input real clk_num_h2t;
|
input real clk_num_h2t;
|
input [NEw-1 : 0] src;
|
input [NEw-1 : 0] src;
|
input real latency;
|
input real latency;
|
input [DISTw-1 :0] distance ;
|
input [DISTw-1 :0] distance ;
|
begin
|
begin
|
|
|
|
|
if(C>1) begin
|
if(C>1) begin
|
|
|
rsvd_stat[core_num][class_num].pck_num ++;
|
rsvd_stat[core_num][class_num].pck_num ++;
|
rsvd_stat[core_num][class_num].sum_clk_h2h +=clk_num_h2h;
|
rsvd_stat[core_num][class_num].sum_clk_h2h +=clk_num_h2h;
|
rsvd_stat[core_num][class_num].sum_clk_h2t +=clk_num_h2t;
|
rsvd_stat[core_num][class_num].sum_clk_h2t +=clk_num_h2t;
|
rsvd_stat[core_num][class_num].sum_clk_per_hop+= (clk_num_h2h/$itor(distance));
|
rsvd_stat[core_num][class_num].sum_clk_per_hop+= (clk_num_h2h/$itor(distance));
|
if (rsvd_stat[core_num][class_num].worst_latency < latency ) rsvd_stat[core_num][class_num].worst_latency =latency;
|
if (rsvd_stat[core_num][class_num].worst_latency < latency ) rsvd_stat[core_num][class_num].worst_latency =latency;
|
if (rsvd_stat[core_num][class_num].min_latency==0 ) rsvd_stat[core_num][class_num].min_latency =latency;
|
if (rsvd_stat[core_num][class_num].min_latency==0 ) rsvd_stat[core_num][class_num].min_latency =latency;
|
if (rsvd_stat[core_num][class_num].min_latency > latency ) rsvd_stat[core_num][class_num].min_latency =latency;
|
if (rsvd_stat[core_num][class_num].min_latency > latency ) rsvd_stat[core_num][class_num].min_latency =latency;
|
if (sent_stat[src ][class_num].worst_latency < latency ) sent_stat[src ][class_num].worst_latency =latency;
|
if (sent_stat[src ][class_num].worst_latency < latency ) sent_stat[src ][class_num].worst_latency =latency;
|
if (sent_stat[src ][class_num].min_latency==0 ) sent_stat[src ][class_num].min_latency =latency;
|
if (sent_stat[src ][class_num].min_latency==0 ) sent_stat[src ][class_num].min_latency =latency;
|
if (sent_stat[src ][class_num].min_latency > latency ) sent_stat[src ][class_num].min_latency =latency;
|
if (sent_stat[src ][class_num].min_latency > latency ) sent_stat[src ][class_num].min_latency =latency;
|
|
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
rsvd_stat[core_num][class_num].sum_clk_pow2 += clk_num_h2h * clk_num_h2h;
|
rsvd_stat[core_num][class_num].sum_clk_pow2 += clk_num_h2h * clk_num_h2h;
|
`endif
|
`endif
|
end else begin
|
end else begin
|
rsvd_stat[core_num][0].pck_num ++;
|
rsvd_stat[core_num][0].pck_num ++;
|
rsvd_stat[core_num][0].sum_clk_h2h +=clk_num_h2h;
|
rsvd_stat[core_num][0].sum_clk_h2h +=clk_num_h2h;
|
rsvd_stat[core_num][0].sum_clk_h2t +=clk_num_h2t;
|
rsvd_stat[core_num][0].sum_clk_h2t +=clk_num_h2t;
|
rsvd_stat[core_num][0].sum_clk_per_hop+= (clk_num_h2h/$itor(distance));
|
if(distance>0) rsvd_stat[core_num][0].sum_clk_per_hop+= (clk_num_h2h/$itor(distance));
|
if (rsvd_stat[core_num][0].worst_latency < latency ) rsvd_stat[core_num][0].worst_latency=latency;
|
if (rsvd_stat[core_num][0].worst_latency < latency ) rsvd_stat[core_num][0].worst_latency=latency;
|
if (rsvd_stat[core_num][0].min_latency==0 ) rsvd_stat[core_num][0].min_latency =latency;
|
if (rsvd_stat[core_num][0].min_latency==0 ) rsvd_stat[core_num][0].min_latency =latency;
|
if (rsvd_stat[core_num][0].min_latency > latency ) rsvd_stat[core_num][0].min_latency =latency;
|
if (rsvd_stat[core_num][0].min_latency > latency ) rsvd_stat[core_num][0].min_latency =latency;
|
if (sent_stat[src ][0].worst_latency < latency ) sent_stat[src ][0].worst_latency=latency;
|
if (sent_stat[src ][0].worst_latency < latency ) sent_stat[src ][0].worst_latency=latency;
|
if (sent_stat[src ][0].min_latency==0 ) sent_stat[src ][0].min_latency =latency;
|
if (sent_stat[src ][0].min_latency==0 ) sent_stat[src ][0].min_latency =latency;
|
if (sent_stat[src ][0].min_latency > latency ) sent_stat[src ][0].min_latency =latency;
|
if (sent_stat[src ][0].min_latency > latency ) sent_stat[src ][0].min_latency =latency;
|
|
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
rsvd_stat[core_num][0].sum_clk_pow2 += clk_num_h2h * clk_num_h2h;
|
rsvd_stat[core_num][0].sum_clk_pow2 += clk_num_h2h * clk_num_h2h;
|
`endif
|
`endif
|
end
|
end
|
|
|
end
|
end
|
endtask
|
endtask
|
|
|
|
|
|
|
|
|
task merge_statistic;
|
task merge_statistic;
|
input statistic_t merge_stat;
|
input statistic_t merge_stat;
|
input statistic_t stat_in;
|
input statistic_t stat_in;
|
output statistic_t stat_out;
|
output statistic_t stat_out;
|
begin
|
begin
|
stat_out.pck_num = merge_stat.pck_num+stat_in.pck_num;
|
stat_out.pck_num = merge_stat.pck_num+stat_in.pck_num;
|
stat_out.flit_num = merge_stat.flit_num+stat_in.flit_num;
|
stat_out.flit_num = merge_stat.flit_num+stat_in.flit_num;
|
if(merge_stat.worst_latency < stat_in.worst_latency) stat_out.worst_latency= stat_in.worst_latency;
|
if(merge_stat.worst_latency < stat_in.worst_latency) stat_out.worst_latency= stat_in.worst_latency;
|
if(merge_stat.min_latency == 0 ) stat_out.min_latency = stat_in.min_latency;
|
if(merge_stat.min_latency == 0 ) stat_out.min_latency = stat_in.min_latency;
|
if(merge_stat.min_latency > stat_in.min_latency && stat_in.min_latency!=0 ) stat_out.min_latency = stat_in.min_latency;
|
if(merge_stat.min_latency > stat_in.min_latency && stat_in.min_latency!=0 ) stat_out.min_latency = stat_in.min_latency;
|
stat_out.sum_clk_h2h = merge_stat.sum_clk_h2h +stat_in.sum_clk_h2h ;
|
stat_out.sum_clk_h2h = merge_stat.sum_clk_h2h +stat_in.sum_clk_h2h ;
|
stat_out.sum_clk_h2t = merge_stat.sum_clk_h2t +stat_in.sum_clk_h2t ;
|
stat_out.sum_clk_h2t = merge_stat.sum_clk_h2t +stat_in.sum_clk_h2t ;
|
stat_out.sum_clk_per_hop = merge_stat.sum_clk_per_hop +stat_in.sum_clk_per_hop;
|
stat_out.sum_clk_per_hop = merge_stat.sum_clk_per_hop +stat_in.sum_clk_per_hop;
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
stat_out.sum_clk_pow2 = merge_stat.sum_clk_pow2 +stat_in.sum_clk_pow2;
|
stat_out.sum_clk_pow2 = merge_stat.sum_clk_pow2 +stat_in.sum_clk_pow2;
|
`endif
|
`endif
|
|
|
end
|
end
|
endtask
|
endtask
|
|
|
|
|
|
|
|
|
|
|
|
|
task print_st_single;
|
task print_st_single;
|
input [CLK_CNTw-1 : 0]total_clk;
|
input [CLK_CNTw-1 : 0]total_clk;
|
input statistic_t rsvd_stat;
|
input statistic_t rsvd_stat;
|
input statistic_t sent_stat;
|
input statistic_t sent_stat;
|
begin
|
begin
|
|
|
|
|
|
|
avg_st_t avg;
|
avg_st_t avg;
|
finilize_statistic (total_clk, rsvd_stat, avg);
|
finilize_statistic (total_clk, rsvd_stat, avg);
|
|
|
$write("%0d,",sent_stat.pck_num);
|
$write("%0d,",sent_stat.pck_num);
|
$write("%0d,",rsvd_stat.pck_num);
|
$write("%0d,",rsvd_stat.pck_num);
|
$write("%0d,",sent_stat.flit_num);
|
$write("%0d,",sent_stat.flit_num);
|
$write("%0d,",rsvd_stat.flit_num);
|
$write("%0d,",rsvd_stat.flit_num);
|
$write("%0d,",sent_stat.worst_latency);
|
$write("%0d,",sent_stat.worst_latency);
|
$write("%0d,",rsvd_stat.worst_latency);
|
$write("%0d,",rsvd_stat.worst_latency);
|
$write("%0d,",sent_stat.min_latency);
|
$write("%0d,",sent_stat.min_latency);
|
$write("%0d,",rsvd_stat.min_latency);
|
$write("%0d,",rsvd_stat.min_latency);
|
$write("%f,",avg.avg_latency_per_hop);
|
$write("%f,",avg.avg_latency_per_hop);
|
$write("%f,",avg.avg_latency_flit);
|
$write("%f,",avg.avg_latency_flit);
|
$write("%f,",avg.avg_latency_pck);
|
$write("%f,",avg.avg_latency_pck);
|
$write("%f,",avg.avg_throughput);
|
$write("%f,",avg.avg_throughput);
|
$write("%f,",avg.avg_pck_siz);
|
$write("%f,",avg.avg_pck_siz);
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
$write("%f,",avg.std_dev);
|
$write("%f,",avg.std_dev);
|
`endif
|
`endif
|
$write("\n");
|
$write("\n");
|
// printf("\n");
|
// printf("\n");
|
end
|
end
|
endtask
|
endtask
|
|
|
|
|
|
|
task finilize_statistic;
|
task finilize_statistic;
|
input [CLK_CNTw-1 : 0]total_clk;
|
input [CLK_CNTw-1 : 0]total_clk;
|
input statistic_t rsvd_stat;
|
input statistic_t rsvd_stat;
|
output avg_st_t avg_statistic;
|
output avg_st_t avg_statistic;
|
begin
|
begin
|
|
|
|
|
avg_statistic.avg_throughput = ($itor(rsvd_stat.flit_num*100)/NE )/total_clk;
|
avg_statistic.avg_throughput = ($itor(rsvd_stat.flit_num*100)/NE )/total_clk;
|
avg_statistic.avg_latency_flit =(rsvd_stat.pck_num>0)? rsvd_stat.sum_clk_h2h/rsvd_stat.pck_num : 0;
|
avg_statistic.avg_latency_flit =(rsvd_stat.pck_num>0)? rsvd_stat.sum_clk_h2h/rsvd_stat.pck_num : 0;
|
avg_statistic.avg_latency_pck = (rsvd_stat.pck_num>0)? rsvd_stat.sum_clk_h2t/rsvd_stat.pck_num :0;
|
avg_statistic.avg_latency_pck = (rsvd_stat.pck_num>0)? rsvd_stat.sum_clk_h2t/rsvd_stat.pck_num :0;
|
avg_statistic.avg_latency_per_hop = ( rsvd_stat.pck_num==0)? 0 : rsvd_stat.sum_clk_per_hop/rsvd_stat.pck_num;
|
avg_statistic.avg_latency_per_hop = ( rsvd_stat.pck_num==0)? 0 : rsvd_stat.sum_clk_per_hop/rsvd_stat.pck_num;
|
avg_statistic.avg_pck_siz = ( rsvd_stat.pck_num==0)? 0 : $itor(rsvd_stat.flit_num) / $itor(rsvd_stat.pck_num);
|
avg_statistic.avg_pck_siz = ( rsvd_stat.pck_num==0)? 0 : $itor(rsvd_stat.flit_num) / $itor(rsvd_stat.pck_num);
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
standard_dev( rsvd_stat.sum_clk_pow2,rsvd_stat.pck_num, avg_statistic.avg_latency_flit,avg_statistic.std_dev);
|
standard_dev( rsvd_stat.sum_clk_pow2,rsvd_stat.pck_num, avg_statistic.avg_latency_flit,avg_statistic.std_dev);
|
`endif
|
`endif
|
end
|
end
|
endtask
|
endtask
|
|
|
|
|
|
|
`ifdef STND_DEV_EN
|
`ifdef STND_DEV_EN
|
/************************
|
/************************
|
* std_dev = sqrt[(B-A^2/N)/N] = sqrt [(B/N)- (A/N)^2] = sqrt [B/N - mean^2]
|
* std_dev = sqrt[(B-A^2/N)/N] = sqrt [(B/N)- (A/N)^2] = sqrt [B/N - mean^2]
|
* A = sum of the values
|
* A = sum of the values
|
* B = sum of the squarded values
|
* B = sum of the squarded values
|
* *************/
|
* *************/
|
|
|
task standard_dev;
|
task standard_dev;
|
input real sum_pow2;
|
input real sum_pow2;
|
input [PCK_CNTw-1 :0] total_num;
|
input [PCK_CNTw-1 :0] total_num;
|
input real average;
|
input real average;
|
output real std_dev;
|
output real std_dev;
|
begin
|
begin
|
/*
|
/*
|
double A, B, N;
|
double A, B, N;
|
N= total_num;
|
N= total_num;
|
A= average * N;
|
A= average * N;
|
B= sum_pow2;
|
B= sum_pow2;
|
|
|
A=(A*A)/N;
|
A=(A*A)/N;
|
std_dev = (B-A)/N;
|
std_dev = (B-A)/N;
|
std_dev = sqrt(std_dev);
|
std_dev = sqrt(std_dev);
|
*/
|
*/
|
if(total_num==0) std_dev= 0;
|
if(total_num==0) std_dev= 0;
|
else begin
|
else begin
|
std_dev = sum_pow2/$itor(total_num); //B/N
|
std_dev = sum_pow2/$itor(total_num); //B/N
|
std_dev -= (average*average);// (B/N) - mean^2
|
std_dev -= (average*average);// (B/N) - mean^2
|
std_dev = $sqrt(std_dev);// sqrt [B/N - mean^2]
|
std_dev = $sqrt(std_dev);// sqrt [B/N - mean^2]
|
|
|
end
|
end
|
end
|
end
|
endtask
|
endtask
|
|
|
`endif
|
`endif
|
|
|
|
|
|
|
/*
|
/*
|
start_delay_gen #(
|
start_delay_gen #(
|
.NC(NE)
|
.NC(NE)
|
)
|
)
|
delay_gen
|
delay_gen
|
(
|
(
|
.clk(clk),
|
.clk(clk),
|
.reset(reset),
|
.reset(reset),
|
.start_i(start),
|
.start_i(start),
|
.start_o(start_o)
|
.start_o(start_o)
|
);
|
);
|
*/
|
*/
|
|
|
|
|
|
routers_statistic_collector router_stat(
|
|
.reset(reset),
|
|
.clk(clk),
|
|
.router_event(router_event),
|
|
.print(print_router_st)
|
|
);
|
|
|
endmodule
|
endmodule
|
// synthesis translate_on
|
// synthesis translate_on
|
|
|
|
|