Line 110... |
Line 110... |
input vsa_ctrl_t vsa_ctrl_in [P-1: 0];
|
input vsa_ctrl_t vsa_ctrl_in [P-1: 0];
|
input ssa_ctrl_t ssa_ctrl_in [P-1: 0];
|
input ssa_ctrl_t ssa_ctrl_in [P-1: 0];
|
input smart_ctrl_t smart_ctrl_in [P-1: 0];
|
input smart_ctrl_t smart_ctrl_in [P-1: 0];
|
input [CRDTw-1 : 0 ] credit_init_val_in [P-1 : 0][V-1 : 0];
|
input [CRDTw-1 : 0 ] credit_init_val_in [P-1 : 0][V-1 : 0];
|
|
|
|
wire [PVV-1 : 0] ssa_granted_ovc_num_all;
|
|
|
logic [PV-1 : 0] ovc_status;
|
logic [PV-1 : 0] ovc_status;
|
logic [PV-1 : 0] ovc_status_next;
|
logic [PV-1 : 0] ovc_status_next;
|
wire [PV-1 : 0] assigned_ovc_is_full_all;
|
wire [PV-1 : 0] assigned_ovc_is_full_all;
|
wire [VP_1-1 : 0] credit_decreased [P-1 : 0];
|
wire [VP_1-1 : 0] credit_decreased [P-1 : 0];
|
wire [P_1-1 : 0] credit_decreased_gen [PV-1 : 0];
|
wire [P_1-1 : 0] credit_decreased_gen [PV-1 : 0];
|
Line 194... |
Line 196... |
|
|
// wire [PV-1 : 0] non_smart_ovc_allocated_all = ssa_ovc_allocated_all| vsa_ovc_allocated_all;
|
// wire [PV-1 : 0] non_smart_ovc_allocated_all = ssa_ovc_allocated_all| vsa_ovc_allocated_all;
|
wire [PV-1 : 0] non_smart_ovc_allocated_all;
|
wire [PV-1 : 0] non_smart_ovc_allocated_all;
|
generate
|
generate
|
for(i=0;i
|
for(i=0;i
|
|
assign ssa_granted_ovc_num_all[(i+1)*VV-1: i*VV] = ssa_ctrl_in[i].ivc_granted_ovc_num;
|
assign credit_decreased_all [(i+1)*V-1 : i*V] = vsa_ctrl_in[i].buff_space_decreased | ssa_ctrl_in[i].buff_space_decreased | smart_ctrl_in[i].buff_space_decreased;
|
assign credit_decreased_all [(i+1)*V-1 : i*V] = vsa_ctrl_in[i].buff_space_decreased | ssa_ctrl_in[i].buff_space_decreased | smart_ctrl_in[i].buff_space_decreased;
|
assign ovc_released_all [(i+1)*V-1 : i*V] = vsa_ctrl_in[i].ovc_is_released | ssa_ctrl_in[i].ovc_is_released | smart_ctrl_in[i].ovc_is_released;
|
assign ovc_released_all [(i+1)*V-1 : i*V] = vsa_ctrl_in[i].ovc_is_released | ssa_ctrl_in[i].ovc_is_released | smart_ctrl_in[i].ovc_is_released;
|
assign ovc_allocated_all [(i+1)*V-1 : i*V] = vsa_ctrl_in[i].ovc_is_allocated | ssa_ctrl_in[i].ovc_is_allocated | smart_ctrl_in[i].ovc_is_allocated;
|
assign ovc_allocated_all [(i+1)*V-1 : i*V] = vsa_ctrl_in[i].ovc_is_allocated | ssa_ctrl_in[i].ovc_is_allocated | smart_ctrl_in[i].ovc_is_allocated;
|
//assign non_smart_ovc_allocated_all [(i+1)*V-1 : i*V] = ssa_ctrl_in[i].ovc_is_allocated | vsa_ctrl_in[i].ovc_is_allocated;
|
//assign non_smart_ovc_allocated_all [(i+1)*V-1 : i*V] = ssa_ctrl_in[i].ovc_is_allocated | vsa_ctrl_in[i].ovc_is_allocated;
|
|
|
Line 282... |
Line 284... |
assign nearly_full_perport [i]=nearly_full_all;
|
assign nearly_full_perport [i]=nearly_full_all;
|
end
|
end
|
end
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
for(i=0; i
|
for(i=0; i
|
|
|
assign assigned_ovc_num_all[(i+1)*V-1 : i*V] = ivc_info[i/V][i%V].assigned_ovc_num;
|
assign assigned_ovc_num_all[(i+1)*V-1 : i*V] = ivc_info[i/V][i%V].assigned_ovc_num;
|
assign ovc_is_assigned_all[i]=ivc_info[i/V][i%V].ovc_is_assigned;
|
assign ovc_is_assigned_all[i]=ivc_info[i/V][i%V].ovc_is_assigned;
|
|
|
Line 317... |
Line 323... |
.SELF_LOOP_EN (SELF_LOOP_EN)
|
.SELF_LOOP_EN (SELF_LOOP_EN)
|
|
|
)
|
)
|
sw_mask
|
sw_mask
|
(
|
(
|
|
.ssa_granted_ovc_num(ssa_granted_ovc_num_all[(i+1)*V-1 :i*V]),
|
.granted_ovc_num(granted_ovc_num_all[(i+1)*V-1 :i*V]),
|
.granted_ovc_num(granted_ovc_num_all[(i+1)*V-1 :i*V]),
|
.ovc_is_assigned(ovc_is_assigned_all[i]),
|
.ovc_is_assigned(ovc_is_assigned_all[i]),
|
.assigned_ovc_num (assigned_ovc_num_all[(i+1)*V-1 :i*V]),
|
.assigned_ovc_num (assigned_ovc_num_all[(i+1)*V-1 :i*V]),
|
.dest_port (dest_port_all [(i+1)*P_1-1 :i*P_1]),
|
.dest_port (dest_port_all [(i+1)*P_1-1 :i*P_1]),
|
.full (full_perport [i/V]),
|
.full (full_perport [i/V]),
|
Line 646... |
Line 653... |
parameter P = 5, // router port num
|
parameter P = 5, // router port num
|
parameter OVC_ALLOC_MODE=1'b0,
|
parameter OVC_ALLOC_MODE=1'b0,
|
parameter SELF_LOOP_EN = "NO"
|
parameter SELF_LOOP_EN = "NO"
|
|
|
)(
|
)(
|
|
ssa_granted_ovc_num,
|
granted_ovc_num,
|
granted_ovc_num,
|
ovc_is_assigned,
|
ovc_is_assigned,
|
assigned_ovc_num,
|
assigned_ovc_num,
|
dest_port,
|
dest_port,
|
full,
|
full,
|
Line 662... |
Line 670... |
);
|
);
|
localparam P_1 = ( SELF_LOOP_EN=="NO")? P-1 : P,
|
localparam P_1 = ( SELF_LOOP_EN=="NO")? P-1 : P,
|
VP_1 = V * P_1;
|
VP_1 = V * P_1;
|
input clk,reset;
|
input clk,reset;
|
input ovc_is_assigned;
|
input ovc_is_assigned;
|
input [V-1 : 0] assigned_ovc_num,granted_ovc_num;
|
input [V-1 : 0] assigned_ovc_num,granted_ovc_num,ssa_granted_ovc_num;
|
input [P_1-1 : 0] dest_port;
|
input [P_1-1 : 0] dest_port;
|
input [VP_1-1 : 0] full;
|
input [VP_1-1 : 0] full;
|
input [VP_1-1 : 0] credit_increased;
|
input [VP_1-1 : 0] credit_increased;
|
input [VP_1-1 : 0] nearly_full;
|
input [VP_1-1 : 0] nearly_full;
|
input ivc_getting_sw_grant;
|
input ivc_getting_sw_grant;
|
Line 714... |
Line 722... |
.in (full_muxout1),
|
.in (full_muxout1),
|
.out (full_muxout2),
|
.out (full_muxout2),
|
.sel (assigned_ovc_num)
|
.sel (assigned_ovc_num)
|
);
|
);
|
|
|
wire [V-1 : 0] nearlyfull_sel = (ovc_is_assigned | ~OVC_ALLOC_MODE)? assigned_ovc_num : granted_ovc_num;
|
wire [V-1 : 0] nearlyfull_sel = (ovc_is_assigned | ~OVC_ALLOC_MODE)? assigned_ovc_num : granted_ovc_num ;// or (granted_ovc_num | ssa_granted_ovc_num) ?
|
|
|
onehot_mux_1D #(
|
onehot_mux_1D #(
|
.W (1),
|
.W (1),
|
.N (V)
|
.N (V)
|
)nearlfull_mux2
|
)nearlfull_mux2
|