1 |
2 |
peteralieb |
// FCP Channel Interface
|
2 |
|
|
|
3 |
|
|
module channelif6
|
4 |
|
|
(
|
5 |
|
|
// To ethernet platform
|
6 |
|
|
input in_sof,
|
7 |
|
|
input in_eof,
|
8 |
|
|
input in_src_rdy,
|
9 |
|
|
output in_dst_rdy,
|
10 |
|
|
input [7:0] in_data,
|
11 |
|
|
input [3:0] inport_addr,
|
12 |
|
|
output out_sof,
|
13 |
|
|
output out_eof,
|
14 |
|
|
output out_src_rdy,
|
15 |
|
|
input out_dst_rdy,
|
16 |
|
|
output [7:0] out_data,
|
17 |
|
|
input [3:0] outport_addr,
|
18 |
|
|
// Channel 1
|
19 |
|
|
input ch1_in_sof,
|
20 |
|
|
input ch1_in_eof,
|
21 |
|
|
input ch1_in_src_rdy,
|
22 |
|
|
output ch1_in_dst_rdy,
|
23 |
|
|
input [7:0] ch1_in_data,
|
24 |
|
|
output ch1_out_sof,
|
25 |
|
|
output ch1_out_eof,
|
26 |
|
|
output ch1_out_src_rdy,
|
27 |
|
|
input ch1_out_dst_rdy,
|
28 |
|
|
output [7:0] ch1_out_data,
|
29 |
|
|
output ch1_wen,
|
30 |
|
|
output ch1_ren,
|
31 |
|
|
// Channel 2
|
32 |
|
|
input ch2_in_sof,
|
33 |
|
|
input ch2_in_eof,
|
34 |
|
|
input ch2_in_src_rdy,
|
35 |
|
|
output ch2_in_dst_rdy,
|
36 |
|
|
input [7:0] ch2_in_data,
|
37 |
|
|
output ch2_out_sof,
|
38 |
|
|
output ch2_out_eof,
|
39 |
|
|
output ch2_out_src_rdy,
|
40 |
|
|
input ch2_out_dst_rdy,
|
41 |
|
|
output [7:0] ch2_out_data,
|
42 |
|
|
output ch2_wen,
|
43 |
|
|
output ch2_ren,
|
44 |
|
|
// Channel 3
|
45 |
|
|
input ch3_in_sof,
|
46 |
|
|
input ch3_in_eof,
|
47 |
|
|
input ch3_in_src_rdy,
|
48 |
|
|
output ch3_in_dst_rdy,
|
49 |
|
|
input [7:0] ch3_in_data,
|
50 |
|
|
output ch3_out_sof,
|
51 |
|
|
output ch3_out_eof,
|
52 |
|
|
output ch3_out_src_rdy,
|
53 |
|
|
input ch3_out_dst_rdy,
|
54 |
|
|
output [7:0] ch3_out_data,
|
55 |
|
|
output ch3_wen,
|
56 |
|
|
output ch3_ren,
|
57 |
|
|
// Channel 4
|
58 |
|
|
input ch4_in_sof,
|
59 |
|
|
input ch4_in_eof,
|
60 |
|
|
input ch4_in_src_rdy,
|
61 |
|
|
output ch4_in_dst_rdy,
|
62 |
|
|
input [7:0] ch4_in_data,
|
63 |
|
|
output ch4_out_sof,
|
64 |
|
|
output ch4_out_eof,
|
65 |
|
|
output ch4_out_src_rdy,
|
66 |
|
|
input ch4_out_dst_rdy,
|
67 |
|
|
output [7:0] ch4_out_data,
|
68 |
|
|
output ch4_wen,
|
69 |
|
|
output ch4_ren,
|
70 |
|
|
// Channel 5
|
71 |
|
|
input ch5_in_sof,
|
72 |
|
|
input ch5_in_eof,
|
73 |
|
|
input ch5_in_src_rdy,
|
74 |
|
|
output ch5_in_dst_rdy,
|
75 |
|
|
input [7:0] ch5_in_data,
|
76 |
|
|
output ch5_out_sof,
|
77 |
|
|
output ch5_out_eof,
|
78 |
|
|
output ch5_out_src_rdy,
|
79 |
|
|
input ch5_out_dst_rdy,
|
80 |
|
|
output [7:0] ch5_out_data,
|
81 |
|
|
output ch5_wen,
|
82 |
|
|
output ch5_ren,
|
83 |
|
|
// Channel 6
|
84 |
|
|
input ch6_in_sof,
|
85 |
|
|
input ch6_in_eof,
|
86 |
|
|
input ch6_in_src_rdy,
|
87 |
|
|
output ch6_in_dst_rdy,
|
88 |
|
|
input [7:0] ch6_in_data,
|
89 |
|
|
output ch6_out_sof,
|
90 |
|
|
output ch6_out_eof,
|
91 |
|
|
output ch6_out_src_rdy,
|
92 |
|
|
input ch6_out_dst_rdy,
|
93 |
|
|
output [7:0] ch6_out_data,
|
94 |
|
|
output ch6_wen,
|
95 |
|
|
output ch6_ren,
|
96 |
|
|
|
97 |
|
|
// To user logic
|
98 |
|
|
output [15:0] wenables,
|
99 |
|
|
output [15:0] renables
|
100 |
|
|
);
|
101 |
|
|
|
102 |
|
|
//-------------------------------------------------------------------------------------
|
103 |
|
|
//-------------------------------------------------------------------------------------
|
104 |
|
|
// Channel-Enable Decoders
|
105 |
|
|
//-------------------------------------------------------------------------------------
|
106 |
|
|
//-------------------------------------------------------------------------------------
|
107 |
|
|
|
108 |
|
|
reg [15:0] wenables_i;
|
109 |
|
|
reg [15:0] renables_i;
|
110 |
|
|
|
111 |
|
|
always @(inport_addr)
|
112 |
|
|
begin
|
113 |
|
|
case (inport_addr)
|
114 |
|
|
4'h0 : wenables_i = 16'b0000000000000001;
|
115 |
|
|
4'h1 : wenables_i = 16'b0000000000000010;
|
116 |
|
|
4'h2 : wenables_i = 16'b0000000000000100;
|
117 |
|
|
4'h3 : wenables_i = 16'b0000000000001000;
|
118 |
|
|
4'h4 : wenables_i = 16'b0000000000010000;
|
119 |
|
|
4'h5 : wenables_i = 16'b0000000000100000;
|
120 |
|
|
4'h6 : wenables_i = 16'b0000000001000000;
|
121 |
|
|
4'h7 : wenables_i = 16'b0000000010000000;
|
122 |
|
|
4'h8 : wenables_i = 16'b0000000100000000;
|
123 |
|
|
4'h9 : wenables_i = 16'b0000001000000000;
|
124 |
|
|
4'hA : wenables_i = 16'b0000010000000000;
|
125 |
|
|
4'hB : wenables_i = 16'b0000100000000000;
|
126 |
|
|
4'hC : wenables_i = 16'b0001000000000000;
|
127 |
|
|
4'hD : wenables_i = 16'b0010000000000000;
|
128 |
|
|
4'hE : wenables_i = 16'b0100000000000000;
|
129 |
|
|
4'hF : wenables_i = 16'b1000000000000000;
|
130 |
|
|
default: wenables_i = 16'b0000000000000000;
|
131 |
|
|
endcase
|
132 |
|
|
end
|
133 |
|
|
|
134 |
|
|
always @(outport_addr)
|
135 |
|
|
begin
|
136 |
|
|
case (outport_addr)
|
137 |
|
|
4'h0 : renables_i = 16'b0000000000000001;
|
138 |
|
|
4'h1 : renables_i = 16'b0000000000000010;
|
139 |
|
|
4'h2 : renables_i = 16'b0000000000000100;
|
140 |
|
|
4'h3 : renables_i = 16'b0000000000001000;
|
141 |
|
|
4'h4 : renables_i = 16'b0000000000010000;
|
142 |
|
|
4'h5 : renables_i = 16'b0000000000100000;
|
143 |
|
|
4'h6 : renables_i = 16'b0000000001000000;
|
144 |
|
|
4'h7 : renables_i = 16'b0000000010000000;
|
145 |
|
|
4'h8 : renables_i = 16'b0000000100000000;
|
146 |
|
|
4'h9 : renables_i = 16'b0000001000000000;
|
147 |
|
|
4'hA : renables_i = 16'b0000010000000000;
|
148 |
|
|
4'hB : renables_i = 16'b0000100000000000;
|
149 |
|
|
4'hC : renables_i = 16'b0001000000000000;
|
150 |
|
|
4'hD : renables_i = 16'b0010000000000000;
|
151 |
|
|
4'hE : renables_i = 16'b0100000000000000;
|
152 |
|
|
4'hF : renables_i = 16'b1000000000000000;
|
153 |
|
|
default: renables_i = 16'b0000000000000000;
|
154 |
|
|
endcase
|
155 |
|
|
end
|
156 |
|
|
|
157 |
|
|
assign wenables = wenables_i;
|
158 |
|
|
assign renables = renables_i;
|
159 |
|
|
|
160 |
|
|
|
161 |
|
|
//-------------------------------------------------------------------------------------
|
162 |
|
|
//-------------------------------------------------------------------------------------
|
163 |
|
|
// Multiplexers
|
164 |
|
|
//-------------------------------------------------------------------------------------
|
165 |
|
|
//-------------------------------------------------------------------------------------
|
166 |
|
|
|
167 |
|
|
|
168 |
|
|
assign in_dst_rdy = (ch1_wen & ch1_out_dst_rdy) | (ch2_wen & ch2_out_dst_rdy) | (ch3_wen & ch3_out_dst_rdy) | (ch4_wen & ch4_out_dst_rdy) | (ch5_wen & ch5_out_dst_rdy) | (ch6_wen & ch6_out_dst_rdy);
|
169 |
|
|
assign out_sof = (ch1_ren & ch1_in_sof) | (ch2_ren & ch2_in_sof) | (ch3_ren & ch3_in_sof) | (ch4_ren & ch4_in_sof) | (ch5_ren & ch5_in_sof) | (ch6_ren & ch6_in_sof);
|
170 |
|
|
assign out_eof = (ch1_ren & ch1_in_eof) | (ch2_ren & ch2_in_eof) | (ch3_ren & ch3_in_eof) | (ch4_ren & ch4_in_eof) | (ch5_ren & ch5_in_eof) | (ch6_ren & ch6_in_eof);
|
171 |
|
|
assign out_src_rdy = (ch1_ren & ch1_in_src_rdy) | (ch2_ren & ch2_in_src_rdy) | (ch3_ren & ch3_in_src_rdy) | (ch4_ren & ch4_in_src_rdy) | (ch5_ren & ch5_in_src_rdy) | (ch6_ren & ch6_in_src_rdy);
|
172 |
|
|
assign out_data = ({8{ch1_ren}} & ch1_in_data) | ({8{ch2_ren}} & ch2_in_data) | ({8{ch3_ren}} & ch3_in_data) | ({8{ch4_ren}} & ch4_in_data) | ({8{ch5_ren}} & ch5_in_data) | ({8{ch6_ren}} & ch6_in_data);
|
173 |
|
|
|
174 |
|
|
//-------------------------------------------------------------------------------------
|
175 |
|
|
//-------------------------------------------------------------------------------------
|
176 |
|
|
// Passthroughs
|
177 |
|
|
//-------------------------------------------------------------------------------------
|
178 |
|
|
//-------------------------------------------------------------------------------------
|
179 |
|
|
|
180 |
|
|
assign ch1_in_dst_rdy = out_dst_rdy;
|
181 |
|
|
assign ch1_out_src_rdy = in_src_rdy;
|
182 |
|
|
assign ch1_out_sof = in_sof;
|
183 |
|
|
assign ch1_out_eof = in_eof;
|
184 |
|
|
assign ch1_out_data = in_data;
|
185 |
|
|
assign ch1_wen = wenables_i[1];
|
186 |
|
|
assign ch1_ren = renables_i[1];
|
187 |
|
|
|
188 |
|
|
assign ch2_in_dst_rdy = out_dst_rdy;
|
189 |
|
|
assign ch2_out_src_rdy = in_src_rdy;
|
190 |
|
|
assign ch2_out_sof = in_sof;
|
191 |
|
|
assign ch2_out_eof = in_eof;
|
192 |
|
|
assign ch2_out_data = in_data;
|
193 |
|
|
assign ch2_wen = wenables_i[2];
|
194 |
|
|
assign ch2_ren = renables_i[2];
|
195 |
|
|
|
196 |
|
|
assign ch3_in_dst_rdy = out_dst_rdy;
|
197 |
|
|
assign ch3_out_src_rdy = in_src_rdy;
|
198 |
|
|
assign ch3_out_sof = in_sof;
|
199 |
|
|
assign ch3_out_eof = in_eof;
|
200 |
|
|
assign ch3_out_data = in_data;
|
201 |
|
|
assign ch3_wen = wenables_i[3];
|
202 |
|
|
assign ch3_ren = renables_i[3];
|
203 |
|
|
|
204 |
|
|
assign ch4_in_dst_rdy = out_dst_rdy;
|
205 |
|
|
assign ch4_out_src_rdy = in_src_rdy;
|
206 |
|
|
assign ch4_out_sof = in_sof;
|
207 |
|
|
assign ch4_out_eof = in_eof;
|
208 |
|
|
assign ch4_out_data = in_data;
|
209 |
|
|
assign ch4_wen = wenables_i[4];
|
210 |
|
|
assign ch4_ren = renables_i[4];
|
211 |
|
|
|
212 |
|
|
assign ch5_in_dst_rdy = out_dst_rdy;
|
213 |
|
|
assign ch5_out_src_rdy = in_src_rdy;
|
214 |
|
|
assign ch5_out_sof = in_sof;
|
215 |
|
|
assign ch5_out_eof = in_eof;
|
216 |
|
|
assign ch5_out_data = in_data;
|
217 |
|
|
assign ch5_wen = wenables_i[5];
|
218 |
|
|
assign ch5_ren = renables_i[5];
|
219 |
|
|
|
220 |
|
|
assign ch6_in_dst_rdy = out_dst_rdy;
|
221 |
|
|
assign ch6_out_src_rdy = in_src_rdy;
|
222 |
|
|
assign ch6_out_sof = in_sof;
|
223 |
|
|
assign ch6_out_eof = in_eof;
|
224 |
|
|
assign ch6_out_data = in_data;
|
225 |
|
|
assign ch6_wen = wenables_i[6];
|
226 |
|
|
assign ch6_ren = renables_i[6];
|
227 |
|
|
|
228 |
|
|
endmodule
|