Line 19... |
Line 19... |
History:
|
History:
|
26/05/2009 Initial version. <wsong83@gmail.com>
|
26/05/2009 Initial version. <wsong83@gmail.com>
|
20/09/2010 Supporting channel slicing and SDM using macro difinitions. <wsong83@gmail.com>
|
20/09/2010 Supporting channel slicing and SDM using macro difinitions. <wsong83@gmail.com>
|
22/10/2010 Parameterize the number of pipelines in output buffers. <wsong83@gmail.com>
|
22/10/2010 Parameterize the number of pipelines in output buffers. <wsong83@gmail.com>
|
23/05/2011 Clean up for opensource. <wsong83@gmail.com>
|
23/05/2011 Clean up for opensource. <wsong83@gmail.com>
|
|
21/06/2011 Move the eof logic in every pipeline stage outside the pipe4 module. <wsong83@gmail.com>
|
|
|
*/
|
*/
|
|
|
// the router structure definitions
|
// the router structure definitions
|
`include "define.v"
|
`include "define.v"
|
Line 45... |
Line 46... |
wire [PD:0][SCN-1:0] pd0, pd1, pd2, pd3; // data wires for the internal pipeline satges
|
wire [PD:0][SCN-1:0] pd0, pd1, pd2, pd3; // data wires for the internal pipeline satges
|
`ifdef ENABLE_CHANNEL_SLICING
|
`ifdef ENABLE_CHANNEL_SLICING
|
input [SCN-1:0] i4, oa; // eof and ack
|
input [SCN-1:0] i4, oa; // eof and ack
|
output [SCN-1:0] o4, ia;
|
output [SCN-1:0] o4, ia;
|
wire [SCN-1:0] ian_dly;
|
wire [SCN-1:0] ian_dly;
|
wire [PD:0][SCN-1:0] pd4, pda, pdan; // internal eof and ack
|
wire [PD:0][SCN-1:0] pd4, pda, pdan, pd4an; // internal eof and ack
|
`else
|
`else
|
input i4, oa; // eof and ack
|
input i4, oa; // eof and ack
|
output o4, ia;
|
output o4, ia;
|
wire ian_dly;
|
wire ian_dly;
|
wire [PD:0] pd4, pda, pdan; // internal eof and ack
|
wire [PD:0] pd4, pda, pdan, pd4an; // internal eof and ack
|
`endif
|
`endif
|
|
|
|
|
//-------------------------- pipeline ---------------------------------------//
|
//-------------------------- pipeline ---------------------------------------//
|
genvar i,j;
|
genvar i,j;
|
Line 65... |
Line 66... |
P (
|
P (
|
.o0 ( pd0[i][j] ),
|
.o0 ( pd0[i][j] ),
|
.o1 ( pd1[i][j] ),
|
.o1 ( pd1[i][j] ),
|
.o2 ( pd2[i][j] ),
|
.o2 ( pd2[i][j] ),
|
.o3 ( pd3[i][j] ),
|
.o3 ( pd3[i][j] ),
|
.o4 ( pd4[i][j] ),
|
//.o4 ( pd4[i][j] ),
|
.ia ( pda[i+1][j] ),
|
.ia ( pda[i+1][j] ),
|
.i0 ( pd0[i+1][j] ),
|
.i0 ( pd0[i+1][j] ),
|
.i1 ( pd1[i+1][j] ),
|
.i1 ( pd1[i+1][j] ),
|
.i2 ( pd2[i+1][j] ),
|
.i2 ( pd2[i+1][j] ),
|
.i3 ( pd3[i+1][j] ),
|
.i3 ( pd3[i+1][j] ),
|
.i4 ( pd4[i+1][j] ),
|
//.i4 ( pd4[i+1][j] ),
|
.oa ( pdan[i][j] )
|
.oa ( pdan[i][j] )
|
);
|
);
|
|
|
|
pipen #(.DW(1))
|
|
PEoF (
|
|
.d_in_a ( ),
|
|
.d_out ( pd4[i][j] ),
|
|
.d_in ( pd4[i+1][j] ),
|
|
.d_out_a ( pd4an[i][j] )
|
|
);
|
end // block: SC
|
end // block: SC
|
|
|
`else // !`ifdef ENABLE_CHANNEL_SLICING
|
`else // !`ifdef ENABLE_CHANNEL_SLICING
|
pipe4 #(.DW(DW))
|
pipe4 #(.DW(DW))
|
P (
|
P (
|
.o0 ( pd0[i] ),
|
.o0 ( pd0[i] ),
|
.o1 ( pd1[i] ),
|
.o1 ( pd1[i] ),
|
.o2 ( pd2[i] ),
|
.o2 ( pd2[i] ),
|
.o3 ( pd3[i] ),
|
.o3 ( pd3[i] ),
|
.o4 ( pd4[i] ),
|
//.o4 ( pd4[i] ),
|
.ia ( pda[i+1] ),
|
.ia ( pda[i+1] ),
|
.i0 ( pd0[i+1] ),
|
.i0 ( pd0[i+1] ),
|
.i1 ( pd1[i+1] ),
|
.i1 ( pd1[i+1] ),
|
.i2 ( pd2[i+1] ),
|
.i2 ( pd2[i+1] ),
|
.i3 ( pd3[i+1] ),
|
.i3 ( pd3[i+1] ),
|
.i4 ( pd4[i+1] ),
|
//.i4 ( pd4[i+1] ),
|
.oa ( pdan[i] )
|
.oa ( pdan[i] )
|
);
|
);
|
|
|
|
pipen #(.DW(1))
|
|
PEoF (
|
|
.d_in_a ( ),
|
|
.d_out ( pd4[i] ),
|
|
.d_in ( pd4[i+1] ),
|
|
.d_out_a ( pd4an[i] )
|
|
);
|
|
|
`endif // !`ifdef ENABLE_CHANNEL_SLICING
|
`endif // !`ifdef ENABLE_CHANNEL_SLICING
|
end // block: DP
|
end // block: DP
|
endgenerate
|
endgenerate
|
|
|
// generate the ack lines for data pipelines
|
// generate the ack lines for data pipelines
|
Line 113... |
Line 131... |
delay DLY ( .q(ian_dly[j]), .a(pdan[PD-1][j]));
|
delay DLY ( .q(ian_dly[j]), .a(pdan[PD-1][j]));
|
`else
|
`else
|
assign ia[j] = pda[PD][j]|pd4[PD-1][j];
|
assign ia[j] = pda[PD][j]|pd4[PD-1][j];
|
`endif
|
`endif
|
assign pdan[0][j] = (~oa[j])&rst_n;
|
assign pdan[0][j] = (~oa[j])&rst_n;
|
|
assign pd4an[0][j] = pdan[0][j];
|
end
|
end
|
`else
|
`else
|
`ifdef ENABLE_LOOKAHEAD
|
`ifdef ENABLE_LOOKAHEAD
|
and ACKG (ia, pda[PD]|pd4[PD-1], ian_dly);
|
and ACKG (ia, pda[PD]|pd4[PD-1], ian_dly);
|
delay DLY ( .q(ian_dly), .a(pdan[PD-1]));
|
delay DLY ( .q(ian_dly), .a(pdan[PD-1]));
|
`else
|
`else
|
assign ia = pda[PD]|pd4[PD-1];
|
assign ia = pda[PD]|pd4[PD-1];
|
`endif
|
`endif
|
assign pdan[0] = (~oa)&rst_n;
|
assign pdan[0] = (~oa)&rst_n;
|
|
assign pd4an[0] = pdan[0];
|
`endif // !`ifdef ENABLE_LOOKAHEAD
|
`endif // !`ifdef ENABLE_LOOKAHEAD
|
endgenerate
|
endgenerate
|
|
|
// name change
|
// name change
|
assign pd0[PD] = i0;
|
assign pd0[PD] = i0;
|