Line 1... |
Line 1... |
`timescale 1ns / 1ps
|
`include "pronoc_def.v"
|
|
|
|
|
/****************************************************************************
|
/****************************************************************************
|
* router_top.v
|
* router_top.v
|
****************************************************************************/
|
****************************************************************************/
|
Line 14... |
Line 14... |
import pronoc_pkg::*;
|
import pronoc_pkg::*;
|
|
|
# (
|
# (
|
parameter P = 5 // router port num
|
parameter P = 5 // router port num
|
)(
|
)(
|
current_r_addr,// connected to constant parameter
|
current_r_id,
|
|
current_r_addr,
|
|
|
chan_in,
|
chan_in,
|
chan_out,
|
chan_out,
|
|
|
|
router_event,
|
|
|
clk,
|
clk,
|
reset
|
reset
|
|
|
);
|
);
|
|
|
|
|
localparam DISABLED =P;
|
localparam DISABLED =P;
|
|
|
input [RAw-1 : 0] current_r_addr;
|
input [RAw-1 : 0] current_r_addr;
|
|
input [31 : 0] current_r_id;
|
|
|
|
|
input smartflit_chanel_t chan_in [P-1 : 0];
|
input smartflit_chanel_t chan_in [P-1 : 0];
|
output smartflit_chanel_t chan_out [P-1 : 0];
|
output smartflit_chanel_t chan_out [P-1 : 0];
|
|
|
|
output router_event_t router_event [P-1 : 0];
|
|
|
|
|
|
|
input clk,reset;
|
input clk,reset;
|
|
|
genvar i,j;
|
genvar i,j;
|
|
|
|
|
Line 55... |
Line 62... |
end
|
end
|
if((MIN_PCK_SIZE > 1) && (PCK_TYPE == "SINGLE_FLIT")) begin
|
if((MIN_PCK_SIZE > 1) && (PCK_TYPE == "SINGLE_FLIT")) begin
|
$display("ERROR: The minimum packet size must be set as one for single-flit packet type NoC");
|
$display("ERROR: The minimum packet size must be set as one for single-flit packet type NoC");
|
$finish;
|
$finish;
|
end
|
end
|
|
if(((SSA_EN=="YES") || (SMART_EN==1'b1) ) && CAST_TYPE!="UNICAST") begin
|
|
$display("ERROR: SMART or SAA do not support muticast/braodcast packets");
|
|
$finish;
|
end
|
end
|
|
|
|
end
|
|
/* verilator lint_on WIDTH */
|
|
|
|
|
|
|
|
|
|
|
logic report_active_ivcs = 0;
|
logic report_active_ivcs = 0;
|
|
|
generate
|
generate
|
for (i=0; i
|
for (i=0; i
|
for (j=0; j
|
for (j=0; j
|
always @ (posedge report_active_ivcs) begin
|
always @ (posedge report_active_ivcs) begin
|
if(ivc_info[i][j].ivc_req) $display("%t : The IVC in router[%h] port[%d] VC [%d] is not empty",$time,current_r_addr,i,j);
|
if(ivc_info[i][j].ivc_req) $display("%t : The IVC in router[%h] port[%d] VC [%d] is not empty",$time,current_r_addr,i,j);
|
end
|
end
|
end
|
end
|
end
|
end
|
endgenerate
|
endgenerate
|
|
|
/* verilator lint_on WIDTH */
|
|
//synopsys translate_on
|
//synopsys translate_on
|
//synthesis translate_on
|
//synthesis translate_on
|
|
|
|
|
|
|
|
generate
|
|
for (i=0; i
|
|
assign router_event[i].flit_wr_i = chan_in[i].flit_chanel.flit_wr;
|
|
assign router_event[i].bypassed_num = chan_in[i].smart_chanel.bypassed_num;
|
|
assign router_event[i].pck_wr_i = chan_in[i].flit_chanel.flit_wr & chan_in[i].flit_chanel.flit.hdr_flag;
|
|
assign router_event[i].flit_wr_o = chan_out[i].flit_chanel.flit_wr;
|
|
assign router_event[i].pck_wr_o = chan_out[i].flit_chanel.flit_wr & chan_out[i].flit_chanel.flit.hdr_flag;
|
|
assign router_event[i].flit_in_bypassed = chan_out[i].smart_chanel.flit_in_bypassed;
|
|
|
|
end
|
|
endgenerate
|
|
|
|
|
|
|
|
|
|
|
|
|
flit_chanel_t r2_chan_in [P-1 : 0];
|
flit_chanel_t r2_chan_in [P-1 : 0];
|
flit_chanel_t r2_chan_out [P-1 : 0];
|
flit_chanel_t r2_chan_out [P-1 : 0];
|
|
|
Line 99... |
Line 128... |
|
|
generate
|
generate
|
for (i=0; i
|
for (i=0; i
|
assign ctrl_in [i] = chan_in[i].ctrl_chanel;
|
assign ctrl_in [i] = chan_in[i].ctrl_chanel;
|
assign chan_out[i].ctrl_chanel= ctrl_out [i];
|
assign chan_out[i].ctrl_chanel= ctrl_out [i];
|
|
|
end
|
end
|
endgenerate
|
endgenerate
|
|
|
// synthesis translate_off
|
// synthesis translate_off
|
|
|
Line 141... |
Line 171... |
.tail_flg_in(chan_in[i].flit_chanel.flit.tail_flag),
|
.tail_flg_in(chan_in[i].flit_chanel.flit.tail_flag),
|
.flit_in_wr(chan_in[i].flit_chanel.flit_wr),
|
.flit_in_wr(chan_in[i].flit_chanel.flit_wr),
|
.vc_num_in(chan_in[i].flit_chanel.flit.vc)
|
.vc_num_in(chan_in[i].flit_chanel.flit.vc)
|
);
|
);
|
|
|
|
check_pck_size #(
|
|
.V(V),
|
|
.MIN_PCK_SIZE(MIN_PCK_SIZE),
|
|
.Fw(Fw),
|
|
.DAw(DAw),
|
|
.CAST_TYPE(CAST_TYPE),
|
|
.NE(NE),
|
|
.B(B),
|
|
.LB(LB)
|
|
)
|
|
check_pck_siz
|
|
(
|
|
.clk(clk),
|
|
.reset(reset),
|
|
.hdr_flg_in(chan_in[i].flit_chanel.flit.hdr_flag),
|
|
.tail_flg_in(chan_in[i].flit_chanel.flit.tail_flag),
|
|
.flit_in_wr(chan_in[i].flit_chanel.flit_wr),
|
|
.vc_num_in(chan_in[i].flit_chanel.flit.vc),
|
|
.dest_e_addr_in(chan_in[i].flit_chanel.flit.payload[E_DST_MSB : E_DST_LSB])
|
|
);
|
|
|
|
|
end
|
end
|
|
|
|
|
end
|
end
|
endgenerate
|
endgenerate
|
Line 164... |
Line 216... |
.ovc_info (ovc_info),
|
.ovc_info (ovc_info),
|
.iport_info (iport_info),
|
.iport_info (iport_info),
|
.oport_info (oport_info),
|
.oport_info (oport_info),
|
.smart_ctrl_in (smart_ctrl),
|
.smart_ctrl_in (smart_ctrl),
|
.current_r_addr(current_r_addr),
|
.current_r_addr(current_r_addr),
|
|
.current_r_id(current_r_id),
|
.chan_in (r2_chan_in),
|
.chan_in (r2_chan_in),
|
.chan_out (r2_chan_out),
|
.chan_out (r2_chan_out),
|
.ctrl_in (ctrl_in),
|
.ctrl_in (ctrl_in),
|
.ctrl_out (ctrl_out),
|
.ctrl_out (ctrl_out),
|
.clk (clk),
|
.clk (clk),
|
Line 269... |
Line 322... |
.clk(clk)
|
.clk(clk)
|
);
|
);
|
// synthesis translate_on
|
// synthesis translate_on
|
|
|
assign smart_chanel_in[i] = chan_in[i].smart_chanel;
|
assign smart_chanel_in[i] = chan_in[i].smart_chanel;
|
assign chan_out[i].smart_chanel = smart_chanel_out[i];
|
|
|
|
//r2 demux
|
//r2 demux
|
// flit_in_wr demux
|
// flit_in_wr demux
|
always @(*) begin
|
always @(*) begin
|
|
chan_out[i].smart_chanel = smart_chanel_out[i];
|
|
chan_out[i].smart_chanel.flit_in_bypassed =smart_ctrl[i].smart_en & chan_in[i].flit_chanel.flit_wr ;
|
|
|
|
|
//mask only flit_wr if smart_en is asserted
|
//mask only flit_wr if smart_en is asserted
|
r2_chan_in[i] = chan_in[i].flit_chanel;
|
r2_chan_in[i] = chan_in[i].flit_chanel;
|
//can replace destport here and remove lk rout from internal router
|
//can replace destport here and remove lk rout from internal router
|
if (smart_ctrl[i].smart_en) r2_chan_in[i].flit_wr = 1'b0;
|
if (smart_ctrl[i].smart_en) r2_chan_in[i].flit_wr = 1'b0;
|
|
|
|
|
//send flit_in to straight out port. Replace lk destport in header flit
|
//send flit_in to straight out port. Replace lk destport in header flit
|
ss_flit_chanel[SS_PORT] = chan_in[i].flit_chanel;
|
ss_flit_chanel[SS_PORT] = chan_in[i].flit_chanel;
|
if(smart_ctrl[i].hdr_flit_req) ss_flit_chanel[SS_PORT].flit[DST_P_MSB : DST_P_LSB] = smart_ctrl[i].lk_destport;
|
if(smart_ctrl[i].hdr_flit_req) ss_flit_chanel[SS_PORT].flit[DST_P_MSB : DST_P_LSB] = smart_ctrl[i].lk_destport;
|
end
|
end
|
|
|
Line 348... |
Line 406... |
// //no output flit wr
|
// //no output flit wr
|
// if (r2_chan_out[ii].flit_wr) router_is_ideal=1'b0;
|
// if (r2_chan_out[ii].flit_wr) router_is_ideal=1'b0;
|
// end
|
// end
|
// if (not_ideal) router_is_ideal =1'b0; // delay one clock cycle if the input req exist in last clock cycle bot not on the current one
|
// if (not_ideal) router_is_ideal =1'b0; // delay one clock cycle if the input req exist in last clock cycle bot not on the current one
|
// end
|
// end
|
// register #( .W(1)) no_ideal_register (.in(not_ideal_next), .reset (reset), .clk(clk), .out (not_ideal));
|
// pronoc_register #( .W(1)) no_ideal_register (.in(not_ideal_next), .reset (reset), .clk(clk), .out (not_ideal));
|
//`endif
|
//`endif
|
|
|
|
|
|
|
endmodule
|
endmodule
|
Line 364... |
Line 422... |
|
|
# (
|
# (
|
parameter P = 5 // router port num
|
parameter P = 5 // router port num
|
)(
|
)(
|
current_r_addr,
|
current_r_addr,
|
|
current_r_id,
|
|
|
chan_in,
|
chan_in,
|
chan_out,
|
chan_out,
|
|
|
|
router_event,
|
|
|
clk,
|
clk,
|
reset
|
reset
|
|
|
);
|
);
|
|
|
|
|
|
|
input [RAw-1 : 0] current_r_addr;
|
input [RAw-1 : 0] current_r_addr;
|
|
input [31:0] current_r_id;
|
|
|
input smartflit_chanel_t chan_in [P-1 : 0];
|
input smartflit_chanel_t chan_in [P-1 : 0];
|
output smartflit_chanel_t chan_out [P-1 : 0];
|
output smartflit_chanel_t chan_out [P-1 : 0];
|
input reset,clk;
|
input reset,clk;
|
|
|
|
output router_event_t router_event [P-1 : 0];
|
|
|
|
|
router_top # (
|
router_top # (
|
.P(P)
|
.P(P)
|
)
|
)
|
router
|
router
|
(
|
(
|
|
.current_r_id(current_r_id),
|
.current_r_addr(current_r_addr),
|
.current_r_addr(current_r_addr),
|
.chan_in (chan_in),
|
.chan_in (chan_in),
|
.chan_out(chan_out),
|
.chan_out(chan_out),
|
|
.router_event(router_event),
|
.clk(clk),
|
.clk(clk),
|
.reset(reset)
|
.reset(reset)
|
);
|
);
|
|
|
|
|