Line 24... |
Line 24... |
05/05/2009 Initial version. <wsong83@gmail.com>
|
05/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>
|
24/05/2011 Clean up for opensource. <wsong83@gmail.com>
|
24/05/2011 Clean up for opensource. <wsong83@gmail.com>
|
01/06/2011 Use the comp4 common comparator rather than the chain_comparator defined in this module. <wsong83@gmail.com>
|
01/06/2011 Use the comp4 common comparator rather than the chain_comparator defined in this module. <wsong83@gmail.com>
|
21/06/2011 Move the eof logic in every pipeline stage outside the pipe4 module. <wsong83@gmail.com>
|
21/06/2011 Move the eof logic in every pipeline stage outside the pipe4 module. <wsong83@gmail.com>
|
|
12/07/2011 Preparation for the buffered Clos switch. <wsong83@gmail.com>
|
|
|
*/
|
*/
|
|
|
// the router structure definitions
|
// the router structure definitions
|
`include "define.v"
|
`include "define.v"
|
|
|
module inp_buf (/*AUTOARG*/
|
module inp_buf (/*AUTOARG*/
|
// Outputs
|
// Outputs
|
o0, o1, o2, o3, o4, ia, arb_r,
|
o0, o1, o2, o3, o4, ia, deco,
|
// Inputs
|
// Inputs
|
rst_n, i0, i1, i2, i3, i4, oa, addrx, addry, arb_ra
|
rst_n, i0, i1, i2, i3, i4, oa, addrx, addry
|
);
|
);
|
|
|
//-------------------------- parameters ---------------------------------------//
|
//-------------------------- parameters ---------------------------------------//
|
parameter DIR = 0; // the port direction: south, west, north, east, and local
|
parameter DIR = 0; // the port direction: south, west, north, east, and local
|
parameter RN = 4; // the number of request outputs, must match the direction
|
parameter RN = 4; // the number of request outputs, must match the direction
|
Line 54... |
Line 56... |
output [SCN-1:0] o4, ia;
|
output [SCN-1:0] o4, ia;
|
`else
|
`else
|
input i4, oa;
|
input i4, oa;
|
output o4, ia;
|
output o4, ia;
|
`endif
|
`endif
|
input [7:0] addrx, addry;
|
input [7:0] addrx, addry; // local addresses in 1-of-4 encoding
|
output [RN-1:0] arb_r;
|
output [RN-1:0] deco; // the decoded routing requests
|
input arb_ra;
|
|
|
|
//-------------------------- control signals ---------------------------------------//
|
//-------------------------- control signals ---------------------------------------//
|
wire rten; // routing enable
|
wire rten; // routing enable
|
wire frame_end; // identify the end of a frame
|
wire frame_end; // identify the end of a frame
|
wire [7:0] pipe_xd, pipe_yd; // the target address from the incoming frame
|
wire [7:0] pipe_xd, pipe_yd; // the target address from the incoming frame
|
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
|
wire [5:0] raw_dec; // the routing decision from the comparator
|
wire [5:0] raw_dec; // the routing decision from the comparator
|
wire [4:0] dec_reg; // the routing decision kept by C-gates
|
wire [4:0] dec_reg; // the routing decision kept by C-gates
|
wire x_equal; // addr x = target x
|
wire x_equal; // addr x = target x
|
wire rt_err; // route decoder error
|
wire rt_err; // route decoder error
|
wire rt_ack; // route build ack
|
|
|
|
`ifdef ENABLE_CHANNEL_SLICING
|
`ifdef ENABLE_CHANNEL_SLICING
|
wire [SCN-1:0] rtrst; // rt decoder reset for each sub-channel
|
wire [SCN-1:0] deca; // the ack for routing requests
|
wire [PD:0][SCN-1:0] pd4, pda, pdan, pd4an; // data wires for the internal pipeline stages
|
wire [PD:0][SCN-1:0] pd4, pda, pdan, pd4an; // data wires for the internal pipeline stages
|
|
|
`else
|
`else
|
wire rtrst; // rt decode reset
|
wire deca; // the ack for routing requests
|
wire [PD:0] pd4, pda, pdan, pd4an; // data wires for the internal pipeline satges
|
wire [PD:0] pd4, pda, pdan, pd4an; // data wires for the internal pipeline satges
|
`endif // !`ifdef ENABLE_CHANNEL_SLICING
|
`endif // !`ifdef ENABLE_CHANNEL_SLICING
|
|
wire decan;
|
|
|
genvar i, j;
|
genvar i, j;
|
|
|
//------------------------- pipelines ------------------------------------- //
|
//------------------------- pipelines ------------------------------------- //
|
generate for(i=0; i<PD; i++) begin: DP
|
generate for(i=0; i<PD; i++) begin: DP
|
Line 90... |
Line 91... |
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] ),
|
|
.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] ),
|
|
.oa ( pdan[i][j] )
|
.oa ( pdan[i][j] )
|
);
|
);
|
|
|
pipen #(.DW(1))
|
pipen #(.DW(1))
|
PEoF (
|
PEoF (
|
Line 118... |
Line 117... |
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] ),
|
|
.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] ),
|
|
.oa ( pdan[i] )
|
.oa ( pdan[i] )
|
);
|
);
|
|
|
pipen #(.DW(1))
|
pipen #(.DW(1))
|
PEoF (
|
PEoF (
|