forked from dillonhuff/clockwork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cascade_lake.v
374 lines (366 loc) · 11.7 KB
/
cascade_lake.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
// Module `Mem` defined externally
module cu_input (
input clk,
input [15:0] in_input_read [0:0],
output [15:0] buf1_input_write [0:0]
);
assign buf1_input_write[0] = in_input_read[0];
endmodule
module coreir_reg #(
parameter width = 1,
parameter clk_posedge = 1,
parameter init = 1
) (
input clk,
input [width-1:0] in,
output [width-1:0] out
);
reg [width-1:0] outReg=init;
wire real_clk;
assign real_clk = clk_posedge ? clk : ~clk;
always @(posedge real_clk) begin
outReg <= in;
end
assign out = outReg;
endmodule
module mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
parameter init = 16'h0000
) (
input [15:0] in,
input clk,
output [15:0] out
);
wire reg0_clk;
wire [15:0] reg0_in;
assign reg0_clk = clk;
assign reg0_in = in;
coreir_reg #(
.clk_posedge(1'b1),
.init(init),
.width(16)
) reg0 (
.clk(reg0_clk),
.in(reg0_in),
.out(out)
);
endmodule
module cu_output (
input clk,
input [15:0] buf2_output_read [8:0],
output [15:0] out_output_write [0:0]
);
assign out_output_write[0] = 16'((16'((16'((16'((16'((16'((16'((16'(buf2_output_read[0] + buf2_output_read[1])) + buf2_output_read[2])) + buf2_output_read[3])) + buf2_output_read[4])) + buf2_output_read[5])) + buf2_output_read[6])) + buf2_output_read[7])) + buf2_output_read[8]);
endmodule
module cu_conv (
input clk,
input [15:0] buf1_conv_read [8:0],
output [15:0] buf2_conv_write [0:0]
);
assign buf2_conv_write[0] = 16'((16'((16'((16'((16'((16'((16'((16'(buf1_conv_read[0] + buf1_conv_read[1])) + buf1_conv_read[2])) + buf1_conv_read[3])) + buf1_conv_read[4])) + buf1_conv_read[5])) + buf1_conv_read[6])) + buf1_conv_read[7])) + buf1_conv_read[8]);
endmodule
module buf2_ub (
input clk,
input reset,
input [15:0] conv_write [0:0],
output [15:0] output_read [8:0]
);
wire [15:0] d_reg__U22_in;
wire d_reg__U22_clk;
wire [15:0] d_reg__U22_out;
wire [15:0] d_reg__U23_in;
wire d_reg__U23_clk;
wire [15:0] d_reg__U23_out;
wire [15:0] d_reg__U24_in;
wire d_reg__U24_clk;
wire [15:0] d_reg__U24_out;
wire [15:0] d_reg__U25_in;
wire d_reg__U25_clk;
wire [15:0] d_reg__U25_out;
wire [15:0] d_reg__U26_in;
wire d_reg__U26_clk;
wire [15:0] d_reg__U26_out;
wire [15:0] d_reg__U27_in;
wire d_reg__U27_clk;
wire [15:0] d_reg__U27_out;
wire ub_buf2_conv_12_to_buf2_output_3_rst_n;
wire ub_buf2_conv_12_to_buf2_output_3_clk_en;
wire ub_buf2_conv_12_to_buf2_output_3_clk;
wire [15:0] ub_buf2_conv_12_to_buf2_output_3_data_in_0;
wire [15:0] ub_buf2_conv_12_to_buf2_output_3_data_out_0;
wire [15:0] ub_buf2_conv_12_to_buf2_output_3_data_out_1;
wire ub_buf2_conv_12_to_buf2_output_3_flush;
assign d_reg__U22_in = conv_write[0];
assign d_reg__U22_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U22 (
.in(d_reg__U22_in),
.clk(d_reg__U22_clk),
.out(d_reg__U22_out)
);
assign d_reg__U23_in = d_reg__U22_out;
assign d_reg__U23_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U23 (
.in(d_reg__U23_in),
.clk(d_reg__U23_clk),
.out(d_reg__U23_out)
);
assign d_reg__U24_in = ub_buf2_conv_12_to_buf2_output_3_data_out_1;
assign d_reg__U24_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U24 (
.in(d_reg__U24_in),
.clk(d_reg__U24_clk),
.out(d_reg__U24_out)
);
assign d_reg__U25_in = d_reg__U24_out;
assign d_reg__U25_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U25 (
.in(d_reg__U25_in),
.clk(d_reg__U25_clk),
.out(d_reg__U25_out)
);
assign d_reg__U26_in = ub_buf2_conv_12_to_buf2_output_3_data_out_0;
assign d_reg__U26_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U26 (
.in(d_reg__U26_in),
.clk(d_reg__U26_clk),
.out(d_reg__U26_out)
);
assign d_reg__U27_in = d_reg__U26_out;
assign d_reg__U27_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U27 (
.in(d_reg__U27_in),
.clk(d_reg__U27_clk),
.out(d_reg__U27_out)
);
assign ub_buf2_conv_12_to_buf2_output_3_rst_n = 1'b0;
assign ub_buf2_conv_12_to_buf2_output_3_clk_en = 1'b1;
assign ub_buf2_conv_12_to_buf2_output_3_clk = clk;
assign ub_buf2_conv_12_to_buf2_output_3_data_in_0 = conv_write[0];
assign ub_buf2_conv_12_to_buf2_output_3_flush = reset;
cwlib_Mem__confignull__has_flushTrue__has_resetFalse__has_stencil_validFalse__has_validFalse__num_input1__num_output2__width16 #(
.mode("lake")
) ub_buf2_conv_12_to_buf2_output_3 (
.rst_n(ub_buf2_conv_12_to_buf2_output_3_rst_n),
.clk_en(ub_buf2_conv_12_to_buf2_output_3_clk_en),
.clk(ub_buf2_conv_12_to_buf2_output_3_clk),
.data_in_0(ub_buf2_conv_12_to_buf2_output_3_data_in_0),
.data_out_0(ub_buf2_conv_12_to_buf2_output_3_data_out_0),
.data_out_1(ub_buf2_conv_12_to_buf2_output_3_data_out_1),
.flush(ub_buf2_conv_12_to_buf2_output_3_flush)
);
assign output_read[8] = conv_write[0];
assign output_read[7] = d_reg__U22_out;
assign output_read[6] = d_reg__U23_out;
assign output_read[5] = ub_buf2_conv_12_to_buf2_output_3_data_out_1;
assign output_read[4] = d_reg__U24_out;
assign output_read[3] = d_reg__U25_out;
assign output_read[2] = ub_buf2_conv_12_to_buf2_output_3_data_out_0;
assign output_read[1] = d_reg__U26_out;
assign output_read[0] = d_reg__U27_out;
endmodule
module buf1_ub (
input clk,
input reset,
output [15:0] conv_read [8:0],
input [15:0] input_write [0:0]
);
wire [15:0] d_reg__U16_in;
wire d_reg__U16_clk;
wire [15:0] d_reg__U16_out;
wire [15:0] d_reg__U17_in;
wire d_reg__U17_clk;
wire [15:0] d_reg__U17_out;
wire [15:0] d_reg__U18_in;
wire d_reg__U18_clk;
wire [15:0] d_reg__U18_out;
wire [15:0] d_reg__U19_in;
wire d_reg__U19_clk;
wire [15:0] d_reg__U19_out;
wire [15:0] d_reg__U20_in;
wire d_reg__U20_clk;
wire [15:0] d_reg__U20_out;
wire [15:0] d_reg__U21_in;
wire d_reg__U21_clk;
wire [15:0] d_reg__U21_out;
wire ub_buf1_input_10_to_buf1_conv_15_rst_n;
wire ub_buf1_input_10_to_buf1_conv_15_clk_en;
wire ub_buf1_input_10_to_buf1_conv_15_clk;
wire [15:0] ub_buf1_input_10_to_buf1_conv_15_data_in_0;
wire [15:0] ub_buf1_input_10_to_buf1_conv_15_data_out_0;
wire [15:0] ub_buf1_input_10_to_buf1_conv_15_data_out_1;
wire ub_buf1_input_10_to_buf1_conv_15_flush;
assign d_reg__U16_in = input_write[0];
assign d_reg__U16_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U16 (
.in(d_reg__U16_in),
.clk(d_reg__U16_clk),
.out(d_reg__U16_out)
);
assign d_reg__U17_in = d_reg__U16_out;
assign d_reg__U17_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U17 (
.in(d_reg__U17_in),
.clk(d_reg__U17_clk),
.out(d_reg__U17_out)
);
assign d_reg__U18_in = ub_buf1_input_10_to_buf1_conv_15_data_out_1;
assign d_reg__U18_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U18 (
.in(d_reg__U18_in),
.clk(d_reg__U18_clk),
.out(d_reg__U18_out)
);
assign d_reg__U19_in = d_reg__U18_out;
assign d_reg__U19_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U19 (
.in(d_reg__U19_in),
.clk(d_reg__U19_clk),
.out(d_reg__U19_out)
);
assign d_reg__U20_in = ub_buf1_input_10_to_buf1_conv_15_data_out_0;
assign d_reg__U20_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U20 (
.in(d_reg__U20_in),
.clk(d_reg__U20_clk),
.out(d_reg__U20_out)
);
assign d_reg__U21_in = d_reg__U20_out;
assign d_reg__U21_clk = clk;
mantle_reg__has_clrFalse__has_enFalse__has_rstFalse__width16 #(
.init(16'h0000)
) d_reg__U21 (
.in(d_reg__U21_in),
.clk(d_reg__U21_clk),
.out(d_reg__U21_out)
);
assign ub_buf1_input_10_to_buf1_conv_15_rst_n = 1'b0;
assign ub_buf1_input_10_to_buf1_conv_15_clk_en = 1'b1;
assign ub_buf1_input_10_to_buf1_conv_15_clk = clk;
assign ub_buf1_input_10_to_buf1_conv_15_data_in_0 = input_write[0];
assign ub_buf1_input_10_to_buf1_conv_15_flush = reset;
cwlib_Mem__confignull__has_flushTrue__has_resetFalse__has_stencil_validFalse__has_validFalse__num_input1__num_output2__width16 #(
.mode("lake")
) ub_buf1_input_10_to_buf1_conv_15 (
.rst_n(ub_buf1_input_10_to_buf1_conv_15_rst_n),
.clk_en(ub_buf1_input_10_to_buf1_conv_15_clk_en),
.clk(ub_buf1_input_10_to_buf1_conv_15_clk),
.data_in_0(ub_buf1_input_10_to_buf1_conv_15_data_in_0),
.data_out_0(ub_buf1_input_10_to_buf1_conv_15_data_out_0),
.data_out_1(ub_buf1_input_10_to_buf1_conv_15_data_out_1),
.flush(ub_buf1_input_10_to_buf1_conv_15_flush)
);
assign conv_read[8] = input_write[0];
assign conv_read[7] = d_reg__U16_out;
assign conv_read[6] = d_reg__U17_out;
assign conv_read[5] = ub_buf1_input_10_to_buf1_conv_15_data_out_1;
assign conv_read[4] = d_reg__U18_out;
assign conv_read[3] = d_reg__U19_out;
assign conv_read[2] = ub_buf1_input_10_to_buf1_conv_15_data_out_0;
assign conv_read[1] = d_reg__U20_out;
assign conv_read[0] = d_reg__U21_out;
endmodule
module cascade_lake (
input clk,
input reset,
output in_input_read_en,
input [15:0] in_input_read [0:0],
output out_output_write_valid,
output [15:0] out_output_write [0:0]
);
wire buf1_clk;
wire buf1_reset;
wire [15:0] buf1_conv_read [8:0];
wire [15:0] buf1_input_write [0:0];
wire buf2_clk;
wire buf2_reset;
wire [15:0] buf2_conv_write [0:0];
wire [15:0] buf2_output_read [8:0];
wire conv_clk;
wire [15:0] conv_buf1_conv_read [8:0];
wire [15:0] conv_buf2_conv_write [0:0];
wire input_clk;
wire [15:0] input_in_input_read [0:0];
wire [15:0] input_buf1_input_write [0:0];
wire output_clk;
wire [15:0] output_buf2_output_read [8:0];
wire [15:0] output_out_output_write [0:0];
assign buf1_clk = clk;
assign buf1_reset = reset;
assign buf1_input_write[0] = input_buf1_input_write[0];
buf1_ub buf1 (
.clk(buf1_clk),
.reset(buf1_reset),
.conv_read(buf1_conv_read),
.input_write(buf1_input_write)
);
assign buf2_clk = clk;
assign buf2_reset = reset;
assign buf2_conv_write[0] = conv_buf2_conv_write[0];
buf2_ub buf2 (
.clk(buf2_clk),
.reset(buf2_reset),
.conv_write(buf2_conv_write),
.output_read(buf2_output_read)
);
assign conv_clk = clk;
assign conv_buf1_conv_read[8] = buf1_conv_read[8];
assign conv_buf1_conv_read[7] = buf1_conv_read[7];
assign conv_buf1_conv_read[6] = buf1_conv_read[6];
assign conv_buf1_conv_read[5] = buf1_conv_read[5];
assign conv_buf1_conv_read[4] = buf1_conv_read[4];
assign conv_buf1_conv_read[3] = buf1_conv_read[3];
assign conv_buf1_conv_read[2] = buf1_conv_read[2];
assign conv_buf1_conv_read[1] = buf1_conv_read[1];
assign conv_buf1_conv_read[0] = buf1_conv_read[0];
cu_conv conv (
.clk(conv_clk),
.buf1_conv_read(conv_buf1_conv_read),
.buf2_conv_write(conv_buf2_conv_write)
);
assign input_clk = clk;
assign input_in_input_read[0] = in_input_read[0];
cu_input input (
.clk(input_clk),
.in_input_read(input_in_input_read),
.buf1_input_write(input_buf1_input_write)
);
assign output_clk = clk;
assign output_buf2_output_read[8] = buf2_output_read[8];
assign output_buf2_output_read[7] = buf2_output_read[7];
assign output_buf2_output_read[6] = buf2_output_read[6];
assign output_buf2_output_read[5] = buf2_output_read[5];
assign output_buf2_output_read[4] = buf2_output_read[4];
assign output_buf2_output_read[3] = buf2_output_read[3];
assign output_buf2_output_read[2] = buf2_output_read[2];
assign output_buf2_output_read[1] = buf2_output_read[1];
assign output_buf2_output_read[0] = buf2_output_read[0];
cu_output output (
.clk(output_clk),
.buf2_output_read(output_buf2_output_read),
.out_output_write(output_out_output_write)
);
assign in_input_read_en = 1'b0;
assign out_output_write_valid = 1'b0;
assign out_output_write[0] = output_out_output_write[0];
endmodule