Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / libs / n2sram / tlbs / n2_tlb_tl_64x59_cust_l / n2_tlb_tl_64x59_cust / rtl / n2_tlb_tl_64x59_cust.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: n2_tlb_tl_64x59_cust.v
4// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
5// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
6//
7// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8//
9// This program is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; version 2 of the License.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21//
22// For the avoidance of doubt, and except that if any non-GPL license
23// choice is available it will apply instead, Sun elects to use only
24// the General Public License version 2 (GPLv2) at this time for any
25// software where a choice of GPL license versions is made
26// available with the language indicating that GPLv2 or any later version
27// may be used, or where a choice of which version of the GPL is applied is
28// otherwise unspecified.
29//
30// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
31// CA 95054 USA or visit www.sun.com if you need additional information or
32// have any questions.
33//
34// ========== Copyright Header End ============================================
35module n2_tlb_tl_64x59_cust (
36 l2clk,
37 scan_in,
38 tcu_pce_ov,
39 pce,
40 tcu_aclk,
41 tcu_bclk,
42 tcu_se_scancollar_in,
43 tcu_se_scancollar_out,
44 tcu_array_wr_inhibit,
45 tcu_scan_en,
46 disable_clear_ubit,
47 scan_out,
48 tlb_bypass,
49 tlb_wr_vld,
50 tlb_rd_vld,
51 tlb_cam_vld,
52 tlb_rw_index,
53 tlb_rw_index_vld,
54 tlb_demap,
55 tlb_demap_context,
56 tlb_demap_all,
57 tlb_demap_real,
58 tte_tag,
59 tte_ubit,
60 tte_page_size_mask,
61 tte_data,
62 tlb_va,
63 cache_ptag_w0,
64 cache_ptag_w1,
65 cache_ptag_w2,
66 cache_ptag_w3,
67 cache_ptag_w4,
68 cache_ptag_w5,
69 cache_ptag_w6,
70 cache_ptag_w7,
71 cache_set_vld,
72 cache_way_hit,
73 cache_hit,
74 tlb_cam_hit,
75 tlb_cam_mhit,
76 tlb_context0_hit,
77 tlb_pgnum_crit,
78 tlb_pgnum,
79 tlb_tte_data,
80 tlb_tte_tag,
81 tlb_tte_u_bit,
82 tlb_tte_data_parity) ;
83wire pce_ov;
84wire stop;
85wire siclk;
86wire soclk;
87wire se;
88wire l1clk_in;
89wire l1clk_free;
90wire [73:0] cam_ctl_lat_scanin;
91wire [73:0] cam_ctl_lat_scanout;
92wire [65:0] tte_tag_1;
93wire tte_ubit_1;
94wire tlb_wr_1_in_unused;
95wire tlb_rd_1_unused;
96wire tlb_cam_1_in;
97wire demap_1_in;
98wire demap_context_1;
99wire demap_all_1;
100wire demap_real_1;
101wire [73:0] lat_l_unused;
102wire [65:0] tte_tag_1_dout;
103wire tte_ubit_1_unused;
104wire tlb_wr_1_in_dout;
105wire tlb_rd_1_in_dout;
106wire tlb_cam_1_in_dout;
107wire demap_1_in_unused;
108wire demap_context_1_unused;
109wire demap_all_1_unused;
110wire demap_real_1_unused;
111wire [73:0] dout_l_unused;
112wire demap_page_1_unused;
113wire wr_inhibit_;
114wire tlb_wr_1_dout;
115wire tlb_rd_1_dout;
116wire tlb_cam_1;
117wire tlb_cam_1_dout;
118wire demap_1;
119wire [2:0] page_size_mask_reg_scanin;
120wire [2:0] page_size_mask_reg_scanout;
121wire [2:0] tte_page_size_mask_1;
122wire disable_clear_ubit_reg_scanin;
123wire disable_clear_ubit_reg_scanout;
124wire disable_clear_ubit_1_in;
125wire disable_clear_ubit_1;
126wire tlb_bypass_reg_scanin;
127wire tlb_bypass_reg_scanout;
128wire tlb_bypass_1;
129wire [1:0] vaddr_reg_scanin;
130wire [1:0] vaddr_reg_scanout;
131wire [12:11] va_1;
132wire [37:0] tte_data_reg_scanin;
133wire [37:0] tte_data_reg_scanout;
134wire [37:0] tte_data_1;
135wire [5:0] tlb_replacement_index;
136wire [5:0] rw_index_0;
137wire [5:0] rw_index_reg_scanin;
138wire [5:0] rw_index_reg_scanout;
139wire [5:0] rw_index_1;
140wire rw_index_vld_reg_scanin;
141wire rw_index_vld_reg_scanout;
142wire rw_index_vld_unused;
143wire [39:11] pa_1;
144wire tlb_cam_hit_1;
145wire l1clk_out;
146wire [2:0] tlb_cam_hit_reg_scanin;
147wire [2:0] tlb_cam_hit_reg_scanout;
148wire multiple_match;
149wire context0_hit;
150wire tlb_cam_mhit_b;
151wire [26:0] pa_reg_scanin;
152wire [26:0] pa_reg_scanout;
153wire [39:13] pa_2;
154wire [37:0] tte_data_out_reg_scanin;
155wire [37:0] tte_data_out_reg_scanout;
156wire [37:0] rd_tte_data;
157wire [65:0] rd_tte_tag;
158wire [65:0] rd_tte_tag_b;
159wire [65:0] tte_tag_out_reg_scanin;
160wire [65:0] tte_tag_out_reg_scanout;
161wire [65:0] tlb_tte_tag_b;
162wire rd_tte_u_bit;
163wire rd_tte_u_bit_b;
164wire tte_u_bit_out_reg_scanin;
165wire tte_u_bit_out_reg_scanout;
166wire tlb_tte_u_bit_b;
167wire [7:0] cache_way_hit_in;
168wire [7:0] cache_way_hit_in_b;
169wire [7:0] cache_way_hit_reg_scanin;
170wire [7:0] cache_way_hit_reg_scanout;
171wire [7:0] cache_way_hit_b;
172wire data_parity_0;
173wire [3:0] mm_debug_reg_scanin;
174wire [3:0] mm_debug_reg_scanout;
175wire [3:0] mm_debug;
176wire tag_read_mux_control;
177
178
179
180
181input l2clk;
182input scan_in;
183input tcu_pce_ov;
184input pce;
185input tcu_aclk;
186input tcu_bclk;
187input tcu_se_scancollar_in;
188input tcu_se_scancollar_out;
189input tcu_array_wr_inhibit;
190input tcu_scan_en ;
191input disable_clear_ubit;
192output scan_out;
193
194input tlb_bypass;
195input tlb_wr_vld;
196input tlb_rd_vld;
197input tlb_cam_vld;
198input [5:0] tlb_rw_index;
199input tlb_rw_index_vld;
200input tlb_demap;
201input tlb_demap_context;
202input tlb_demap_all;
203input tlb_demap_real;
204
205input [65:0] tte_tag;
206input tte_ubit;
207input [2:0] tte_page_size_mask;
208input [37:0] tte_data;
209input [12:11] tlb_va; // Incoming VA
210
211// Cache tag compare
212input [39:11] cache_ptag_w0;
213input [39:11] cache_ptag_w1;
214input [39:11] cache_ptag_w2;
215input [39:11] cache_ptag_w3;
216input [39:11] cache_ptag_w4;
217input [39:11] cache_ptag_w5;
218input [39:11] cache_ptag_w6;
219input [39:11] cache_ptag_w7;
220input [7:0] cache_set_vld;
221
222output [7:0] cache_way_hit;
223output cache_hit;
224output tlb_cam_hit;
225output tlb_cam_mhit;
226output tlb_context0_hit;
227output [39:13] tlb_pgnum_crit; // PA unflopped
228output [39:13] tlb_pgnum; // PA flopped
229output [37:0] tlb_tte_data;
230output [65:0] tlb_tte_tag;
231output tlb_tte_u_bit;
232output tlb_tte_data_parity;
233
234`ifndef FPGA
235// synopsys translate_off
236`endif
237
238assign pce_ov = tcu_pce_ov;
239assign stop = 1'b0;
240assign siclk = tcu_aclk ;
241assign soclk = tcu_bclk;
242assign se = tcu_scan_en;
243
244
245// 0in bits_on -var {tlb_wr_vld,tlb_rd_vld,tlb_cam_vld,tlb_demap} -max 1
246// 0in bits_on -var {tlb_demap_context,tlb_demap_all,tlb_demap_real} -max 1
247// 0in bits_on -var {tlb_cam_vld,tlb_bypass} -max 1
248// 0in assert -var (~(tlb_demap_context & ~tlb_demap)) -message "Cannot asert tlb_demap_context without tlb_demap"
249// 0in assert -var (~(tlb_demap_all & ~tlb_demap)) -message "Cannot asert tlb_demap_all without tlb_demap"
250// 0in assert -var (~(tlb_demap_real & ~tlb_demap)) -message "Cannot asert tlb_demap_real without tlb_demap"
251// 0in known_driven -var tlb_cam_hit
252
253
254///////////////////////////////////////////////////////////////
255// Input flops
256///////////////////////////////////////////////////////////////
257
258n2_tlb_tl_64x59_cust_l1clkhdr_ctl_macro in_clken (
259 .l2clk(l2clk),
260 .l1en(pce),
261 .se(tcu_se_scancollar_in),
262 .l1clk(l1clk_in),
263 .pce_ov(pce_ov),
264 .stop(stop)
265);
266
267n2_tlb_tl_64x59_cust_l1clkhdr_ctl_macro free_clken (
268 .l2clk(l2clk),
269 .l1en(pce),
270 .se(se),
271 .l1clk(l1clk_free),
272 .pce_ov(pce_ov),
273 .stop(stop)
274);
275
276// Put all the CAM controls and data in one latch to avoid races
277// Doesn't really matter any more... also this gets split up in
278// gate level model
279n2_tlb_tl_64x59_cust_sram_msff_mo_macro__fs_1__width_74 cam_ctl_lat (
280 .scan_in(cam_ctl_lat_scanin[73:0]),
281 .scan_out(cam_ctl_lat_scanout[73:0]),
282 .l1clk (l1clk_in),
283 .and_clk(l1clk_free),
284// 73:8 7 6
285 .d ({tte_tag [65:0],tte_ubit ,tlb_wr_vld ,
286// 5 4 3 2
287 tlb_rd_vld,tlb_cam_vld ,tlb_demap ,tlb_demap_context,
288// 1 0
289 tlb_demap_all,tlb_demap_real}),
290 .mq ({tte_tag_1[65:0],tte_ubit_1,tlb_wr_1_in_unused,
291 tlb_rd_1_unused ,tlb_cam_1_in,demap_1_in,demap_context_1 ,
292 demap_all_1 ,demap_real_1 }),
293 .mq_l (lat_l_unused[73:0]),
294// NOTE: Some signals on dout port ARE used by bench (itlb_wr.v)!
295 .q ({tte_tag_1_dout[65:0],tte_ubit_1_unused,tlb_wr_1_in_dout,
296 tlb_rd_1_in_dout,tlb_cam_1_in_dout,demap_1_in_unused,demap_context_1_unused ,
297 demap_all_1_unused ,demap_real_1_unused }),
298 .q_l (dout_l_unused[73:0]),
299 .siclk(siclk),
300 .soclk(soclk)
301);
302
303// This is strictly for DV
304assign demap_page_1_unused =
305 demap_1_in_unused & ~demap_context_1_unused & ~demap_all_1_unused &
306 ~demap_real_1_unused;
307
308n2_tlb_tl_64x59_cust_inv_macro__width_1 wr_inhibit_b_inv (
309 .din(tcu_array_wr_inhibit),
310 .dout(wr_inhibit_)
311);
312
313n2_tlb_tl_64x59_cust_and_macro__ports_2__width_1 tlb_wr_dout_and (
314 .din0(tlb_wr_1_in_dout),
315 .din1(wr_inhibit_),
316 .dout(tlb_wr_1_dout)
317);
318
319n2_tlb_tl_64x59_cust_and_macro__ports_2__width_1 tlb_rd_dout_and (
320 .din0(tlb_rd_1_in_dout),
321 .din1(wr_inhibit_),
322 .dout(tlb_rd_1_dout)
323);
324
325n2_tlb_tl_64x59_cust_and_macro__ports_2__width_1 tlb_cam_and (
326 .din0(tlb_cam_1_in),
327 .din1(wr_inhibit_),
328 .dout(tlb_cam_1)
329);
330
331n2_tlb_tl_64x59_cust_and_macro__ports_2__width_1 tlb_cam_dout_and (
332 .din0(tlb_cam_1_in_dout),
333 .din1(wr_inhibit_),
334 .dout(tlb_cam_1_dout)
335);
336
337n2_tlb_tl_64x59_cust_and_macro__ports_2__width_1 demap_and (
338 .din0(demap_1_in),
339 .din1(wr_inhibit_),
340 .dout(demap_1)
341);
342
343n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_3 page_size_mask_reg (
344 .scan_in(page_size_mask_reg_scanin[2:0]),
345 .scan_out(page_size_mask_reg_scanout[2:0]),
346 .l1clk(l1clk_in),
347 .din(tte_page_size_mask[2:0]),
348 .dout(tte_page_size_mask_1[2:0]),
349 .siclk(siclk),
350 .soclk(soclk)
351);
352
353n2_tlb_tl_64x59_cust_msff_ctl_macro__width_1 disable_clear_ubit_reg (
354 .scan_in(disable_clear_ubit_reg_scanin),
355 .scan_out(disable_clear_ubit_reg_scanout),
356 .l1clk(l1clk_in),
357 .din(disable_clear_ubit),
358 .dout(disable_clear_ubit_1_in),
359 .siclk(siclk),
360 .soclk(soclk)
361);
362
363n2_tlb_tl_64x59_cust_and_macro__ports_2__width_1 disable_clear_ubit_and (
364 .din0(disable_clear_ubit_1_in),
365 .din1(wr_inhibit_),
366 .dout(disable_clear_ubit_1)
367);
368
369n2_tlb_tl_64x59_cust_msff_ctl_macro__width_1 tlb_bypass_reg (
370 .scan_in(tlb_bypass_reg_scanin),
371 .scan_out(tlb_bypass_reg_scanout),
372 .l1clk(l1clk_in),
373 .din(tlb_bypass),
374 .dout(tlb_bypass_1),
375 .siclk(siclk),
376 .soclk(soclk)
377);
378
379n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_2 vaddr_reg (
380 .scan_in(vaddr_reg_scanin[1:0]),
381 .scan_out(vaddr_reg_scanout[1:0]),
382 .l1clk(l1clk_in),
383 .din(tlb_va[12:11]),
384 .dout(va_1[12:11]),
385 .siclk(siclk),
386 .soclk(soclk)
387);
388
389n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_38 tte_data_reg (
390 .scan_in(tte_data_reg_scanin[37:0]),
391 .scan_out(tte_data_reg_scanout[37:0]),
392 .l1clk(l1clk_in),
393 .din(tte_data[37:0]),
394 .dout(tte_data_1[37:0]),
395 .siclk(siclk),
396 .soclk(soclk)
397);
398
399
400/////////////////////////////////////////////////////////////////////
401// Write index muxing
402//////////////////////////////////////////////////////////////////////
403
404n2_tlb_tl_64x59_cust_mux_macro__mux_aope__ports_2__width_6 rw_index_mux (
405 .din0 (tlb_rw_index[5:0]),
406 .din1 (tlb_replacement_index[5:0]),
407 .sel0 (tlb_rw_index_vld),
408 .dout (rw_index_0[5:0])
409);
410
411// The output of this flop is used by the bench (dtlb_wr.vpal)
412n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_6 rw_index_reg (
413 .scan_in(rw_index_reg_scanin[5:0]),
414 .scan_out(rw_index_reg_scanout[5:0]),
415 .l1clk(l1clk_in),
416 .din(rw_index_0[5:0]),
417 .dout(rw_index_1[5:0]),
418 .siclk(siclk),
419 .soclk(soclk)
420);
421
422// This flop is here to mirror the circuit; it has no functional purpose;
423// just want it here for 'debug' even though this signal
424// is flopped outside the circuit
425n2_tlb_tl_64x59_cust_msff_ctl_macro__width_1 rw_index_vld_reg (
426 .scan_in(rw_index_vld_reg_scanin),
427 .scan_out(rw_index_vld_reg_scanout),
428 .l1clk(l1clk_in),
429 .din(tlb_rw_index_vld),
430 .dout(rw_index_vld_unused),
431 .siclk(siclk),
432 .soclk(soclk)
433);
434
435
436/////////////////////////////////////////////////////////////////////
437// Array behavioral
438/////////////////////////////////////////////////////////////////////
439
440n2_tlb_tl_64x59_array array (
441// Inputs
442 .l1clk (l1clk_free),
443 .tlb_bypass (tlb_bypass_1),
444 .tlb_wr_flopped (tlb_wr_1_dout),
445 .tlb_rd_flopped (tlb_rd_1_dout),
446 .rw_index (rw_index_1[5:0]),
447 .tlb_cam (tlb_cam_1),
448 .tlb_cam_flopped(tlb_cam_1_dout),
449 .disable_clear_ubit(disable_clear_ubit_1),
450 .demap (demap_1),
451 .demap_context (demap_context_1),
452 .demap_all (demap_all_1),
453 .demap_real (demap_real_1),
454 .tte_tag (tte_tag_1[65:0]),
455 .tte_tag_flopped(tte_tag_1_dout[65:0]),
456 .tte_ubit (tte_ubit_1),
457 .tte_page_size_mask(tte_page_size_mask_1[2:0]),
458 .tte_data (tte_data_1[37:0]),
459 .va (va_1[12:11]),
460// Outputs
461 .pa (pa_1[39:11]),
462 .tlb_cam_hit (tlb_cam_hit_1),
463 .tag_read_mux_control(tag_read_mux_control),
464 .context0_hit(context0_hit),
465 .multiple_match(multiple_match),
466 .rd_tte_data(rd_tte_data[37:0]),
467 .rd_tte_tag(rd_tte_tag[65:0]),
468 .rd_tte_u_bit(rd_tte_u_bit),
469 .tlb_replacement_index(tlb_replacement_index[5:0])
470);
471
472// Unflopped output
473assign tlb_pgnum_crit[39:13] = pa_1[39:13];
474
475//////////////////////////////////////////////////
476// Flop the output data
477//////////////////////////////////////////////////
478
479n2_tlb_tl_64x59_cust_l1clkhdr_ctl_macro out_clken (
480 .l2clk(l2clk),
481 .l1en(pce),
482 .se(tcu_se_scancollar_out),
483 .l1clk(l1clk_out),
484 .pce_ov(pce_ov),
485 .stop(stop)
486);
487
488n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_3 tlb_cam_hit_reg (
489 .scan_in(tlb_cam_hit_reg_scanin[2:0]),
490 .scan_out(tlb_cam_hit_reg_scanout[2:0]),
491 .l1clk(l1clk_out),
492 .din({tlb_cam_hit_1,multiple_match,context0_hit}),
493 .dout({tlb_cam_hit,tlb_cam_mhit,tlb_context0_hit}),
494 .siclk(siclk),
495 .soclk(soclk)
496);
497
498n2_tlb_tl_64x59_cust_inv_macro__width_1 tlb_cam_mhit_b_inv (
499 .din(tlb_cam_mhit),
500 .dout(tlb_cam_mhit_b)
501);
502
503n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_27 pa_reg (
504 .scan_in(pa_reg_scanin[26:0]),
505 .scan_out(pa_reg_scanout[26:0]),
506 .l1clk(l1clk_out),
507 .din(pa_1[39:13]),
508 .dout(pa_2[39:13]),
509 .siclk(siclk),
510 .soclk(soclk)
511);
512
513assign tlb_pgnum[39:13] = pa_2[39:13];
514
515n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_38 tte_data_out_reg (
516 .scan_in(tte_data_out_reg_scanin[37:0]),
517 .scan_out(tte_data_out_reg_scanout[37:0]),
518 .l1clk(l1clk_out),
519 .din(rd_tte_data[37:0]),
520 .dout(tlb_tte_data[37:0]),
521 .siclk(siclk),
522 .soclk(soclk)
523);
524
525n2_tlb_tl_64x59_cust_inv_macro__stack_66c__width_66 rd_tte_tag_b_inv (
526 .din(rd_tte_tag[65:0]),
527 .dout(rd_tte_tag_b[65:0])
528);
529
530n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_66 tte_tag_out_reg (
531 .scan_in(tte_tag_out_reg_scanin[65:0]),
532 .scan_out(tte_tag_out_reg_scanout[65:0]),
533 .l1clk(l1clk_out),
534 .din(rd_tte_tag_b[65:0]),
535 .dout(tlb_tte_tag_b[65:0]),
536 .siclk(siclk),
537 .soclk(soclk)
538);
539
540n2_tlb_tl_64x59_cust_inv_macro__stack_66c__width_66 tlb_tte_tag_inv (
541 .din(tlb_tte_tag_b[65:0]),
542 .dout(tlb_tte_tag[65:0])
543);
544
545n2_tlb_tl_64x59_cust_inv_macro__width_1 rd_tte_u_bit_b_inv (
546 .din(rd_tte_u_bit),
547 .dout(rd_tte_u_bit_b)
548);
549
550n2_tlb_tl_64x59_cust_msff_ctl_macro__width_1 tte_u_bit_out_reg (
551 .scan_in(tte_u_bit_out_reg_scanin),
552 .scan_out(tte_u_bit_out_reg_scanout),
553 .l1clk(l1clk_out),
554 .din(rd_tte_u_bit_b),
555 .dout(tlb_tte_u_bit_b),
556 .siclk(siclk),
557 .soclk(soclk)
558);
559
560n2_tlb_tl_64x59_cust_inv_macro__width_1 tlb_tte_u_bit_inv (
561 .din(tlb_tte_u_bit_b),
562 .dout(tlb_tte_u_bit)
563);
564
565///////////////////////////////////////////////////////////////
566// Tag compare logic
567///////////////////////////////////////////////////////////////
568
569n2_tlb_tl_64x59_cust_cmp_macro__width_32 way0_cmp (
570 .din0 ({cache_ptag_w0[39:11],cache_set_vld[0],1'b0 , 1'b0}),
571 .din1 ({pa_1[39:11], 1'b1, 1'b0 , 1'b0}),
572 .dout (cache_way_hit_in[0])
573);
574n2_tlb_tl_64x59_cust_cmp_macro__width_32 way1_cmp (
575 .din0 ({cache_ptag_w1[39:11],cache_set_vld[1],1'b0 , 1'b0}),
576 .din1 ({pa_1[39:11], 1'b1, 1'b0 , 1'b0}),
577 .dout (cache_way_hit_in[1])
578);
579n2_tlb_tl_64x59_cust_cmp_macro__width_32 way2_cmp (
580 .din0 ({cache_ptag_w2[39:11],cache_set_vld[2],1'b0 , 1'b0}),
581 .din1 ({pa_1[39:11], 1'b1, 1'b0 , 1'b0}),
582 .dout (cache_way_hit_in[2])
583);
584n2_tlb_tl_64x59_cust_cmp_macro__width_32 way3_cmp (
585 .din0 ({cache_ptag_w3[39:11],cache_set_vld[3],1'b0 , 1'b0}),
586 .din1 ({pa_1[39:11], 1'b1, 1'b0 , 1'b0}),
587 .dout (cache_way_hit_in[3])
588);
589n2_tlb_tl_64x59_cust_cmp_macro__width_32 way4_cmp (
590 .din0 ({cache_ptag_w4[39:11],cache_set_vld[4],1'b0 , 1'b0}),
591 .din1 ({pa_1[39:11], 1'b1, 1'b0 , 1'b0}),
592 .dout (cache_way_hit_in[4])
593);
594n2_tlb_tl_64x59_cust_cmp_macro__width_32 way5_cmp (
595 .din0 ({cache_ptag_w5[39:11],cache_set_vld[5],1'b0 , 1'b0}),
596 .din1 ({pa_1[39:11], 1'b1, 1'b0 , 1'b0}),
597 .dout (cache_way_hit_in[5])
598);
599n2_tlb_tl_64x59_cust_cmp_macro__width_32 way6_cmp (
600 .din0 ({cache_ptag_w6[39:11],cache_set_vld[6],1'b0 , 1'b0}),
601 .din1 ({pa_1[39:11], 1'b1, 1'b0 , 1'b0}),
602 .dout (cache_way_hit_in[6])
603);
604n2_tlb_tl_64x59_cust_cmp_macro__width_32 way7_cmp (
605 .din0 ({cache_ptag_w7[39:11],cache_set_vld[7],1'b0 , 1'b0}),
606 .din1 ({pa_1[39:11], 1'b1, 1'b0 , 1'b0}),
607 .dout (cache_way_hit_in[7])
608);
609
610n2_tlb_tl_64x59_cust_inv_macro__width_8 cache_way_hit_in_b_inv (
611 .din(cache_way_hit_in[7:0]),
612 .dout(cache_way_hit_in_b[7:0])
613);
614
615n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_8 cache_way_hit_reg (
616 .scan_in(cache_way_hit_reg_scanin[7:0]),
617 .scan_out(cache_way_hit_reg_scanout[7:0]),
618 .l1clk(l1clk_out),
619 .din(cache_way_hit_in_b[7:0]),
620 .dout(cache_way_hit_b[7:0]),
621 .siclk(siclk),
622 .soclk(soclk)
623);
624
625n2_tlb_tl_64x59_cust_inv_macro__width_8 cache_way_hit_inv (
626 .din(cache_way_hit_b[7:0]),
627 .dout(cache_way_hit[7:0])
628);
629
630n2_tlb_tl_64x59_cust_mux_macro__mux_aonpe__ports_8__width_1 cache_hit_or (
631 .din0 (cache_way_hit[0]),
632 .din1 (cache_way_hit[1]),
633 .din2 (cache_way_hit[2]),
634 .din3 (cache_way_hit[3]),
635 .din4 (cache_way_hit[4]),
636 .din5 (cache_way_hit[5]),
637 .din6 (cache_way_hit[6]),
638 .din7 (cache_way_hit[7]),
639 .sel0 (tlb_cam_mhit_b),
640 .sel1 (tlb_cam_mhit_b),
641 .sel2 (tlb_cam_mhit_b),
642 .sel3 (tlb_cam_mhit_b),
643 .sel4 (tlb_cam_mhit_b),
644 .sel5 (tlb_cam_mhit_b),
645 .sel6 (tlb_cam_mhit_b),
646 .sel7 (tlb_cam_mhit_b),
647 .dout (cache_hit)
648);
649
650///////////////////////////////////////////////////////////////
651// Parity checks for data
652///////////////////////////////////////////////////////////////
653
654n2_tlb_tl_64x59_cust_prty_macro__width_32 dprty0 (
655 .din (tlb_tte_data[31:0]),
656 .dout (data_parity_0)
657);
658n2_tlb_tl_64x59_cust_prty_macro__width_8 dprty1 (
659 .din ({2'b00,tlb_tte_data[36:32],data_parity_0}),
660 .dout (tlb_tte_data_parity)
661);
662
663
664
665// Flops for circuit use
666
667n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_4 mm_debug_reg (
668 .scan_in(mm_debug_reg_scanin[3:0]),
669 .scan_out(mm_debug_reg_scanout[3:0]),
670 .l1clk(l1clk_in),
671 .din(mm_debug[3:0]),
672 .dout(mm_debug[3:0]),
673 .siclk(siclk),
674 .soclk(soclk)
675);
676
677assign tag_read_mux_control = mm_debug[3];
678
679
680supply0 vss; // <- port for ground
681supply1 vdd; // <- port for power
682// Fullscan hookups begin
683assign tte_data_reg_scanin [0] = scan_in ;
684assign tte_data_reg_scanin [37:1] = tte_data_reg_scanout [36:0];
685
686assign vaddr_reg_scanin [0] = tte_data_reg_scanout [37];
687assign vaddr_reg_scanin [1] = vaddr_reg_scanout [0];
688
689assign rw_index_reg_scanin [5] = vaddr_reg_scanout [1];
690assign rw_index_reg_scanin [4] = rw_index_reg_scanout [5];
691assign rw_index_reg_scanin [3] = rw_index_reg_scanout [4];
692assign rw_index_reg_scanin [0] = rw_index_reg_scanout [3];
693assign rw_index_reg_scanin [1] = rw_index_reg_scanout [0];
694assign rw_index_reg_scanin [2] = rw_index_reg_scanout [1];
695
696
697assign rw_index_vld_reg_scanin = rw_index_reg_scanout [2];
698
699assign cam_ctl_lat_scanin [6] = rw_index_vld_reg_scanout ;
700assign cam_ctl_lat_scanin [5] = cam_ctl_lat_scanout [6];
701assign cam_ctl_lat_scanin [58] = cam_ctl_lat_scanout [5];
702assign cam_ctl_lat_scanin [60:59] = cam_ctl_lat_scanout [59:58];
703assign cam_ctl_lat_scanin [37] = cam_ctl_lat_scanout [60];
704assign cam_ctl_lat_scanin [56:38] = cam_ctl_lat_scanout [55:37];
705
706assign page_size_mask_reg_scanin [0] = cam_ctl_lat_scanout [56];
707
708assign cam_ctl_lat_scanin [21] = page_size_mask_reg_scanout [0];
709assign cam_ctl_lat_scanin [26:22] = cam_ctl_lat_scanout [25:21];
710
711assign page_size_mask_reg_scanin [1] = cam_ctl_lat_scanout [26];
712
713assign cam_ctl_lat_scanin [27] = page_size_mask_reg_scanout [1];
714assign cam_ctl_lat_scanin [29:28] = cam_ctl_lat_scanout [28:27];
715assign cam_ctl_lat_scanin [31] = cam_ctl_lat_scanout [29];
716assign cam_ctl_lat_scanin [33:32] = cam_ctl_lat_scanout [32:31];
717
718assign page_size_mask_reg_scanin [2] = cam_ctl_lat_scanout [33];
719
720assign cam_ctl_lat_scanin [34] = page_size_mask_reg_scanout [2];
721assign cam_ctl_lat_scanin [36:35] = cam_ctl_lat_scanout [35:34];
722assign cam_ctl_lat_scanin [57] = cam_ctl_lat_scanout [36];
723assign cam_ctl_lat_scanin [3] = cam_ctl_lat_scanout [57];
724assign cam_ctl_lat_scanin [4] = cam_ctl_lat_scanout [3];
725assign cam_ctl_lat_scanin [61] = cam_ctl_lat_scanout [4];
726assign cam_ctl_lat_scanin [73:62] = cam_ctl_lat_scanout [72:61];
727assign cam_ctl_lat_scanin [8] = cam_ctl_lat_scanout [73];
728assign cam_ctl_lat_scanin [20:9] = cam_ctl_lat_scanout [19:8];
729
730assign mm_debug_reg_scanin [3] = cam_ctl_lat_scanout [20];
731assign mm_debug_reg_scanin [2:0] = mm_debug_reg_scanout [3:1];
732
733assign cam_ctl_lat_scanin [7] = mm_debug_reg_scanout [0];
734
735assign disable_clear_ubit_reg_scanin = cam_ctl_lat_scanout [7];
736
737assign cam_ctl_lat_scanin [30] = disable_clear_ubit_reg_scanout ;
738assign cam_ctl_lat_scanin [0] = cam_ctl_lat_scanout [30];
739assign cam_ctl_lat_scanin [2] = cam_ctl_lat_scanout [0];
740assign cam_ctl_lat_scanin [1] = cam_ctl_lat_scanout [2];
741
742assign tlb_bypass_reg_scanin = cam_ctl_lat_scanout [1];
743
744assign tlb_cam_hit_reg_scanin [2] = tlb_bypass_reg_scanout ;
745assign tlb_cam_hit_reg_scanin [0] = tlb_cam_hit_reg_scanout [2];
746
747assign tte_tag_out_reg_scanin [22] = tlb_cam_hit_reg_scanout [0];
748
749assign tte_u_bit_out_reg_scanin = tte_tag_out_reg_scanout [22];
750
751assign tte_tag_out_reg_scanin [12] = tte_u_bit_out_reg_scanout ;
752assign tte_tag_out_reg_scanin [11:0] = tte_tag_out_reg_scanout [12:1];
753assign tte_tag_out_reg_scanin [65] = tte_tag_out_reg_scanout [0];
754assign tte_tag_out_reg_scanin [64:53] = tte_tag_out_reg_scanout [65:54];
755assign tte_tag_out_reg_scanin [49] = tte_tag_out_reg_scanout [53];
756assign tte_tag_out_reg_scanin [28] = tte_tag_out_reg_scanout [49];
757assign tte_tag_out_reg_scanin [27:23] = tte_tag_out_reg_scanout [28:24];
758assign tte_tag_out_reg_scanin [21] = tte_tag_out_reg_scanout [23];
759assign tte_tag_out_reg_scanin [20:13] = tte_tag_out_reg_scanout [21:14];
760assign tte_tag_out_reg_scanin [48] = tte_tag_out_reg_scanout [13];
761assign tte_tag_out_reg_scanin [47:29] = tte_tag_out_reg_scanout [48:30];
762assign tte_tag_out_reg_scanin [52] = tte_tag_out_reg_scanout [29];
763assign tte_tag_out_reg_scanin [51:50] = tte_tag_out_reg_scanout [52:51];
764
765assign tte_data_out_reg_scanin [0] = tte_tag_out_reg_scanout [50];
766assign tte_data_out_reg_scanin [37:1] = tte_data_out_reg_scanout [36:0];
767
768assign cache_way_hit_reg_scanin [0] = tte_data_out_reg_scanout [37];
769assign cache_way_hit_reg_scanin [7:1] = cache_way_hit_reg_scanout [6:0];
770
771assign pa_reg_scanin [0] = cache_way_hit_reg_scanout [7];
772assign pa_reg_scanin [26:1] = pa_reg_scanout [25:0];
773
774assign tlb_cam_hit_reg_scanin [1] = pa_reg_scanout [26];
775
776assign scan_out = tlb_cam_hit_reg_scanout [1];
777// Fullscan hookups end
778
779`ifndef FPGA
780// synopsys translate_on
781`endif
782
783endmodule
784
785
786
787
788
789
790// any PARAMS parms go into naming of macro
791
792module n2_tlb_tl_64x59_cust_l1clkhdr_ctl_macro (
793 l2clk,
794 l1en,
795 pce_ov,
796 stop,
797 se,
798 l1clk);
799
800
801 input l2clk;
802 input l1en;
803 input pce_ov;
804 input stop;
805 input se;
806 output l1clk;
807
808
809
810
811
812cl_sc1_l1hdr_8x c_0 (
813
814
815 .l2clk(l2clk),
816 .pce(l1en),
817 .l1clk(l1clk),
818 .se(se),
819 .pce_ov(pce_ov),
820 .stop(stop)
821);
822
823
824
825endmodule
826
827
828
829
830
831
832
833
834
835//
836// macro for cl_mc1_sram_msff_mo_{16,8,4}x flops
837//
838//
839
840
841
842
843
844module n2_tlb_tl_64x59_cust_sram_msff_mo_macro__fs_1__width_74 (
845 d,
846 scan_in,
847 l1clk,
848 and_clk,
849 siclk,
850 soclk,
851 mq,
852 mq_l,
853 scan_out,
854 q,
855 q_l);
856input [73:0] d;
857 input [73:0] scan_in;
858input l1clk;
859input and_clk;
860input siclk;
861input soclk;
862output [73:0] mq;
863output [73:0] mq_l;
864 output [73:0] scan_out;
865output [73:0] q;
866output [73:0] q_l;
867
868
869
870
871
872
873new_dlata #(74) d0_0 (
874.d(d[73:0]),
875.si(scan_in[73:0]),
876.so(scan_out[73:0]),
877.l1clk(l1clk),
878.and_clk(and_clk),
879.siclk(siclk),
880.soclk(soclk),
881.q(q[73:0]),
882.q_l(q_l[73:0]),
883.mq(mq[73:0]),
884.mq_l(mq_l[73:0])
885);
886
887
888
889
890
891
892
893
894
895
896//place::generic_place($width,$stack,$left);
897
898endmodule
899
900
901
902
903
904//
905// invert macro
906//
907//
908
909
910
911
912
913module n2_tlb_tl_64x59_cust_inv_macro__width_1 (
914 din,
915 dout);
916 input [0:0] din;
917 output [0:0] dout;
918
919
920
921
922
923
924inv #(1) d0_0 (
925.in(din[0:0]),
926.out(dout[0:0])
927);
928
929
930
931
932
933
934
935
936
937endmodule
938
939
940
941
942
943//
944// and macro for ports = 2,3,4
945//
946//
947
948
949
950
951
952module n2_tlb_tl_64x59_cust_and_macro__ports_2__width_1 (
953 din0,
954 din1,
955 dout);
956 input [0:0] din0;
957 input [0:0] din1;
958 output [0:0] dout;
959
960
961
962
963
964
965and2 #(1) d0_0 (
966.in0(din0[0:0]),
967.in1(din1[0:0]),
968.out(dout[0:0])
969);
970
971
972
973
974
975
976
977
978
979endmodule
980
981
982
983
984
985
986
987
988
989// any PARAMS parms go into naming of macro
990
991module n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_3 (
992 din,
993 l1clk,
994 scan_in,
995 siclk,
996 soclk,
997 dout,
998 scan_out);
999wire [2:0] fdin;
1000
1001 input [2:0] din;
1002 input l1clk;
1003 input [2:0] scan_in;
1004
1005
1006 input siclk;
1007 input soclk;
1008
1009 output [2:0] dout;
1010 output [2:0] scan_out;
1011assign fdin[2:0] = din[2:0];
1012
1013
1014
1015
1016
1017
1018dff #(3) d0_0 (
1019.l1clk(l1clk),
1020.siclk(siclk),
1021.soclk(soclk),
1022.d(fdin[2:0]),
1023.si(scan_in[2:0]),
1024.so(scan_out[2:0]),
1025.q(dout[2:0])
1026);
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039endmodule
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053// any PARAMS parms go into naming of macro
1054
1055module n2_tlb_tl_64x59_cust_msff_ctl_macro__width_1 (
1056 din,
1057 l1clk,
1058 scan_in,
1059 siclk,
1060 soclk,
1061 dout,
1062 scan_out);
1063wire [0:0] fdin;
1064
1065 input [0:0] din;
1066 input l1clk;
1067 input scan_in;
1068
1069
1070 input siclk;
1071 input soclk;
1072
1073 output [0:0] dout;
1074 output scan_out;
1075assign fdin[0:0] = din[0:0];
1076
1077
1078
1079
1080
1081
1082dff #(1) d0_0 (
1083.l1clk(l1clk),
1084.siclk(siclk),
1085.soclk(soclk),
1086.d(fdin[0:0]),
1087.si(scan_in),
1088.so(scan_out),
1089.q(dout[0:0])
1090);
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103endmodule
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117// any PARAMS parms go into naming of macro
1118
1119module n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_2 (
1120 din,
1121 l1clk,
1122 scan_in,
1123 siclk,
1124 soclk,
1125 dout,
1126 scan_out);
1127wire [1:0] fdin;
1128
1129 input [1:0] din;
1130 input l1clk;
1131 input [1:0] scan_in;
1132
1133
1134 input siclk;
1135 input soclk;
1136
1137 output [1:0] dout;
1138 output [1:0] scan_out;
1139assign fdin[1:0] = din[1:0];
1140
1141
1142
1143
1144
1145
1146dff #(2) d0_0 (
1147.l1clk(l1clk),
1148.siclk(siclk),
1149.soclk(soclk),
1150.d(fdin[1:0]),
1151.si(scan_in[1:0]),
1152.so(scan_out[1:0]),
1153.q(dout[1:0])
1154);
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167endmodule
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181// any PARAMS parms go into naming of macro
1182
1183module n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_38 (
1184 din,
1185 l1clk,
1186 scan_in,
1187 siclk,
1188 soclk,
1189 dout,
1190 scan_out);
1191wire [37:0] fdin;
1192
1193 input [37:0] din;
1194 input l1clk;
1195 input [37:0] scan_in;
1196
1197
1198 input siclk;
1199 input soclk;
1200
1201 output [37:0] dout;
1202 output [37:0] scan_out;
1203assign fdin[37:0] = din[37:0];
1204
1205
1206
1207
1208
1209
1210dff #(38) d0_0 (
1211.l1clk(l1clk),
1212.siclk(siclk),
1213.soclk(soclk),
1214.d(fdin[37:0]),
1215.si(scan_in[37:0]),
1216.so(scan_out[37:0]),
1217.q(dout[37:0])
1218);
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231endmodule
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241// general mux macro for pass-gate and and-or muxes with/wout priority encoders
1242// also for pass-gate with decoder
1243
1244
1245
1246
1247
1248// any PARAMS parms go into naming of macro
1249
1250module n2_tlb_tl_64x59_cust_mux_macro__mux_aope__ports_2__width_6 (
1251 din0,
1252 din1,
1253 sel0,
1254 dout);
1255wire psel0;
1256wire psel1;
1257
1258 input [5:0] din0;
1259 input [5:0] din1;
1260 input sel0;
1261 output [5:0] dout;
1262
1263
1264
1265
1266
1267cl_dp1_penc2_8x c0_0 (
1268 .sel0(sel0),
1269 .psel0(psel0),
1270 .psel1(psel1)
1271);
1272
1273mux2s #(6) d0_0 (
1274 .sel0(psel0),
1275 .sel1(psel1),
1276 .in0(din0[5:0]),
1277 .in1(din1[5:0]),
1278.dout(dout[5:0])
1279);
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293endmodule
1294
1295
1296
1297
1298
1299
1300// any PARAMS parms go into naming of macro
1301
1302module n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_6 (
1303 din,
1304 l1clk,
1305 scan_in,
1306 siclk,
1307 soclk,
1308 dout,
1309 scan_out);
1310wire [5:0] fdin;
1311
1312 input [5:0] din;
1313 input l1clk;
1314 input [5:0] scan_in;
1315
1316
1317 input siclk;
1318 input soclk;
1319
1320 output [5:0] dout;
1321 output [5:0] scan_out;
1322assign fdin[5:0] = din[5:0];
1323
1324
1325
1326
1327
1328
1329dff #(6) d0_0 (
1330.l1clk(l1clk),
1331.siclk(siclk),
1332.soclk(soclk),
1333.d(fdin[5:0]),
1334.si(scan_in[5:0]),
1335.so(scan_out[5:0]),
1336.q(dout[5:0])
1337);
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350endmodule
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361module n2_tlb_tl_64x59_array (
1362 l1clk,
1363 disable_clear_ubit,
1364 tlb_bypass,
1365 tlb_wr_flopped,
1366 tlb_rd_flopped,
1367 rw_index,
1368 tlb_cam,
1369 tlb_cam_flopped,
1370 demap,
1371 demap_context,
1372 demap_all,
1373 demap_real,
1374 tte_tag,
1375 tte_tag_flopped,
1376 tte_ubit,
1377 tte_page_size_mask,
1378 tte_data,
1379 va,
1380 tag_read_mux_control,
1381 pa,
1382 tlb_cam_hit,
1383 context0_hit,
1384 multiple_match,
1385 rd_tte_data,
1386 rd_tte_tag,
1387 rd_tte_u_bit,
1388 tlb_replacement_index) ;
1389wire [63:0] ram_wwl;
1390wire [63:0] ram_rwl;
1391wire [63:0] valid;
1392wire [63:0] used;
1393
1394
1395`define ENTRIES 64
1396`define INDEX 5
1397
1398input l1clk;
1399input disable_clear_ubit;
1400
1401input tlb_bypass;
1402input tlb_wr_flopped;
1403input tlb_rd_flopped;
1404input [`INDEX:0] rw_index;
1405input tlb_cam;
1406input tlb_cam_flopped;
1407input demap;
1408input demap_context;
1409input demap_all;
1410input demap_real;
1411
1412input [65:0] tte_tag;
1413input [65:0] tte_tag_flopped;
1414input tte_ubit;
1415input [2:0] tte_page_size_mask;
1416input [37:0] tte_data;
1417input [12:11] va; // Incoming VA
1418
1419input tag_read_mux_control;
1420
1421output [39:11] pa;
1422output tlb_cam_hit;
1423output context0_hit;
1424output multiple_match;
1425output [37:0] rd_tte_data;
1426output [65:0] rd_tte_tag;
1427output rd_tte_u_bit;
1428output [`INDEX:0] tlb_replacement_index;
1429
1430
1431
1432
1433
1434`define VA_39 40
1435`define VA_28 29
1436`define VA_27 28
1437`define VA_22 23
1438`define VA_21 21
1439`define VA_16 16
1440`define VA_15 15
1441`define VA_13 13
1442
1443
1444
1445
1446n2_tlb_tl_64x59_cam cam(
1447 .l1clk(l1clk),
1448 .tlb_bypass(tlb_bypass),
1449 .tlb_wr_flopped(tlb_wr_flopped),
1450 .tlb_rd_flopped(tlb_rd_flopped),
1451 .rw_index(rw_index[5:0]),
1452 .tlb_cam(tlb_cam),
1453 .tlb_cam_flopped(tlb_cam_flopped),
1454 .demap(demap),
1455 .demap_context(demap_context),
1456 .demap_all(demap_all),
1457 .demap_real(demap_real),
1458 .tte_tag(tte_tag[65:0]),
1459 .tte_tag_flopped(tte_tag_flopped[65:0]),
1460 .tte_page_size_mask(tte_page_size_mask[2:0]),
1461 .tag_read_mux_control(tag_read_mux_control),
1462 .tlb_cam_hit(tlb_cam_hit),
1463 .context0_hit(context0_hit),
1464 .rd_tte_tag(rd_tte_tag[65:0]),
1465 .ram_wwl(ram_wwl[63:0]),
1466 .ram_rwl(ram_rwl[63:0]),
1467 .valid(valid[63:0]));
1468
1469n2_tlb_tl_64x59_ram ram(
1470 .va ({tte_tag_flopped[`VA_39:`VA_28],
1471 tte_tag_flopped[`VA_27:`VA_22],
1472 tte_tag_flopped[`VA_21:`VA_16],
1473 tte_tag_flopped[`VA_15:`VA_13],
1474 va[12:11]}),
1475 .l1clk(l1clk),
1476 .tlb_bypass(tlb_bypass),
1477 .tlb_cam_flopped(tlb_cam_flopped),
1478 .ram_wwl(ram_wwl[63:0]),
1479 .ram_rwl(ram_rwl[63:0]),
1480 .tte_data(tte_data[37:0]),
1481 .pa(pa[39:11]),
1482 .rd_tte_data(rd_tte_data[37:0])
1483);
1484
1485n2_tlb_tl_64x59_multihit multihit (
1486 .tlb_cam_mhit (multiple_match ),
1487 .ram_rwl(ram_rwl[63:0]),
1488 .tlb_bypass(tlb_bypass)
1489);
1490
1491n2_tlb_tl_64x59_ubit ubit(
1492 .l1clk(l1clk),
1493 .disable_clear_ubit(disable_clear_ubit),
1494 .tlb_bypass(tlb_bypass),
1495 .ram_rwl(ram_rwl[63:0]),
1496 .ram_wwl(ram_wwl[63:0]),
1497 .tte_ubit(tte_ubit),
1498 .tlb_wr_flopped(tlb_wr_flopped),
1499 .tlb_rd_flopped(tlb_rd_flopped),
1500 .tlb_cam_flopped(tlb_cam_flopped),
1501 .used(used[63:0]),
1502 .rd_tte_u_bit(rd_tte_u_bit));
1503
1504n2_tlb_tl_64x59_repl_index repl_index(
1505 .l1clk(l1clk),
1506 .used(used[63:0]),
1507 .valid(valid[63:0]),
1508 .tlb_replacement_index(tlb_replacement_index[5:0]));
1509
1510
1511supply0 vss; // <- port for ground
1512supply1 vdd; // <- port for power
1513endmodule
1514
1515
1516`ifndef FPGA
1517module n2_tlb_tl_64x59_cam (
1518 l1clk,
1519 tlb_bypass,
1520 tlb_wr_flopped,
1521 tlb_rd_flopped,
1522 rw_index,
1523 tlb_cam,
1524 tlb_cam_flopped,
1525 demap,
1526 demap_context,
1527 demap_all,
1528 demap_real,
1529 tte_tag,
1530 tte_tag_flopped,
1531 tte_page_size_mask,
1532 tag_read_mux_control,
1533 tlb_cam_hit,
1534 context0_hit,
1535 rd_tte_tag,
1536 ram_wwl,
1537 ram_rwl,
1538 valid) ;
1539wire [6:0] rw_index_to_decode;
1540wire [127:0] decoded_index;
1541wire [127:64] decoded_index_unused;
1542
1543
1544`define ENTRIES 64
1545`define INDEX 5
1546
1547
1548
1549input l1clk;
1550
1551input tlb_bypass;
1552input tlb_wr_flopped;
1553input tlb_rd_flopped;
1554input [`INDEX:0] rw_index;
1555input tlb_cam;
1556input tlb_cam_flopped;
1557input demap;
1558input demap_context;
1559input demap_all;
1560input demap_real;
1561
1562input [65:0] tte_tag;
1563input [65:0] tte_tag_flopped;
1564input [2:0] tte_page_size_mask;
1565
1566input tag_read_mux_control;
1567
1568
1569
1570output tlb_cam_hit;
1571output context0_hit;
1572output [65:0] rd_tte_tag;
1573output [`ENTRIES-1:0] ram_wwl;
1574output [`ENTRIES-1:0] ram_rwl;
1575output [`ENTRIES-1:0] valid;
1576
1577
1578
1579`define CNTX1_HI 65
1580`define CNTX1_LO 53
1581`define PID_HI 52
1582`define PID_LO 50
1583`define REAL_BIT 49
1584`define VA_47 48
1585`define VA_28 29
1586`define VA_27 28
1587`define VA_22 23
1588`define TTE_VALID 22
1589`define VA_21 21
1590`define VA_16 16
1591`define VA_15 15
1592`define VA_13 13
1593`define CNTX0_HI 12
1594`define CNTX0_LO 0
1595
1596
1597
1598//----------------------------------------------------------------------
1599// Declarations
1600//----------------------------------------------------------------------
1601
1602// local signals
1603
1604reg [12:0] context_a [`ENTRIES-1:0]; // Contexts a and b are
1605reg [12:0] context_a_ [`ENTRIES-1:0]; // to be equal at all times
1606reg [12:0] context_b [`ENTRIES-1:0]; // This is NOT context 0 and 1
1607reg [12:0] context_b_ [`ENTRIES-1:0]; // This is NOT primary/secondary
1608reg r_bit [`ENTRIES-1:0];
1609reg r_bit_ [`ENTRIES-1:0];
1610reg [47:28] va_47_28 [`ENTRIES-1:0];
1611reg [47:28] va_47_28_ [`ENTRIES-1:0];
1612reg [27:22] va_27_22 [`ENTRIES-1:0];
1613reg [27:22] va_27_22_ [`ENTRIES-1:0];
1614reg [21:16] va_21_16 [`ENTRIES-1:0];
1615reg [21:16] va_21_16_ [`ENTRIES-1:0];
1616reg [15:13] va_15_13 [`ENTRIES-1:0];
1617reg [15:13] va_15_13_ [`ENTRIES-1:0];
1618reg [2:0] pid [`ENTRIES-1:0];
1619reg [2:0] pid_ [`ENTRIES-1:0];
1620reg [`ENTRIES-1:0] valid;
1621reg [`ENTRIES-1:0] match_for_sat;
1622reg tlb_cam_hit;
1623reg context0_hit;
1624
1625integer n;
1626reg [31:0] n_reg;
1627
1628reg [`ENTRIES-1:0] va_47_28_match ;
1629reg [`ENTRIES-1:0] va_27_22_match ;
1630reg [`ENTRIES-1:0] va_21_16_match ;
1631reg [`ENTRIES-1:0] va_15_13_match ;
1632reg [`ENTRIES-1:0] pid_match ;
1633reg [`ENTRIES-1:0] real_match ;
1634reg [`ENTRIES-1:0] context0_match ;
1635reg [`ENTRIES-1:0] context1_match ;
1636reg [`ENTRIES-1:0] context_match ;
1637reg [`ENTRIES-1:0] match ;
1638reg [`ENTRIES-1:0] ram_wl ;
1639reg [65:0] rd_tte_tag;
1640reg [12:0] a_xnor_tag;
1641reg [12:0] b_xnor_tag;
1642
1643reg demap_posedge_l1clk;
1644
1645
1646
1647`ifndef NOINITMEM
1648///////////////////////////////////////
1649// Initialize the arrays. //
1650///////////////////////////////////////
1651initial begin
1652 for (n = 0; n < `ENTRIES; n = n+1) begin
1653 context_a [n] = {13 {1'b0}};
1654 context_a_ [n] = {13 {1'b1}};
1655 context_b [n] = {13 {1'b0}};
1656 context_b_ [n] = {13 {1'b1}};
1657 r_bit [n] = { 1 {1'b0}};
1658 r_bit_ [n] = { 1 {1'b1}};
1659 va_47_28 [n] = {20 {1'b0}};
1660 va_47_28_ [n] = {20 {1'b1}};
1661 va_27_22 [n] = { 6 {1'b0}};
1662 va_27_22_ [n] = { 6 {1'b1}};
1663 va_21_16 [n] = { 6 {1'b0}};
1664 va_21_16_ [n] = { 6 {1'b1}};
1665 va_15_13 [n] = { 3 {1'b0}};
1666 va_15_13_ [n] = { 3 {1'b1}};
1667 pid [n] = { 3 {1'b0}};
1668 pid_ [n] = { 3 {1'b1}};
1669 valid [n] = { 1 {1'b0}};
1670 end // for (n = 0; n < `ENTRIES; n = n+1)
1671end
1672`endif
1673
1674
1675
1676///////////////////////////////////////////////////////////////
1677// CAM, read
1678///////////////////////////////////////////////////////////////
1679always @(posedge l1clk) begin
1680
1681 demap_posedge_l1clk = demap;
1682
1683 match[`ENTRIES-1:0] = {`ENTRIES {1'b0}};
1684
1685 if (tlb_cam | demap) begin
1686 for (n = 0; n < `ENTRIES; n = n + 1) begin
1687 // Have to represent dual match line architecture...
1688 // LSB 2 bits of context must both match AND MSB 11 bits must not mismatch
1689 a_xnor_tag[12:0] = (context_a [n] & tte_tag[`CNTX1_HI:`CNTX1_LO]) |
1690 (context_a_ [n] & ~tte_tag[`CNTX1_HI:`CNTX1_LO]) ;
1691 b_xnor_tag[12:0] = (context_b [n] & tte_tag[`CNTX0_HI:`CNTX0_LO]) |
1692 (context_b_ [n] & ~tte_tag[`CNTX0_HI:`CNTX0_LO]) ;
1693 context1_match[n] = demap_all | demap_real |
1694 (& a_xnor_tag[1:0]) &
1695 (~(| {context_a [n] & ~tte_tag[`CNTX1_HI:`CNTX1_LO] & 13'h1ffc,
1696 context_a_ [n] & tte_tag[`CNTX1_HI:`CNTX1_LO] & 13'h1ffc}));
1697 context0_match[n] = demap_all | demap_real |
1698 (& b_xnor_tag[1:0]) &
1699 (~(| {context_b [n] & ~tte_tag[`CNTX0_HI:`CNTX0_LO] & 13'h1ffc,
1700 context_b_ [n] & tte_tag[`CNTX0_HI:`CNTX0_LO] & 13'h1ffc}));
1701 pid_match[n] = (~(| {pid [n] & ~tte_tag[`PID_HI :`PID_LO ],
1702 pid_ [n] & tte_tag[`PID_HI :`PID_LO ]}));
1703 real_match[n] = demap_all |
1704 (~(| {r_bit [n] & ~tte_tag[`REAL_BIT ],
1705 r_bit_ [n] & tte_tag[`REAL_BIT ]}));
1706 va_47_28_match[n] = demap_all | demap_real | demap_context |
1707 (~(| {va_47_28 [n] & ~tte_tag[`VA_47 :`VA_28 ],
1708 va_47_28_ [n] & tte_tag[`VA_47 :`VA_28 ]}));
1709 va_27_22_match[n] = demap_all | demap_real | demap_context |
1710 (~(| {va_27_22 [n] & ~tte_tag[`VA_27 :`VA_22 ],
1711 va_27_22_ [n] & tte_tag[`VA_27 :`VA_22 ]}));
1712 va_21_16_match[n] = demap_all | demap_real | demap_context |
1713 (~(| {va_21_16 [n] & ~tte_tag[`VA_21 :`VA_16 ],
1714 va_21_16_ [n] & tte_tag[`VA_21 :`VA_16 ]}));
1715 va_15_13_match[n] = demap_all | demap_real | demap_context |
1716 (~(| {va_15_13 [n] & ~tte_tag[`VA_15 :`VA_13 ],
1717 va_15_13_ [n] & tte_tag[`VA_15 :`VA_13 ]}));
1718
1719 context_match[n] = context0_match[n] | context1_match[n];
1720
1721 match[n] = va_47_28_match[n] & va_27_22_match[n] & va_21_16_match[n] &
1722 va_15_13_match[n] & pid_match[n] & real_match[n] & context_match[n] &
1723 valid[n];
1724
1725 end // for (n = 0; n < `ENTRIES; n = n + 1)
1726
1727
1728 end // if (tlb_cam | demap)
1729
1730
1731
1732 ram_wl[`ENTRIES-1:0] <= match[`ENTRIES-1:0];
1733
1734end // always @ (posedge l1clk)
1735
1736
1737
1738///////////////////////////////////////////////////////////////
1739// Demap, Write, Read
1740///////////////////////////////////////////////////////////////
1741always @(negedge l1clk) begin
1742
1743 // Demap
1744 if (demap) begin
1745 for (n = 0; n < `ENTRIES; n = n + 1) begin
1746 if (match[n]) begin
1747 valid[n] <= 1'b0;
1748 end
1749 end
1750 end // if (demap)
1751
1752 // Write
1753 if (tlb_wr_flopped) begin
1754
1755 for (n = 0; n < `ENTRIES; n = n + 1) begin
1756 if (ram_wwl[n]) begin
1757 context_a [n] <=( tte_tag_flopped[`CNTX1_HI:`CNTX1_LO] & {13 {~tte_tag_flopped[`REAL_BIT]}}) | {11'h00, {2 {tte_tag_flopped[`REAL_BIT]}}};
1758 context_a_ [n] <=(~tte_tag_flopped[`CNTX1_HI:`CNTX1_LO] & {13 {~tte_tag_flopped[`REAL_BIT]}}) | {11'h00, {2 {tte_tag_flopped[`REAL_BIT]}}};
1759 pid [n] <= tte_tag_flopped[`PID_HI :`PID_LO ];
1760 pid_ [n] <= ~tte_tag_flopped[`PID_HI :`PID_LO ];
1761 r_bit [n] <= tte_tag_flopped[`REAL_BIT ];
1762 r_bit_ [n] <= ~tte_tag_flopped[`REAL_BIT ];
1763 va_47_28 [n] <= tte_tag_flopped[`VA_47 :`VA_28 ];
1764 va_47_28_ [n] <= ~tte_tag_flopped[`VA_47 :`VA_28 ];
1765 va_27_22 [n] <= tte_tag_flopped[`VA_27 :`VA_22 ] & { 6 {~tte_page_size_mask[2]}};
1766 va_27_22_ [n] <= ~tte_tag_flopped[`VA_27 :`VA_22 ] & { 6 {~tte_page_size_mask[2]}};
1767 va_21_16 [n] <= tte_tag_flopped[`VA_21 :`VA_16 ] & { 6 {~tte_page_size_mask[1]}};
1768 va_21_16_ [n] <= ~tte_tag_flopped[`VA_21 :`VA_16 ] & { 6 {~tte_page_size_mask[1]}};
1769 va_15_13 [n] <= tte_tag_flopped[`VA_15 :`VA_13 ] & { 3 {~tte_page_size_mask[0]}};
1770 va_15_13_ [n] <= ~tte_tag_flopped[`VA_15 :`VA_13 ] & { 3 {~tte_page_size_mask[0]}};
1771 context_b [n] <=( tte_tag_flopped[`CNTX0_HI:`CNTX0_LO] & {13 {~tte_tag_flopped[`REAL_BIT]}}) | {11'h00, {2 {tte_tag_flopped[`REAL_BIT]}}};
1772 context_b_ [n] <=(~tte_tag_flopped[`CNTX0_HI:`CNTX0_LO] & {13 {~tte_tag_flopped[`REAL_BIT]}}) | {11'h00, {2 {tte_tag_flopped[`REAL_BIT]}}};
1773 valid [n] <= tte_tag_flopped[`TTE_VALID ];
1774
1775
1776
1777
1778 end // if (ram_wwl[n])
1779 end // for (n = 0; n < `ENTRIES; n = n + 1)
1780
1781 end // if (tlb_wr_flopped)
1782
1783 // Read
1784 if (tlb_rd_flopped) begin
1785 if (tag_read_mux_control) begin
1786 rd_tte_tag[`CNTX1_HI:`CNTX1_LO] <= context_a_ [rw_index[`INDEX:0]];
1787 rd_tte_tag[`PID_HI :`PID_LO ] <= pid_ [rw_index[`INDEX:0]];
1788 rd_tte_tag[`REAL_BIT ] <= r_bit_ [rw_index[`INDEX:0]];
1789 rd_tte_tag[`VA_47 :`VA_28 ] <= va_47_28_ [rw_index[`INDEX:0]];
1790 rd_tte_tag[`VA_27 :`VA_22 ] <= va_27_22_ [rw_index[`INDEX:0]];
1791 rd_tte_tag[`VA_21 :`VA_16 ] <= va_21_16_ [rw_index[`INDEX:0]];
1792 rd_tte_tag[`VA_15 :`VA_13 ] <= va_15_13_ [rw_index[`INDEX:0]];
1793 rd_tte_tag[`CNTX0_HI:`CNTX0_LO] <= context_b_ [rw_index[`INDEX:0]];
1794 end // if (tag_read_mux_control)
1795 else begin
1796 rd_tte_tag[`CNTX1_HI:`CNTX1_LO] <= context_a [rw_index[`INDEX:0]];
1797 rd_tte_tag[`PID_HI :`PID_LO ] <= pid [rw_index[`INDEX:0]];
1798 rd_tte_tag[`REAL_BIT ] <= r_bit [rw_index[`INDEX:0]];
1799 rd_tte_tag[`VA_47 :`VA_28 ] <= va_47_28 [rw_index[`INDEX:0]];
1800 rd_tte_tag[`VA_27 :`VA_22 ] <= va_27_22 [rw_index[`INDEX:0]];
1801 rd_tte_tag[`VA_21 :`VA_16 ] <= va_21_16 [rw_index[`INDEX:0]];
1802 rd_tte_tag[`VA_15 :`VA_13 ] <= va_15_13 [rw_index[`INDEX:0]];
1803 rd_tte_tag[`CNTX0_HI:`CNTX0_LO] <= context_b [rw_index[`INDEX:0]];
1804 end // else: !if(tag_read_mux_control)
1805 rd_tte_tag[`TTE_VALID ] <= valid [rw_index[`INDEX:0]];
1806 end // if (tlb_rd
1807 else begin
1808 rd_tte_tag[65:0] <= {66 {1'b0}} ;
1809 end // else: !if(tlb_rd)
1810
1811end // always @ (negedge l1clk)
1812
1813
1814
1815///////////////////////////////////////////////////////////////
1816// Output assignments
1817///////////////////////////////////////////////////////////////
1818// Have to hold them to next clock edge
1819
1820// Read and write address decode
1821assign rw_index_to_decode[6:0] =
1822 {1'b0,
1823// {rw_index[6],
1824 rw_index[5:0]};
1825
1826assign decoded_index[127:0] =
1827 {(rw_index_to_decode[6:0] == 7'h7f),
1828 (rw_index_to_decode[6:0] == 7'h7e),
1829 (rw_index_to_decode[6:0] == 7'h7d),
1830 (rw_index_to_decode[6:0] == 7'h7c),
1831 (rw_index_to_decode[6:0] == 7'h7b),
1832 (rw_index_to_decode[6:0] == 7'h7a),
1833 (rw_index_to_decode[6:0] == 7'h79),
1834 (rw_index_to_decode[6:0] == 7'h78),
1835 (rw_index_to_decode[6:0] == 7'h77),
1836 (rw_index_to_decode[6:0] == 7'h76),
1837 (rw_index_to_decode[6:0] == 7'h75),
1838 (rw_index_to_decode[6:0] == 7'h74),
1839 (rw_index_to_decode[6:0] == 7'h73),
1840 (rw_index_to_decode[6:0] == 7'h72),
1841 (rw_index_to_decode[6:0] == 7'h71),
1842 (rw_index_to_decode[6:0] == 7'h70),
1843 (rw_index_to_decode[6:0] == 7'h6f),
1844 (rw_index_to_decode[6:0] == 7'h6e),
1845 (rw_index_to_decode[6:0] == 7'h6d),
1846 (rw_index_to_decode[6:0] == 7'h6c),
1847 (rw_index_to_decode[6:0] == 7'h6b),
1848 (rw_index_to_decode[6:0] == 7'h6a),
1849 (rw_index_to_decode[6:0] == 7'h69),
1850 (rw_index_to_decode[6:0] == 7'h68),
1851 (rw_index_to_decode[6:0] == 7'h67),
1852 (rw_index_to_decode[6:0] == 7'h66),
1853 (rw_index_to_decode[6:0] == 7'h65),
1854 (rw_index_to_decode[6:0] == 7'h64),
1855 (rw_index_to_decode[6:0] == 7'h63),
1856 (rw_index_to_decode[6:0] == 7'h62),
1857 (rw_index_to_decode[6:0] == 7'h61),
1858 (rw_index_to_decode[6:0] == 7'h60),
1859 (rw_index_to_decode[6:0] == 7'h5f),
1860 (rw_index_to_decode[6:0] == 7'h5e),
1861 (rw_index_to_decode[6:0] == 7'h5d),
1862 (rw_index_to_decode[6:0] == 7'h5c),
1863 (rw_index_to_decode[6:0] == 7'h5b),
1864 (rw_index_to_decode[6:0] == 7'h5a),
1865 (rw_index_to_decode[6:0] == 7'h59),
1866 (rw_index_to_decode[6:0] == 7'h58),
1867 (rw_index_to_decode[6:0] == 7'h57),
1868 (rw_index_to_decode[6:0] == 7'h56),
1869 (rw_index_to_decode[6:0] == 7'h55),
1870 (rw_index_to_decode[6:0] == 7'h54),
1871 (rw_index_to_decode[6:0] == 7'h53),
1872 (rw_index_to_decode[6:0] == 7'h52),
1873 (rw_index_to_decode[6:0] == 7'h51),
1874 (rw_index_to_decode[6:0] == 7'h50),
1875 (rw_index_to_decode[6:0] == 7'h4f),
1876 (rw_index_to_decode[6:0] == 7'h4e),
1877 (rw_index_to_decode[6:0] == 7'h4d),
1878 (rw_index_to_decode[6:0] == 7'h4c),
1879 (rw_index_to_decode[6:0] == 7'h4b),
1880 (rw_index_to_decode[6:0] == 7'h4a),
1881 (rw_index_to_decode[6:0] == 7'h49),
1882 (rw_index_to_decode[6:0] == 7'h48),
1883 (rw_index_to_decode[6:0] == 7'h47),
1884 (rw_index_to_decode[6:0] == 7'h46),
1885 (rw_index_to_decode[6:0] == 7'h45),
1886 (rw_index_to_decode[6:0] == 7'h44),
1887 (rw_index_to_decode[6:0] == 7'h43),
1888 (rw_index_to_decode[6:0] == 7'h42),
1889 (rw_index_to_decode[6:0] == 7'h41),
1890 (rw_index_to_decode[6:0] == 7'h40),
1891 (rw_index_to_decode[6:0] == 7'h3f),
1892 (rw_index_to_decode[6:0] == 7'h3e),
1893 (rw_index_to_decode[6:0] == 7'h3d),
1894 (rw_index_to_decode[6:0] == 7'h3c),
1895 (rw_index_to_decode[6:0] == 7'h3b),
1896 (rw_index_to_decode[6:0] == 7'h3a),
1897 (rw_index_to_decode[6:0] == 7'h39),
1898 (rw_index_to_decode[6:0] == 7'h38),
1899 (rw_index_to_decode[6:0] == 7'h37),
1900 (rw_index_to_decode[6:0] == 7'h36),
1901 (rw_index_to_decode[6:0] == 7'h35),
1902 (rw_index_to_decode[6:0] == 7'h34),
1903 (rw_index_to_decode[6:0] == 7'h33),
1904 (rw_index_to_decode[6:0] == 7'h32),
1905 (rw_index_to_decode[6:0] == 7'h31),
1906 (rw_index_to_decode[6:0] == 7'h30),
1907 (rw_index_to_decode[6:0] == 7'h2f),
1908 (rw_index_to_decode[6:0] == 7'h2e),
1909 (rw_index_to_decode[6:0] == 7'h2d),
1910 (rw_index_to_decode[6:0] == 7'h2c),
1911 (rw_index_to_decode[6:0] == 7'h2b),
1912 (rw_index_to_decode[6:0] == 7'h2a),
1913 (rw_index_to_decode[6:0] == 7'h29),
1914 (rw_index_to_decode[6:0] == 7'h28),
1915 (rw_index_to_decode[6:0] == 7'h27),
1916 (rw_index_to_decode[6:0] == 7'h26),
1917 (rw_index_to_decode[6:0] == 7'h25),
1918 (rw_index_to_decode[6:0] == 7'h24),
1919 (rw_index_to_decode[6:0] == 7'h23),
1920 (rw_index_to_decode[6:0] == 7'h22),
1921 (rw_index_to_decode[6:0] == 7'h21),
1922 (rw_index_to_decode[6:0] == 7'h20),
1923 (rw_index_to_decode[6:0] == 7'h1f),
1924 (rw_index_to_decode[6:0] == 7'h1e),
1925 (rw_index_to_decode[6:0] == 7'h1d),
1926 (rw_index_to_decode[6:0] == 7'h1c),
1927 (rw_index_to_decode[6:0] == 7'h1b),
1928 (rw_index_to_decode[6:0] == 7'h1a),
1929 (rw_index_to_decode[6:0] == 7'h19),
1930 (rw_index_to_decode[6:0] == 7'h18),
1931 (rw_index_to_decode[6:0] == 7'h17),
1932 (rw_index_to_decode[6:0] == 7'h16),
1933 (rw_index_to_decode[6:0] == 7'h15),
1934 (rw_index_to_decode[6:0] == 7'h14),
1935 (rw_index_to_decode[6:0] == 7'h13),
1936 (rw_index_to_decode[6:0] == 7'h12),
1937 (rw_index_to_decode[6:0] == 7'h11),
1938 (rw_index_to_decode[6:0] == 7'h10),
1939 (rw_index_to_decode[6:0] == 7'h0f),
1940 (rw_index_to_decode[6:0] == 7'h0e),
1941 (rw_index_to_decode[6:0] == 7'h0d),
1942 (rw_index_to_decode[6:0] == 7'h0c),
1943 (rw_index_to_decode[6:0] == 7'h0b),
1944 (rw_index_to_decode[6:0] == 7'h0a),
1945 (rw_index_to_decode[6:0] == 7'h09),
1946 (rw_index_to_decode[6:0] == 7'h08),
1947 (rw_index_to_decode[6:0] == 7'h07),
1948 (rw_index_to_decode[6:0] == 7'h06),
1949 (rw_index_to_decode[6:0] == 7'h05),
1950 (rw_index_to_decode[6:0] == 7'h04),
1951 (rw_index_to_decode[6:0] == 7'h03),
1952 (rw_index_to_decode[6:0] == 7'h02),
1953 (rw_index_to_decode[6:0] == 7'h01),
1954 (rw_index_to_decode[6:0] == 7'h00)};
1955
1956assign decoded_index_unused[127:64] = decoded_index[127:64];
1957
1958always @(negedge l1clk) begin
1959 match_for_sat[`ENTRIES-1:0] <= match[`ENTRIES-1:0]; // For MMU SAT
1960 tlb_cam_hit <= (| match[`ENTRIES-1:0]) | tlb_bypass | ~tlb_cam;
1961 context0_hit <= (|(match[`ENTRIES-1:0] & context0_match[`ENTRIES-1:0])) & ~demap_posedge_l1clk;
1962end // always @ (negedge l1clk)
1963
1964assign ram_wwl[`ENTRIES-1:0] =
1965 decoded_index[`ENTRIES-1:0] & {`ENTRIES {tlb_wr_flopped}};
1966
1967assign ram_rwl[`ENTRIES-1:0] =
1968 (decoded_index[`ENTRIES-1:0] & {`ENTRIES {tlb_rd_flopped }}) |
1969 (ram_wl [`ENTRIES-1:0] & {`ENTRIES {tlb_cam_flopped}});
1970
1971
1972
1973
1974
1975supply0 vss; // <- port for ground
1976supply1 vdd; // <- port for power
1977endmodule
1978`endif // `ifndef FPGA
1979
1980`ifdef FPGA
1981module n2_tlb_tl_64x59_cam(l1clk, tlb_bypass, tlb_wr_flopped, tlb_rd_flopped,
1982 rw_index, tlb_cam, tlb_cam_flopped, demap, demap_context, demap_all,
1983 demap_real, tte_tag, tte_tag_flopped, tte_page_size_mask,
1984 tag_read_mux_control, tlb_cam_hit, context0_hit, rd_tte_tag, ram_wwl,
1985 ram_rwl, valid);
1986
1987 input l1clk;
1988 input tlb_bypass;
1989 input tlb_wr_flopped;
1990 input tlb_rd_flopped;
1991 input [5:0] rw_index;
1992 input tlb_cam;
1993 input tlb_cam_flopped;
1994 input demap;
1995 input demap_context;
1996 input demap_all;
1997 input demap_real;
1998 input [65:0] tte_tag;
1999 input [65:0] tte_tag_flopped;
2000 input [2:0] tte_page_size_mask;
2001 input tag_read_mux_control;
2002 output tlb_cam_hit;
2003 output context0_hit;
2004 output [65:0] rd_tte_tag;
2005 output [(64 - 1):0] ram_wwl;
2006 output [(64 - 1):0] ram_rwl;
2007 output [(64 - 1):0] valid;
2008
2009 wire [6:0] rw_index_to_decode;
2010 wire [127:0] decoded_index;
2011 wire [127:64] decoded_index_unused;
2012
2013 reg [12:0] context_a[(64 - 1):0];
2014 reg [12:0] context_a_[(64 - 1):0];
2015 reg [12:0] context_b[(64 - 1):0];
2016 reg [12:0] context_b_[(64 - 1):0];
2017 reg r_bit[(64 - 1):0];
2018 reg r_bit_[(64 - 1):0];
2019 reg [47:28] va_47_28[(64 - 1):0];
2020 reg [47:28] va_47_28_[(64 - 1):0];
2021 reg [27:22] va_27_22[(64 - 1):0];
2022 reg [27:22] va_27_22_[(64 - 1):0];
2023 reg [21:16] va_21_16[(64 - 1):0];
2024 reg [21:16] va_21_16_[(64 - 1):0];
2025 reg [15:13] va_15_13[(64 - 1):0];
2026 reg [15:13] va_15_13_[(64 - 1):0];
2027 reg [2:0] pid[(64 - 1):0];
2028 reg [2:0] pid_[(64 - 1):0];
2029 reg [(64 - 1):0] match_for_sat;
2030 reg tlb_cam_hit;
2031 reg context0_hit;
2032 integer n;
2033 reg [31:0] n_reg;
2034 reg [(64 - 1):0] va_47_28_match;
2035 reg [(64 - 1):0] va_27_22_match;
2036 reg [(64 - 1):0] va_21_16_match;
2037 reg [(64 - 1):0] va_15_13_match;
2038 reg [(64 - 1):0] pid_match;
2039 reg [(64 - 1):0] real_match;
2040 reg [(64 - 1):0] context0_match;
2041 reg [(64 - 1):0] context1_match;
2042 reg [(64 - 1):0] context_match;
2043 reg [(64 - 1):0] match;
2044 reg [(64 - 1):0] ram_wl;
2045 reg [65:0] rd_tte_tag;
2046 reg [(64 - 1):0] valid;
2047 reg [12:0] a_xnor_tag;
2048 reg [12:0] b_xnor_tag;
2049 reg demap_posedge_l1clk;
2050 supply0 vss;
2051 supply1 vdd;
2052
2053 assign rw_index_to_decode[6:0] = {1'b0, rw_index[5:0]};
2054 assign decoded_index[127:0] = {(rw_index_to_decode[6:0] == 7'b1111111),
2055 (rw_index_to_decode[6:0] == 7'h7e), (rw_index_to_decode[6:0] ==
2056 7'h7d), (rw_index_to_decode[6:0] == 7'h7c),
2057 (rw_index_to_decode[6:0] == 7'h7b), (rw_index_to_decode[6:0] ==
2058 7'h7a), (rw_index_to_decode[6:0] == 7'h79),
2059 (rw_index_to_decode[6:0] == 7'h78), (rw_index_to_decode[6:0] ==
2060 7'h77), (rw_index_to_decode[6:0] == 7'h76),
2061 (rw_index_to_decode[6:0] == 7'h75), (rw_index_to_decode[6:0] ==
2062 7'h74), (rw_index_to_decode[6:0] == 7'h73),
2063 (rw_index_to_decode[6:0] == 7'h72), (rw_index_to_decode[6:0] ==
2064 7'h71), (rw_index_to_decode[6:0] == 7'h70),
2065 (rw_index_to_decode[6:0] == 7'h6f), (rw_index_to_decode[6:0] ==
2066 7'h6e), (rw_index_to_decode[6:0] == 7'h6d),
2067 (rw_index_to_decode[6:0] == 7'h6c), (rw_index_to_decode[6:0] ==
2068 7'h6b), (rw_index_to_decode[6:0] == 7'h6a),
2069 (rw_index_to_decode[6:0] == 7'h69), (rw_index_to_decode[6:0] ==
2070 7'h68), (rw_index_to_decode[6:0] == 7'h67),
2071 (rw_index_to_decode[6:0] == 7'h66), (rw_index_to_decode[6:0] ==
2072 7'h65), (rw_index_to_decode[6:0] == 7'h64),
2073 (rw_index_to_decode[6:0] == 7'h63), (rw_index_to_decode[6:0] ==
2074 7'h62), (rw_index_to_decode[6:0] == 7'h61),
2075 (rw_index_to_decode[6:0] == 7'h60), (rw_index_to_decode[6:0] ==
2076 7'h5f), (rw_index_to_decode[6:0] == 7'h5e),
2077 (rw_index_to_decode[6:0] == 7'h5d), (rw_index_to_decode[6:0] ==
2078 7'h5c), (rw_index_to_decode[6:0] == 7'h5b),
2079 (rw_index_to_decode[6:0] == 7'h5a), (rw_index_to_decode[6:0] ==
2080 7'h59), (rw_index_to_decode[6:0] == 7'h58),
2081 (rw_index_to_decode[6:0] == 7'h57), (rw_index_to_decode[6:0] ==
2082 7'h56), (rw_index_to_decode[6:0] == 7'h55),
2083 (rw_index_to_decode[6:0] == 7'h54), (rw_index_to_decode[6:0] ==
2084 7'h53), (rw_index_to_decode[6:0] == 7'h52),
2085 (rw_index_to_decode[6:0] == 7'h51), (rw_index_to_decode[6:0] ==
2086 7'h50), (rw_index_to_decode[6:0] == 7'h4f),
2087 (rw_index_to_decode[6:0] == 7'h4e), (rw_index_to_decode[6:0] ==
2088 7'h4d), (rw_index_to_decode[6:0] == 7'h4c),
2089 (rw_index_to_decode[6:0] == 7'h4b), (rw_index_to_decode[6:0] ==
2090 7'h4a), (rw_index_to_decode[6:0] == 7'h49),
2091 (rw_index_to_decode[6:0] == 7'h48), (rw_index_to_decode[6:0] ==
2092 7'h47), (rw_index_to_decode[6:0] == 7'h46),
2093 (rw_index_to_decode[6:0] == 7'h45), (rw_index_to_decode[6:0] ==
2094 7'h44), (rw_index_to_decode[6:0] == 7'h43),
2095 (rw_index_to_decode[6:0] == 7'h42), (rw_index_to_decode[6:0] ==
2096 7'h41), (rw_index_to_decode[6:0] == 7'h40),
2097 (rw_index_to_decode[6:0] == 7'b0111111),
2098 (rw_index_to_decode[6:0] == 7'h3e), (rw_index_to_decode[6:0] ==
2099 7'h3d), (rw_index_to_decode[6:0] == 7'h3c),
2100 (rw_index_to_decode[6:0] == 7'h3b), (rw_index_to_decode[6:0] ==
2101 7'h3a), (rw_index_to_decode[6:0] == 7'h39),
2102 (rw_index_to_decode[6:0] == 7'h38), (rw_index_to_decode[6:0] ==
2103 7'h37), (rw_index_to_decode[6:0] == 7'h36),
2104 (rw_index_to_decode[6:0] == 7'h35), (rw_index_to_decode[6:0] ==
2105 7'h34), (rw_index_to_decode[6:0] == 7'h33),
2106 (rw_index_to_decode[6:0] == 7'h32), (rw_index_to_decode[6:0] ==
2107 7'h31), (rw_index_to_decode[6:0] == 7'h30),
2108 (rw_index_to_decode[6:0] == 7'h2f), (rw_index_to_decode[6:0] ==
2109 7'h2e), (rw_index_to_decode[6:0] == 7'h2d),
2110 (rw_index_to_decode[6:0] == 7'h2c), (rw_index_to_decode[6:0] ==
2111 7'h2b), (rw_index_to_decode[6:0] == 7'h2a),
2112 (rw_index_to_decode[6:0] == 7'h29), (rw_index_to_decode[6:0] ==
2113 7'h28), (rw_index_to_decode[6:0] == 7'h27),
2114 (rw_index_to_decode[6:0] == 7'h26), (rw_index_to_decode[6:0] ==
2115 7'h25), (rw_index_to_decode[6:0] == 7'h24),
2116 (rw_index_to_decode[6:0] == 7'h23), (rw_index_to_decode[6:0] ==
2117 7'h22), (rw_index_to_decode[6:0] == 7'h21),
2118 (rw_index_to_decode[6:0] == 7'h20), (rw_index_to_decode[6:0] ==
2119 7'h1f), (rw_index_to_decode[6:0] == 7'h1e),
2120 (rw_index_to_decode[6:0] == 7'h1d), (rw_index_to_decode[6:0] ==
2121 7'h1c), (rw_index_to_decode[6:0] == 7'h1b),
2122 (rw_index_to_decode[6:0] == 7'h1a), (rw_index_to_decode[6:0] ==
2123 7'h19), (rw_index_to_decode[6:0] == 7'h18),
2124 (rw_index_to_decode[6:0] == 7'h17), (rw_index_to_decode[6:0] ==
2125 7'h16), (rw_index_to_decode[6:0] == 7'h15),
2126 (rw_index_to_decode[6:0] == 7'h14), (rw_index_to_decode[6:0] ==
2127 7'h13), (rw_index_to_decode[6:0] == 7'h12),
2128 (rw_index_to_decode[6:0] == 7'h11), (rw_index_to_decode[6:0] ==
2129 7'h10), (rw_index_to_decode[6:0] == 7'h0f),
2130 (rw_index_to_decode[6:0] == 7'h0e), (rw_index_to_decode[6:0] ==
2131 7'h0d), (rw_index_to_decode[6:0] == 7'h0c),
2132 (rw_index_to_decode[6:0] == 7'h0b), (rw_index_to_decode[6:0] ==
2133 7'h0a), (rw_index_to_decode[6:0] == 7'h09),
2134 (rw_index_to_decode[6:0] == 7'h08), (rw_index_to_decode[6:0] ==
2135 7'h07), (rw_index_to_decode[6:0] == 7'h06),
2136 (rw_index_to_decode[6:0] == 7'h05), (rw_index_to_decode[6:0] ==
2137 7'h04), (rw_index_to_decode[6:0] == 7'h03),
2138 (rw_index_to_decode[6:0] == 7'b0000010),
2139 (rw_index_to_decode[6:0] == 7'b1), (rw_index_to_decode[6:0] ==
2140 7'b0)};
2141 assign decoded_index_unused[127:64] = decoded_index[127:64];
2142 assign ram_wwl[(64 - 1):0] = (decoded_index[(64 - 1):0] & {64 {
2143 tlb_wr_flopped}});
2144 assign ram_rwl[(64 - 1):0] = ((decoded_index[(64 - 1):0] & {64 {
2145 tlb_rd_flopped}}) | (ram_wl[(64 - 1):0] & {64 {tlb_cam_flopped}}
2146 ));
2147
2148 initial begin
2149 for (n = 0; (n < 64); n = (n + 1)) begin
2150 context_a[n] = {13 {1'b0}};
2151 context_a_[n] = {13 {1'b1}};
2152 context_b[n] = {13 {1'b0}};
2153 context_b_[n] = {13 {1'b1}};
2154 r_bit[n] = {1 {1'b0}};
2155 r_bit_[n] = {1 {1'b1}};
2156 va_47_28[n] = {20 {1'b0}};
2157 va_47_28_[n] = {20 {1'b1}};
2158 va_27_22[n] = {6 {1'b0}};
2159 va_27_22_[n] = {6 {1'b1}};
2160 va_21_16[n] = {6 {1'b0}};
2161 va_21_16_[n] = {6 {1'b1}};
2162 va_15_13[n] = {3 {1'b0}};
2163 va_15_13_[n] = {3 {1'b1}};
2164 pid[n] = {3 {1'b0}};
2165 pid_[n] = {3 {1'b1}};
2166 valid[n] = {1 {1'b0}};
2167 end
2168 end
2169 always @(posedge l1clk) begin
2170 demap_posedge_l1clk = demap;
2171 match[(64 - 1):0] = {64 {1'b0}};
2172 if (tlb_cam | demap) begin
2173 for (n = 0; (n < 64); n = (n + 1)) begin
2174 a_xnor_tag[12:0] = ((context_a[n] & tte_tag[65:53]) | (
2175 context_a_[n] & (~tte_tag[65:53])));
2176 b_xnor_tag[12:0] = ((context_b[n] & tte_tag[12:0]) | (
2177 context_b_[n] & (~tte_tag[12:0])));
2178 context1_match[n] = ((demap_all | demap_real) | ((&a_xnor_tag[1:0]
2179 ) & (~(|{((context_a[n] & (~tte_tag[65:53])) & 13'h1ffc),
2180 ((context_a_[n] & tte_tag[65:53]) & 13'h1ffc)}))));
2181 context0_match[n] = ((demap_all | demap_real) | ((&b_xnor_tag[1:0]
2182 ) & (~(|{((context_b[n] & (~tte_tag[12:0])) & 13'h1ffc),
2183 ((context_b_[n] & tte_tag[12:0]) & 13'h1ffc)}))));
2184 pid_match[n] = (~(|{(pid[n] & (~tte_tag[52:50])), (pid_[n] &
2185 tte_tag[52:50])}));
2186 real_match[n] = (demap_all | (~(|{(r_bit[n] & (~tte_tag[49])),
2187 (r_bit_[n] & tte_tag[49])})));
2188 va_47_28_match[n] = (((demap_all | demap_real) | demap_context) |
2189 (~(|{(va_47_28[n] & (~tte_tag[48:29])), (va_47_28_[n] &
2190 tte_tag[48:29])})));
2191 va_27_22_match[n] = (((demap_all | demap_real) | demap_context) |
2192 (~(|{(va_27_22[n] & (~tte_tag[28:23])), (va_27_22_[n] &
2193 tte_tag[28:23])})));
2194 va_21_16_match[n] = (((demap_all | demap_real) | demap_context) |
2195 (~(|{(va_21_16[n] & (~tte_tag[21:16])), (va_21_16_[n] &
2196 tte_tag[21:16])})));
2197 va_15_13_match[n] = (((demap_all | demap_real) | demap_context) |
2198 (~(|{(va_15_13[n] & (~tte_tag[15:13])), (va_15_13_[n] &
2199 tte_tag[15:13])})));
2200 context_match[n] = (context0_match[n] | context1_match[n]);
2201 match[n] = (((((((va_47_28_match[n] & va_27_22_match[n]) &
2202 va_21_16_match[n]) & va_15_13_match[n]) & pid_match[n]) &
2203 real_match[n]) & context_match[n]) & valid[n]);
2204 end
2205 end
2206 ram_wl[(64 - 1):0] <= match[(64 - 1):0];
2207 end
2208 always @(negedge l1clk) begin
2209 if (demap) begin
2210 for (n = 0; (n < 64); n = (n + 1)) begin
2211 if (match[n]) begin
2212 valid[n] <= 1'b0;
2213 end
2214 end
2215 end
2216 if (tlb_wr_flopped) begin
2217 for (n = 0; (n < 64); n = (n + 1)) begin
2218 if (ram_wwl[n]) begin
2219 context_a[n] <= ((tte_tag_flopped[65:53] & {13 {
2220 (~tte_tag_flopped[49])}}) | {11'b0, {2
2221 {tte_tag_flopped[49]}}});
2222 context_a_[n] <= (((~tte_tag_flopped[65:53]) & {13 {
2223 (~tte_tag_flopped[49])}}) | {11'b0, {2
2224 {tte_tag_flopped[49]}}});
2225 pid[n] <= tte_tag_flopped[52:50];
2226 pid_[n] <= (~tte_tag_flopped[52:50]);
2227 r_bit[n] <= tte_tag_flopped[49];
2228 r_bit_[n] <= (~tte_tag_flopped[49]);
2229 va_47_28[n] <= tte_tag_flopped[48:29];
2230 va_47_28_[n] <= (~tte_tag_flopped[48:29]);
2231 va_27_22[n] <= (tte_tag_flopped[28:23] & {6 {
2232 (~tte_page_size_mask[2])}});
2233 va_27_22_[n] <= ((~tte_tag_flopped[28:23]) & {6 {
2234 (~tte_page_size_mask[2])}});
2235 va_21_16[n] <= (tte_tag_flopped[21:16] & {6 {
2236 (~tte_page_size_mask[1])}});
2237 va_21_16_[n] <= ((~tte_tag_flopped[21:16]) & {6 {
2238 (~tte_page_size_mask[1])}});
2239 va_15_13[n] <= (tte_tag_flopped[15:13] & {3 {
2240 (~tte_page_size_mask[0])}});
2241 va_15_13_[n] <= ((~tte_tag_flopped[15:13]) & {3 {
2242 (~tte_page_size_mask[0])}});
2243 context_b[n] <= ((tte_tag_flopped[12:0] & {13 {
2244 (~tte_tag_flopped[49])}}) | {11'b0, {2
2245 {tte_tag_flopped[49]}}});
2246 context_b_[n] <= (((~tte_tag_flopped[12:0]) & {13 {
2247 (~tte_tag_flopped[49])}}) | {11'b0, {2
2248 {tte_tag_flopped[49]}}});
2249 valid[n] <= tte_tag_flopped[22];
2250 end
2251 end
2252 end
2253 if (tlb_rd_flopped) begin
2254 if (tag_read_mux_control) begin
2255 rd_tte_tag[65:53] <= context_a_[rw_index[5:0]];
2256 rd_tte_tag[52:50] <= pid_[rw_index[5:0]];
2257 rd_tte_tag[49] <= r_bit_[rw_index[5:0]];
2258 rd_tte_tag[48:29] <= va_47_28_[rw_index[5:0]];
2259 rd_tte_tag[28:23] <= va_27_22_[rw_index[5:0]];
2260 rd_tte_tag[21:16] <= va_21_16_[rw_index[5:0]];
2261 rd_tte_tag[15:13] <= va_15_13_[rw_index[5:0]];
2262 rd_tte_tag[12:0] <= context_b_[rw_index[5:0]];
2263 end
2264 else
2265 begin
2266 rd_tte_tag[65:53] <= context_a[rw_index[5:0]];
2267 rd_tte_tag[52:50] <= pid[rw_index[5:0]];
2268 rd_tte_tag[49] <= r_bit[rw_index[5:0]];
2269 rd_tte_tag[48:29] <= va_47_28[rw_index[5:0]];
2270 rd_tte_tag[28:23] <= va_27_22[rw_index[5:0]];
2271 rd_tte_tag[21:16] <= va_21_16[rw_index[5:0]];
2272 rd_tte_tag[15:13] <= va_15_13[rw_index[5:0]];
2273 rd_tte_tag[12:0] <= context_b[rw_index[5:0]];
2274 end
2275 rd_tte_tag[22] <= valid[rw_index[5:0]];
2276 end
2277 else
2278 begin
2279 rd_tte_tag[65:0] <= {66 {1'b0}};
2280 end
2281 end
2282 always @(negedge l1clk) begin
2283 match_for_sat[(64 - 1):0] <= match[(64 - 1):0];
2284 tlb_cam_hit <= (((|match[(64 - 1):0]) | tlb_bypass) | (~tlb_cam));
2285 context0_hit <= ((|(match[(64 - 1):0] & context0_match[(64 - 1):0])) &
2286 (~demap_posedge_l1clk));
2287 end
2288endmodule
2289
2290`endif // `ifdef FPGA
2291
2292
2293`ifndef FPGA
2294module n2_tlb_tl_64x59_ram (
2295 l1clk,
2296 tlb_bypass,
2297 tlb_cam_flopped,
2298 ram_wwl,
2299 ram_rwl,
2300 tte_data,
2301 va,
2302 pa,
2303 rd_tte_data) ;
2304wire any_wwl;
2305wire any_rwl;
2306wire [37:0] prd_data;
2307wire [39:13] tte_pa;
2308
2309
2310`define ENTRIES 64
2311`define INDEX 5
2312
2313
2314
2315input l1clk;
2316
2317input tlb_bypass;
2318input tlb_cam_flopped;
2319input [`ENTRIES-1:0] ram_wwl;
2320input [`ENTRIES-1:0] ram_rwl;
2321
2322input [37:0] tte_data;
2323input [39:11] va; // Incoming VA
2324
2325
2326
2327output [39:11] pa;
2328output [37:0] rd_tte_data;
2329
2330
2331
2332`define DATA_PARITY 36
2333`define DATA_PA_39_28_HI 35
2334`define DATA_PA_39_28_LO 24
2335`define DATA_PA_27_22_HI 23
2336`define DATA_PA_27_22_LO 18
2337`define DATA_VA_27_22_V 17
2338`define DATA_PA_21_16_HI 16
2339`define DATA_PA_21_16_LO 11
2340`define DATA_VA_21_16_V 10
2341`define DATA_PA_15_13_HI 9
2342`define DATA_PA_15_13_LO 7
2343`define DATA_VA_15_13_V 6
2344`define DATA_NFO 5
2345`define DATA_IE 4
2346`define DATA_CP 3
2347`define DATA_X 2
2348`define DATA_P 1
2349`define DATA_W 0
2350
2351assign any_wwl =
2352 | ram_wwl[`ENTRIES-1:0];
2353
2354assign any_rwl =
2355 | ram_rwl[`ENTRIES-1:0];
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386//----------------------------------------------------------------------
2387// Declarations
2388//----------------------------------------------------------------------
2389
2390reg [37:0] tlb_data_[`ENTRIES-1:0] ; // this models the data array
2391 // data stored negative active
2392
2393integer n;
2394
2395`ifndef NOINITMEM
2396///////////////////////////////////////
2397// Initialize the arrays. //
2398///////////////////////////////////////
2399initial begin
2400 for (n = 0; n < `ENTRIES; n = n + 1) begin
2401 tlb_data_[n] = {38 {1'b1}};
2402 end
2403 `ifdef ENABLE_DUMPMEM
2404 if ($test$plusargs("DUMPMEM_DTLB")) begin
2405 $fsdbDumpMem(tlb_data_, 0, `ENTRIES);
2406 end
2407 `endif
2408end
2409`endif
2410
2411
2412
2413
2414
2415///////////////////////////////////////////////////////////////
2416// Write //
2417///////////////////////////////////////////////////////////////
2418always @(negedge l1clk) begin
2419
2420 for (n = 0; n < `ENTRIES; n = n + 1) begin
2421 if (ram_wwl[n]) begin
2422 // data stored negative active
2423 tlb_data_[n] <= ~tte_data[37:0];
2424
2425
2426
2427
2428 n = `ENTRIES;
2429
2430 end // if (ram_wl[n])
2431 end // for (n = 0; n < `ENTRIES; n = n + 1)
2432
2433end // always @ (ram_wl[`ENTRIES-1:0])
2434
2435
2436
2437///////////////////////////////////////////////////////////////
2438// Read //
2439///////////////////////////////////////////////////////////////
2440
2441// ram_rwl is now second half cycle signal... so no need to latch
2442// Only force outputs to X if read and write at same time
2443// Model multiple hit read accurately:
2444// Whenever stored_data==0 is read from a bit by any of wordline,
2445// dout is 0.
2446// Invert data since stored_data is negative active
2447assign prd_data[37:0] =
2448 ((~tlb_data_[0] & {38 {ram_rwl[0]}}) |
2449 (~tlb_data_[1] & {38 {ram_rwl[1]}}) |
2450 (~tlb_data_[2] & {38 {ram_rwl[2]}}) |
2451 (~tlb_data_[3] & {38 {ram_rwl[3]}}) |
2452 (~tlb_data_[4] & {38 {ram_rwl[4]}}) |
2453 (~tlb_data_[5] & {38 {ram_rwl[5]}}) |
2454 (~tlb_data_[6] & {38 {ram_rwl[6]}}) |
2455 (~tlb_data_[7] & {38 {ram_rwl[7]}}) |
2456 (~tlb_data_[8] & {38 {ram_rwl[8]}}) |
2457 (~tlb_data_[9] & {38 {ram_rwl[9]}}) |
2458 (~tlb_data_[10] & {38 {ram_rwl[10]}}) |
2459 (~tlb_data_[11] & {38 {ram_rwl[11]}}) |
2460 (~tlb_data_[12] & {38 {ram_rwl[12]}}) |
2461 (~tlb_data_[13] & {38 {ram_rwl[13]}}) |
2462 (~tlb_data_[14] & {38 {ram_rwl[14]}}) |
2463 (~tlb_data_[15] & {38 {ram_rwl[15]}}) |
2464 (~tlb_data_[16] & {38 {ram_rwl[16]}}) |
2465 (~tlb_data_[17] & {38 {ram_rwl[17]}}) |
2466 (~tlb_data_[18] & {38 {ram_rwl[18]}}) |
2467 (~tlb_data_[19] & {38 {ram_rwl[19]}}) |
2468 (~tlb_data_[20] & {38 {ram_rwl[20]}}) |
2469 (~tlb_data_[21] & {38 {ram_rwl[21]}}) |
2470 (~tlb_data_[22] & {38 {ram_rwl[22]}}) |
2471 (~tlb_data_[23] & {38 {ram_rwl[23]}}) |
2472 (~tlb_data_[24] & {38 {ram_rwl[24]}}) |
2473 (~tlb_data_[25] & {38 {ram_rwl[25]}}) |
2474 (~tlb_data_[26] & {38 {ram_rwl[26]}}) |
2475 (~tlb_data_[27] & {38 {ram_rwl[27]}}) |
2476 (~tlb_data_[28] & {38 {ram_rwl[28]}}) |
2477 (~tlb_data_[29] & {38 {ram_rwl[29]}}) |
2478 (~tlb_data_[30] & {38 {ram_rwl[30]}}) |
2479 (~tlb_data_[31] & {38 {ram_rwl[31]}}) |
2480 (~tlb_data_[32] & {38 {ram_rwl[32]}}) |
2481 (~tlb_data_[33] & {38 {ram_rwl[33]}}) |
2482 (~tlb_data_[34] & {38 {ram_rwl[34]}}) |
2483 (~tlb_data_[35] & {38 {ram_rwl[35]}}) |
2484 (~tlb_data_[36] & {38 {ram_rwl[36]}}) |
2485 (~tlb_data_[37] & {38 {ram_rwl[37]}}) |
2486 (~tlb_data_[38] & {38 {ram_rwl[38]}}) |
2487 (~tlb_data_[39] & {38 {ram_rwl[39]}}) |
2488 (~tlb_data_[40] & {38 {ram_rwl[40]}}) |
2489 (~tlb_data_[41] & {38 {ram_rwl[41]}}) |
2490 (~tlb_data_[42] & {38 {ram_rwl[42]}}) |
2491 (~tlb_data_[43] & {38 {ram_rwl[43]}}) |
2492 (~tlb_data_[44] & {38 {ram_rwl[44]}}) |
2493 (~tlb_data_[45] & {38 {ram_rwl[45]}}) |
2494 (~tlb_data_[46] & {38 {ram_rwl[46]}}) |
2495 (~tlb_data_[47] & {38 {ram_rwl[47]}}) |
2496 (~tlb_data_[48] & {38 {ram_rwl[48]}}) |
2497 (~tlb_data_[49] & {38 {ram_rwl[49]}}) |
2498 (~tlb_data_[50] & {38 {ram_rwl[50]}}) |
2499 (~tlb_data_[51] & {38 {ram_rwl[51]}}) |
2500 (~tlb_data_[52] & {38 {ram_rwl[52]}}) |
2501 (~tlb_data_[53] & {38 {ram_rwl[53]}}) |
2502 (~tlb_data_[54] & {38 {ram_rwl[54]}}) |
2503 (~tlb_data_[55] & {38 {ram_rwl[55]}}) |
2504 (~tlb_data_[56] & {38 {ram_rwl[56]}}) |
2505 (~tlb_data_[57] & {38 {ram_rwl[57]}}) |
2506 (~tlb_data_[58] & {38 {ram_rwl[58]}}) |
2507 (~tlb_data_[59] & {38 {ram_rwl[59]}}) |
2508 (~tlb_data_[60] & {38 {ram_rwl[60]}}) |
2509 (~tlb_data_[61] & {38 {ram_rwl[61]}}) |
2510 (~tlb_data_[62] & {38 {ram_rwl[62]}}) |
2511 (~tlb_data_[63] & {38 {ram_rwl[63]}}) );
2512
2513assign rd_tte_data[37:0] =
2514 ({38 {any_rwl & ~any_wwl }} & prd_data[37:0]) |
2515 ({38 {any_rwl & any_wwl & 1'bx}} ) ;
2516
2517
2518
2519
2520
2521///////////////////////////////////////////////////////////////
2522// Construct the physical page number //
2523///////////////////////////////////////////////////////////////
2524assign tte_pa[39:13] = {rd_tte_data[`DATA_PA_39_28_HI:`DATA_PA_39_28_LO],
2525 rd_tte_data[`DATA_PA_27_22_HI:`DATA_PA_27_22_LO],
2526 rd_tte_data[`DATA_PA_21_16_HI:`DATA_PA_21_16_LO],
2527 rd_tte_data[`DATA_PA_15_13_HI:`DATA_PA_15_13_LO]};
2528
2529assign pa[12:11] = va[12:11];
2530
2531assign pa[15:13] =
2532 (~rd_tte_data[`DATA_VA_15_13_V] & tlb_cam_flopped & ~tlb_bypass) ?
2533 tte_pa[15:13] : va[15:13] ;
2534assign pa[21:16] =
2535 (~rd_tte_data[`DATA_VA_21_16_V] & tlb_cam_flopped & ~tlb_bypass) ?
2536 tte_pa[21:16] : va[21:16] ;
2537assign pa[27:22] =
2538 (~rd_tte_data[`DATA_VA_27_22_V] & tlb_cam_flopped & ~tlb_bypass) ?
2539 tte_pa[27:22] : va[27:22] ;
2540assign pa[39:28] =
2541 (tlb_cam_flopped & ~tlb_bypass) ?
2542 tte_pa[39:28] : va[39:28];
2543
2544
2545
2546
2547supply0 vss; // <- port for ground
2548supply1 vdd; // <- port for power
2549
2550endmodule
2551`endif // `ifndef FPGA
2552
2553`ifdef FPGA
2554module n2_tlb_tl_64x59_ram(l1clk, tlb_bypass, tlb_cam_flopped, ram_wwl, ram_rwl,
2555 tte_data, va, pa, rd_tte_data);
2556
2557 input l1clk;
2558 input tlb_bypass;
2559 input tlb_cam_flopped;
2560 input [(64 - 1):0] ram_wwl;
2561 input [(64 - 1):0] ram_rwl;
2562 input [37:0] tte_data;
2563 input [39:11] va;
2564 output [39:11] pa;
2565 output [37:0] rd_tte_data;
2566
2567 wire any_wwl;
2568 wire any_rwl;
2569 wire [37:0] prd_data;
2570 wire [39:13] tte_pa;
2571
2572 reg [37:0] tlb_data_[(64 - 1):0];
2573 integer n;
2574 integer done;
2575 supply0 vss;
2576 supply1 vdd;
2577
2578 assign any_wwl = (|ram_wwl[(64 - 1):0]);
2579 assign any_rwl = (|ram_rwl[(64 - 1):0]);
2580 assign prd_data[37:0] = ((((((((((((((((((((((((((((((((((((((((((((((((
2581 (((((((((((((((((~tlb_data_[0]) & {38 {ram_rwl[0]}}) | ((~
2582 tlb_data_[1]) & {38 {ram_rwl[1]}})) | ((~tlb_data_[2]) & {38 {
2583 ram_rwl[2]}})) | ((~tlb_data_[3]) & {38 {ram_rwl[3]}})) | ((~
2584 tlb_data_[4]) & {38 {ram_rwl[4]}})) | ((~tlb_data_[5]) & {38 {
2585 ram_rwl[5]}})) | ((~tlb_data_[6]) & {38 {ram_rwl[6]}})) | ((~
2586 tlb_data_[7]) & {38 {ram_rwl[7]}})) | ((~tlb_data_[8]) & {38 {
2587 ram_rwl[8]}})) | ((~tlb_data_[9]) & {38 {ram_rwl[9]}})) | ((~
2588 tlb_data_[10]) & {38 {ram_rwl[10]}})) | ((~tlb_data_[11]) & {38
2589 {ram_rwl[11]}})) | ((~tlb_data_[12]) & {38 {ram_rwl[12]}})) | ((
2590 ~tlb_data_[13]) & {38 {ram_rwl[13]}})) | ((~tlb_data_[14]) & {38
2591 {ram_rwl[14]}})) | ((~tlb_data_[15]) & {38 {ram_rwl[15]}})) | ((
2592 ~tlb_data_[16]) & {38 {ram_rwl[16]}})) | ((~tlb_data_[17]) & {38
2593 {ram_rwl[17]}})) | ((~tlb_data_[18]) & {38 {ram_rwl[18]}})) | ((
2594 ~tlb_data_[19]) & {38 {ram_rwl[19]}})) | ((~tlb_data_[20]) & {38
2595 {ram_rwl[20]}})) | ((~tlb_data_[21]) & {38 {ram_rwl[21]}})) | ((
2596 ~tlb_data_[22]) & {38 {ram_rwl[22]}})) | ((~tlb_data_[23]) & {38
2597 {ram_rwl[23]}})) | ((~tlb_data_[24]) & {38 {ram_rwl[24]}})) | ((
2598 ~tlb_data_[25]) & {38 {ram_rwl[25]}})) | ((~tlb_data_[26]) & {38
2599 {ram_rwl[26]}})) | ((~tlb_data_[27]) & {38 {ram_rwl[27]}})) | ((
2600 ~tlb_data_[28]) & {38 {ram_rwl[28]}})) | ((~tlb_data_[29]) & {38
2601 {ram_rwl[29]}})) | ((~tlb_data_[30]) & {38 {ram_rwl[30]}})) | ((
2602 ~tlb_data_[31]) & {38 {ram_rwl[31]}})) | ((~tlb_data_[32]) & {38
2603 {ram_rwl[32]}})) | ((~tlb_data_[33]) & {38 {ram_rwl[33]}})) | ((
2604 ~tlb_data_[34]) & {38 {ram_rwl[34]}})) | ((~tlb_data_[35]) & {38
2605 {ram_rwl[35]}})) | ((~tlb_data_[36]) & {38 {ram_rwl[36]}})) | ((
2606 ~tlb_data_[37]) & {38 {ram_rwl[37]}})) | ((~tlb_data_[38]) & {38
2607 {ram_rwl[38]}})) | ((~tlb_data_[39]) & {38 {ram_rwl[39]}})) | ((
2608 ~tlb_data_[40]) & {38 {ram_rwl[40]}})) | ((~tlb_data_[41]) & {38
2609 {ram_rwl[41]}})) | ((~tlb_data_[42]) & {38 {ram_rwl[42]}})) | ((
2610 ~tlb_data_[43]) & {38 {ram_rwl[43]}})) | ((~tlb_data_[44]) & {38
2611 {ram_rwl[44]}})) | ((~tlb_data_[45]) & {38 {ram_rwl[45]}})) | ((
2612 ~tlb_data_[46]) & {38 {ram_rwl[46]}})) | ((~tlb_data_[47]) & {38
2613 {ram_rwl[47]}})) | ((~tlb_data_[48]) & {38 {ram_rwl[48]}})) | ((
2614 ~tlb_data_[49]) & {38 {ram_rwl[49]}})) | ((~tlb_data_[50]) & {38
2615 {ram_rwl[50]}})) | ((~tlb_data_[51]) & {38 {ram_rwl[51]}})) | ((
2616 ~tlb_data_[52]) & {38 {ram_rwl[52]}})) | ((~tlb_data_[53]) & {38
2617 {ram_rwl[53]}})) | ((~tlb_data_[54]) & {38 {ram_rwl[54]}})) | ((
2618 ~tlb_data_[55]) & {38 {ram_rwl[55]}})) | ((~tlb_data_[56]) & {38
2619 {ram_rwl[56]}})) | ((~tlb_data_[57]) & {38 {ram_rwl[57]}})) | ((
2620 ~tlb_data_[58]) & {38 {ram_rwl[58]}})) | ((~tlb_data_[59]) & {38
2621 {ram_rwl[59]}})) | ((~tlb_data_[60]) & {38 {ram_rwl[60]}})) | ((
2622 ~tlb_data_[61]) & {38 {ram_rwl[61]}})) | ((~tlb_data_[62]) & {38
2623 {ram_rwl[62]}})) | ((~tlb_data_[63]) & {38 {ram_rwl[63]}}));
2624 assign rd_tte_data[37:0] = (({38 {(any_rwl & (~any_wwl))}} &
2625 prd_data[37:0]) | {38 {((any_rwl & any_wwl) & 1'bx)}});
2626 assign tte_pa[39:13] = {rd_tte_data[35:24], rd_tte_data[23:18],
2627 rd_tte_data[16:11], rd_tte_data[9:7]};
2628 assign pa[12:11] = va[12:11];
2629 assign pa[15:13] = ((((~rd_tte_data[6]) & tlb_cam_flopped) & (~
2630 tlb_bypass)) ? tte_pa[15:13] : va[15:13]);
2631 assign pa[21:16] = ((((~rd_tte_data[10]) & tlb_cam_flopped) & (~
2632 tlb_bypass)) ? tte_pa[21:16] : va[21:16]);
2633 assign pa[27:22] = ((((~rd_tte_data[17]) & tlb_cam_flopped) & (~
2634 tlb_bypass)) ? tte_pa[27:22] : va[27:22]);
2635 assign pa[39:28] = ((tlb_cam_flopped & (~tlb_bypass)) ? tte_pa[39:28] :
2636 va[39:28]);
2637
2638 initial begin
2639 for (n = 0; (n < 64); n = (n + 1)) begin
2640 tlb_data_[n] = {38 {1'b1}};
2641 end
2642 end
2643 always @(negedge l1clk) begin
2644 done = 0;
2645 for (n = 0; (n < 64); n = (n + 1)) begin
2646 if (ram_wwl[n] && (!done)) begin
2647 tlb_data_[n] <= (~tte_data[37:0]);
2648 done = 1;
2649 end
2650 end
2651 end
2652endmodule
2653
2654`endif // `ifdef FPGA
2655
2656
2657module n2_tlb_tl_64x59_multihit (
2658 ram_rwl,
2659 tlb_bypass,
2660 tlb_cam_mhit) ;
2661wire [7:0] sum;
2662wire multiple_match;
2663wire unused;
2664
2665
2666`define ENTRIES 64
2667//`define INDEX 5
2668
2669
2670input [`ENTRIES-1:0] ram_rwl;
2671input tlb_bypass;
2672
2673
2674
2675output tlb_cam_mhit;
2676
2677
2678
2679
2680
2681assign sum[7:0] =
2682 {{7 {1'b0}}, ram_rwl[0]} +
2683 {{7 {1'b0}}, ram_rwl[1]} +
2684 {{7 {1'b0}}, ram_rwl[2]} +
2685 {{7 {1'b0}}, ram_rwl[3]} +
2686 {{7 {1'b0}}, ram_rwl[4]} +
2687 {{7 {1'b0}}, ram_rwl[5]} +
2688 {{7 {1'b0}}, ram_rwl[6]} +
2689 {{7 {1'b0}}, ram_rwl[7]} +
2690 {{7 {1'b0}}, ram_rwl[8]} +
2691 {{7 {1'b0}}, ram_rwl[9]} +
2692 {{7 {1'b0}}, ram_rwl[10]} +
2693 {{7 {1'b0}}, ram_rwl[11]} +
2694 {{7 {1'b0}}, ram_rwl[12]} +
2695 {{7 {1'b0}}, ram_rwl[13]} +
2696 {{7 {1'b0}}, ram_rwl[14]} +
2697 {{7 {1'b0}}, ram_rwl[15]} +
2698 {{7 {1'b0}}, ram_rwl[16]} +
2699 {{7 {1'b0}}, ram_rwl[17]} +
2700 {{7 {1'b0}}, ram_rwl[18]} +
2701 {{7 {1'b0}}, ram_rwl[19]} +
2702 {{7 {1'b0}}, ram_rwl[20]} +
2703 {{7 {1'b0}}, ram_rwl[21]} +
2704 {{7 {1'b0}}, ram_rwl[22]} +
2705 {{7 {1'b0}}, ram_rwl[23]} +
2706 {{7 {1'b0}}, ram_rwl[24]} +
2707 {{7 {1'b0}}, ram_rwl[25]} +
2708 {{7 {1'b0}}, ram_rwl[26]} +
2709 {{7 {1'b0}}, ram_rwl[27]} +
2710 {{7 {1'b0}}, ram_rwl[28]} +
2711 {{7 {1'b0}}, ram_rwl[29]} +
2712 {{7 {1'b0}}, ram_rwl[30]} +
2713 {{7 {1'b0}}, ram_rwl[31]} +
2714 {{7 {1'b0}}, ram_rwl[32]} +
2715 {{7 {1'b0}}, ram_rwl[33]} +
2716 {{7 {1'b0}}, ram_rwl[34]} +
2717 {{7 {1'b0}}, ram_rwl[35]} +
2718 {{7 {1'b0}}, ram_rwl[36]} +
2719 {{7 {1'b0}}, ram_rwl[37]} +
2720 {{7 {1'b0}}, ram_rwl[38]} +
2721 {{7 {1'b0}}, ram_rwl[39]} +
2722 {{7 {1'b0}}, ram_rwl[40]} +
2723 {{7 {1'b0}}, ram_rwl[41]} +
2724 {{7 {1'b0}}, ram_rwl[42]} +
2725 {{7 {1'b0}}, ram_rwl[43]} +
2726 {{7 {1'b0}}, ram_rwl[44]} +
2727 {{7 {1'b0}}, ram_rwl[45]} +
2728 {{7 {1'b0}}, ram_rwl[46]} +
2729 {{7 {1'b0}}, ram_rwl[47]} +
2730 {{7 {1'b0}}, ram_rwl[48]} +
2731 {{7 {1'b0}}, ram_rwl[49]} +
2732 {{7 {1'b0}}, ram_rwl[50]} +
2733 {{7 {1'b0}}, ram_rwl[51]} +
2734 {{7 {1'b0}}, ram_rwl[52]} +
2735 {{7 {1'b0}}, ram_rwl[53]} +
2736 {{7 {1'b0}}, ram_rwl[54]} +
2737 {{7 {1'b0}}, ram_rwl[55]} +
2738 {{7 {1'b0}}, ram_rwl[56]} +
2739 {{7 {1'b0}}, ram_rwl[57]} +
2740 {{7 {1'b0}}, ram_rwl[58]} +
2741 {{7 {1'b0}}, ram_rwl[59]} +
2742 {{7 {1'b0}}, ram_rwl[60]} +
2743 {{7 {1'b0}}, ram_rwl[61]} +
2744 {{7 {1'b0}}, ram_rwl[62]} +
2745 {{7 {1'b0}}, ram_rwl[63]} ;
2746//
2747//
2748//
2749//
2750//
2751//
2752//
2753//
2754//
2755//
2756//
2757//
2758//
2759//
2760//
2761//
2762//
2763//
2764//
2765//
2766//
2767//
2768//
2769//
2770//
2771//
2772//
2773//
2774//
2775//
2776//
2777//
2778//
2779//
2780//
2781//
2782//
2783//
2784//
2785//
2786//
2787//
2788//
2789//
2790//
2791//
2792//
2793//
2794//
2795//
2796//
2797//
2798//
2799//
2800//
2801//
2802//
2803//
2804//
2805//
2806//
2807//
2808//
2809//
2810
2811
2812assign multiple_match =
2813 (| sum[7:1]) & ~tlb_bypass;
2814
2815assign unused = sum[0];
2816
2817assign tlb_cam_mhit =
2818 multiple_match;
2819
2820
2821supply0 vss; // <- port for ground
2822supply1 vdd; // <- port for power
2823endmodule
2824
2825
2826`ifndef FPGA
2827module n2_tlb_tl_64x59_ubit (
2828 l1clk,
2829 disable_clear_ubit,
2830 tlb_bypass,
2831 ram_rwl,
2832 ram_wwl,
2833 tte_ubit,
2834 tlb_wr_flopped,
2835 tlb_rd_flopped,
2836 tlb_cam_flopped,
2837 used,
2838 rd_tte_u_bit) ;
2839wire all_entries_used;
2840
2841
2842`define ENTRIES 64
2843
2844
2845
2846input l1clk;
2847input disable_clear_ubit;
2848
2849input tlb_bypass;
2850input [`ENTRIES-1:0] ram_rwl;
2851input [`ENTRIES-1:0] ram_wwl;
2852input tte_ubit;
2853
2854input tlb_wr_flopped;
2855input tlb_rd_flopped;
2856input tlb_cam_flopped;
2857
2858
2859
2860output [`ENTRIES-1:0] used;
2861output rd_tte_u_bit;
2862
2863
2864
2865//----------------------------------------------------------------------
2866// Declarations
2867//----------------------------------------------------------------------
2868reg [`ENTRIES-1:0] used;
2869
2870integer n;
2871
2872reg rd_tte_u_bit_in;
2873
2874
2875`ifndef NOINITMEM
2876///////////////////////////////////////
2877// Initialize the arrays. //
2878///////////////////////////////////////
2879initial begin
2880 used[`ENTRIES-1:0] = {`ENTRIES {1'b0}} ;
2881end
2882`endif
2883
2884
2885
2886assign all_entries_used =
2887 (& used[`ENTRIES-1:0]) & ~disable_clear_ubit;
2888
2889
2890always @(negedge l1clk) begin
2891 // Maintain the used bits
2892 if (all_entries_used) begin
2893 used[`ENTRIES-1:0] <= {`ENTRIES {1'b0}};
2894 end
2895
2896 if (~all_entries_used & ((~tlb_bypass & tlb_cam_flopped) | tlb_wr_flopped)) begin
2897 for (n = 0; n < `ENTRIES; n = n + 1) begin
2898 if (ram_rwl[n]) begin
2899 used[n] <= 1'b1;
2900 end
2901 if (ram_wwl[n]) begin
2902 used[n] <= tte_ubit;
2903 end
2904 end
2905 end // if (~all_entries_used & ((~tlb_bypass & tlb_cam_flopped) | tlb_wr_flopped))
2906
2907
2908end // always @ (negedge l1clk)
2909
2910
2911
2912
2913///////////////////////////////////////////////////////////////
2914// Read U bit
2915///////////////////////////////////////////////////////////////
2916
2917
2918always @(ram_rwl[`ENTRIES-1:0] or used[`ENTRIES-1:0] or tlb_rd_flopped) begin
2919
2920 rd_tte_u_bit_in = {1'b0};
2921
2922 if (tlb_rd_flopped & (| ram_rwl[`ENTRIES-1:0])) begin
2923 for (n = 0; n < `ENTRIES; n = n + 1) begin
2924 if (ram_rwl[n]) begin
2925 rd_tte_u_bit_in = used[n];
2926
2927
2928 n = `ENTRIES;
2929
2930 end // if (ram_wl[n])
2931 end // for (n = 0; n < `ENTRIES; n = n + 1)
2932 end // if (tlb_rd_flopped & (| ram_rwl[`ENTRIES-1:0]))
2933 else if (~tlb_rd_flopped & (| ram_rwl[`ENTRIES-1:0])) begin
2934 rd_tte_u_bit_in = {1'bx};
2935 end
2936
2937end
2938
2939assign rd_tte_u_bit =
2940 rd_tte_u_bit_in;
2941
2942
2943supply0 vss; // <- port for ground
2944supply1 vdd; // <- port for power
2945endmodule
2946`endif // `ifndef FPGA
2947
2948`ifdef FPGA
2949module n2_tlb_tl_64x59_ubit(l1clk, disable_clear_ubit, tlb_bypass, ram_rwl,
2950 ram_wwl, tte_ubit, tlb_wr_flopped, tlb_rd_flopped, tlb_cam_flopped,
2951 used, rd_tte_u_bit);
2952
2953 input l1clk;
2954 input disable_clear_ubit;
2955 input tlb_bypass;
2956 input [(64 - 1):0] ram_rwl;
2957 input [(64 - 1):0] ram_wwl;
2958 input tte_ubit;
2959 input tlb_wr_flopped;
2960 input tlb_rd_flopped;
2961 input tlb_cam_flopped;
2962 output [(64 - 1):0] used;
2963 output rd_tte_u_bit;
2964
2965 wire all_entries_used;
2966 reg [(64 - 1):0] used;
2967 integer n;
2968 integer done;
2969 reg rd_tte_u_bit_in;
2970 supply0 vss;
2971 supply1 vdd;
2972
2973 assign all_entries_used = ((&used[(64 - 1):0]) & (~disable_clear_ubit));
2974 assign rd_tte_u_bit = rd_tte_u_bit_in;
2975
2976 initial begin
2977 used[(64 - 1):0] = {64 {1'b0}};
2978 end
2979 always @(negedge l1clk) begin
2980 if (all_entries_used) begin
2981 used[(64 - 1):0] <= {64 {1'b0}};
2982 end
2983 if ((~all_entries_used) & (((~tlb_bypass) & tlb_cam_flopped) |
2984 tlb_wr_flopped)) begin
2985 for (n = 0; (n < 64); n = (n + 1)) begin
2986 if (ram_rwl[n]) begin
2987 used[n] <= 1'b1;
2988 end
2989 if (ram_wwl[n]) begin
2990 used[n] <= tte_ubit;
2991 end
2992 end
2993 end
2994 end
2995 always @(ram_rwl[(64 - 1):0] or used[(64 - 1):0] or tlb_rd_flopped)
2996 begin
2997 rd_tte_u_bit_in = {1'b0};
2998 if (tlb_rd_flopped & (|ram_rwl[(64 - 1):0])) begin
2999 done = 0;
3000 for (n = 0; (n < 64); n = (n + 1)) begin
3001 if (ram_rwl[n] && (!done)) begin
3002 rd_tte_u_bit_in = used[n];
3003 done = 1;
3004 end
3005 end
3006 end
3007 end
3008endmodule
3009
3010`endif // `ifdef FPGA
3011
3012
3013
3014module n2_tlb_tl_64x59_repl_index (
3015 l1clk,
3016 used,
3017 valid,
3018 tlb_replacement_index) ;
3019wire [63:0] nu_or_nv;
3020wire [63:0] used_and_valid;
3021wire [1:0] enc4_00;
3022wire sel4_00_b;
3023wire [1:0] enc4_01;
3024wire sel4_01_b;
3025wire [1:0] enc4_02;
3026wire sel4_02_b;
3027wire [1:0] enc4_03;
3028wire sel4_03_b;
3029wire [1:0] enc4_04;
3030wire sel4_04_b;
3031wire [1:0] enc4_05;
3032wire sel4_05_b;
3033wire [1:0] enc4_06;
3034wire sel4_06_b;
3035wire [1:0] enc4_07;
3036wire sel4_07_b;
3037wire [1:0] enc4_08;
3038wire sel4_08_b;
3039wire [1:0] enc4_09;
3040wire sel4_09_b;
3041wire [1:0] enc4_10;
3042wire sel4_10_b;
3043wire [1:0] enc4_11;
3044wire sel4_11_b;
3045wire [1:0] enc4_12;
3046wire sel4_12_b;
3047wire [1:0] enc4_13;
3048wire sel4_13_b;
3049wire [1:0] enc4_14;
3050wire sel4_14_b;
3051wire [1:0] enc4_15;
3052wire sel4_15_b;
3053wire [2:0] enc8_00;
3054wire sel8_00_b;
3055wire [2:0] enc8_01;
3056wire sel8_01_b;
3057wire [2:0] enc8_02;
3058wire sel8_02_b;
3059wire [2:0] enc8_03;
3060wire sel8_03_b;
3061wire [2:0] enc8_04;
3062wire sel8_04_b;
3063wire [2:0] enc8_05;
3064wire sel8_05_b;
3065wire [2:0] enc8_06;
3066wire sel8_06_b;
3067wire [2:0] enc8_07;
3068wire sel8_07_b;
3069wire [3:0] enc16_0;
3070wire sel16_0_b;
3071wire [3:0] enc16_1;
3072wire sel16_1_b;
3073wire [3:0] enc16_2;
3074wire sel16_2_b;
3075wire [3:0] enc16_3;
3076wire sel16_3_b;
3077wire unused;
3078wire [3:0] enc16_l_0;
3079wire [3:0] enc16_l_1;
3080wire [3:0] enc16_l_2;
3081wire [3:0] enc16_l_3;
3082wire sel16_l_0_b;
3083wire sel16_l_1_b;
3084wire sel16_l_2_b;
3085wire sel16_l_3_b_unused;
3086wire [4:0] enc32_0;
3087wire sel32_0_b;
3088wire [4:0] enc32_1;
3089wire [5:0] enc64_0;
3090
3091
3092`define ENTRIES 64
3093`define INDEX 5
3094
3095
3096input l1clk;
3097
3098input [`ENTRIES-1:0] used;
3099input [`ENTRIES-1:0] valid;
3100
3101
3102output [`INDEX:0] tlb_replacement_index;
3103
3104
3105
3106assign nu_or_nv[`ENTRIES-1:0] =
3107 ~valid[`ENTRIES-1:0] | ~used[`ENTRIES-1:0];
3108
3109assign used_and_valid[`ENTRIES-1:0] =
3110 ~nu_or_nv[`ENTRIES-1:0];
3111
3112
3113// 4 bit priority encoders
3114assign enc4_00[1] = used_and_valid[0] & used_and_valid[1];
3115assign enc4_00[0] = used_and_valid[0] & (~used_and_valid[1] | used_and_valid[2]);
3116assign sel4_00_b = &used_and_valid[3:0];
3117
3118assign enc4_01[1] = used_and_valid[4] & used_and_valid[5];
3119assign enc4_01[0] = used_and_valid[4] & (~used_and_valid[5] | used_and_valid[6]);
3120assign sel4_01_b = &used_and_valid[7:4];
3121
3122assign enc4_02[1] = used_and_valid[8] & used_and_valid[9];
3123assign enc4_02[0] = used_and_valid[8] & (~used_and_valid[9] | used_and_valid[10]);
3124assign sel4_02_b = &used_and_valid[11:8];
3125
3126assign enc4_03[1] = used_and_valid[12] & used_and_valid[13];
3127assign enc4_03[0] = used_and_valid[12] & (~used_and_valid[13] | used_and_valid[14]);
3128assign sel4_03_b = &used_and_valid[15:12];
3129
3130assign enc4_04[1] = used_and_valid[16] & used_and_valid[17];
3131assign enc4_04[0] = used_and_valid[16] & (~used_and_valid[17] | used_and_valid[18]);
3132assign sel4_04_b = &used_and_valid[19:16];
3133
3134assign enc4_05[1] = used_and_valid[20] & used_and_valid[21];
3135assign enc4_05[0] = used_and_valid[20] & (~used_and_valid[21] | used_and_valid[22]);
3136assign sel4_05_b = &used_and_valid[23:20];
3137
3138assign enc4_06[1] = used_and_valid[24] & used_and_valid[25];
3139assign enc4_06[0] = used_and_valid[24] & (~used_and_valid[25] | used_and_valid[26]);
3140assign sel4_06_b = &used_and_valid[27:24];
3141
3142assign enc4_07[1] = used_and_valid[28] & used_and_valid[29];
3143assign enc4_07[0] = used_and_valid[28] & (~used_and_valid[29] | used_and_valid[30]);
3144assign sel4_07_b = &used_and_valid[31:28];
3145
3146assign enc4_08[1] = used_and_valid[32] & used_and_valid[33];
3147assign enc4_08[0] = used_and_valid[32] & (~used_and_valid[33] | used_and_valid[34]);
3148assign sel4_08_b = &used_and_valid[35:32];
3149
3150assign enc4_09[1] = used_and_valid[36] & used_and_valid[37];
3151assign enc4_09[0] = used_and_valid[36] & (~used_and_valid[37] | used_and_valid[38]);
3152assign sel4_09_b = &used_and_valid[39:36];
3153
3154assign enc4_10[1] = used_and_valid[40] & used_and_valid[41];
3155assign enc4_10[0] = used_and_valid[40] & (~used_and_valid[41] | used_and_valid[42]);
3156assign sel4_10_b = &used_and_valid[43:40];
3157
3158assign enc4_11[1] = used_and_valid[44] & used_and_valid[45];
3159assign enc4_11[0] = used_and_valid[44] & (~used_and_valid[45] | used_and_valid[46]);
3160assign sel4_11_b = &used_and_valid[47:44];
3161
3162assign enc4_12[1] = used_and_valid[48] & used_and_valid[49];
3163assign enc4_12[0] = used_and_valid[48] & (~used_and_valid[49] | used_and_valid[50]);
3164assign sel4_12_b = &used_and_valid[51:48];
3165
3166assign enc4_13[1] = used_and_valid[52] & used_and_valid[53];
3167assign enc4_13[0] = used_and_valid[52] & (~used_and_valid[53] | used_and_valid[54]);
3168assign sel4_13_b = &used_and_valid[55:52];
3169
3170assign enc4_14[1] = used_and_valid[56] & used_and_valid[57];
3171assign enc4_14[0] = used_and_valid[56] & (~used_and_valid[57] | used_and_valid[58]);
3172assign sel4_14_b = &used_and_valid[59:56];
3173
3174assign enc4_15[1] = used_and_valid[60] & used_and_valid[61];
3175assign enc4_15[0] = used_and_valid[60] & (~used_and_valid[61] | used_and_valid[62]);
3176assign sel4_15_b = &used_and_valid[63:60];
3177
3178
3179// Now generate 8 bit group encodings
3180assign enc8_00[2] = sel4_00_b;
3181assign enc8_00[1:0] = (enc4_00[1:0] & {2 {~sel4_00_b}}) | (enc4_01[1:0] & {2 {sel4_00_b}});
3182assign sel8_00_b = sel4_00_b & sel4_01_b;
3183
3184assign enc8_01[2] = sel4_02_b;
3185assign enc8_01[1:0] = (enc4_02[1:0] & {2 {~sel4_02_b}}) | (enc4_03[1:0] & {2 {sel4_02_b}});
3186assign sel8_01_b = sel4_02_b & sel4_03_b;
3187
3188assign enc8_02[2] = sel4_04_b;
3189assign enc8_02[1:0] = (enc4_04[1:0] & {2 {~sel4_04_b}}) | (enc4_05[1:0] & {2 {sel4_04_b}});
3190assign sel8_02_b = sel4_04_b & sel4_05_b;
3191
3192assign enc8_03[2] = sel4_06_b;
3193assign enc8_03[1:0] = (enc4_06[1:0] & {2 {~sel4_06_b}}) | (enc4_07[1:0] & {2 {sel4_06_b}});
3194assign sel8_03_b = sel4_06_b & sel4_07_b;
3195
3196assign enc8_04[2] = sel4_08_b;
3197assign enc8_04[1:0] = (enc4_08[1:0] & {2 {~sel4_08_b}}) | (enc4_09[1:0] & {2 {sel4_08_b}});
3198assign sel8_04_b = sel4_08_b & sel4_09_b;
3199
3200assign enc8_05[2] = sel4_10_b;
3201assign enc8_05[1:0] = (enc4_10[1:0] & {2 {~sel4_10_b}}) | (enc4_11[1:0] & {2 {sel4_10_b}});
3202assign sel8_05_b = sel4_10_b & sel4_11_b;
3203
3204assign enc8_06[2] = sel4_12_b;
3205assign enc8_06[1:0] = (enc4_12[1:0] & {2 {~sel4_12_b}}) | (enc4_13[1:0] & {2 {sel4_12_b}});
3206assign sel8_06_b = sel4_12_b & sel4_13_b;
3207
3208assign enc8_07[2] = sel4_14_b;
3209assign enc8_07[1:0] = (enc4_14[1:0] & {2 {~sel4_14_b}}) | (enc4_15[1:0] & {2 {sel4_14_b}});
3210assign sel8_07_b = sel4_14_b & sel4_15_b;
3211
3212
3213// Now generate 16 bit group encodings
3214assign enc16_0[3] = sel8_00_b;
3215assign enc16_0[2:0] = (enc8_00[2:0] & {3 {~sel8_00_b}}) | (enc8_01[2:0] & {3 {sel8_00_b}});
3216assign sel16_0_b = sel8_00_b & sel8_01_b;
3217
3218assign enc16_1[3] = sel8_02_b;
3219assign enc16_1[2:0] = (enc8_02[2:0] & {3 {~sel8_02_b}}) | (enc8_03[2:0] & {3 {sel8_02_b}});
3220assign sel16_1_b = sel8_02_b & sel8_03_b;
3221
3222assign enc16_2[3] = sel8_04_b;
3223assign enc16_2[2:0] = (enc8_04[2:0] & {3 {~sel8_04_b}}) | (enc8_05[2:0] & {3 {sel8_04_b}});
3224assign sel16_2_b = sel8_04_b & sel8_05_b;
3225
3226assign enc16_3[3] = sel8_06_b;
3227assign enc16_3[2:0] = (enc8_06[2:0] & {3 {~sel8_06_b}}) | (enc8_07[2:0] & {3 {sel8_06_b}});
3228assign sel16_3_b = sel8_06_b & sel8_07_b;
3229
3230
3231// Now flop (nonscan)
3232
3233n2_tlb_tl_64x59_cust_msff_ctl_macro__width_20 enc16_lat (
3234 .scan_in (1'b0),
3235 .scan_out (unused),
3236 .l1clk (l1clk),
3237 .siclk (1'b0),
3238 .soclk (1'b0),
3239 .din ({enc16_0[3:0],
3240 enc16_1[3:0],
3241 enc16_2[3:0],
3242 enc16_3[3:0],
3243 sel16_0_b,
3244 sel16_1_b,
3245 sel16_2_b,
3246 sel16_3_b}),
3247 .dout ({enc16_l_0[3:0],
3248 enc16_l_1[3:0],
3249 enc16_l_2[3:0],
3250 enc16_l_3[3:0],
3251 sel16_l_0_b,
3252 sel16_l_1_b,
3253 sel16_l_2_b,
3254 sel16_l_3_b_unused})
3255);
3256
3257
3258
3259// Now generate 32 bit group encodings
3260assign enc32_0[4] = sel16_l_0_b;
3261assign enc32_0[3:0] = (enc16_l_0[3:0] & {4 {~sel16_l_0_b}}) | (enc16_l_1[3:0] & {4 {sel16_l_0_b}});
3262assign sel32_0_b = sel16_l_0_b & sel16_l_1_b;
3263
3264assign enc32_1[4] = sel16_l_2_b;
3265assign enc32_1[3:0] = (enc16_l_2[3:0] & {4 {~sel16_l_2_b}}) | (enc16_l_3[3:0] & {4 {sel16_l_2_b}});
3266
3267
3268
3269// Now generate 64 bit group encodings
3270assign enc64_0[5] = sel32_0_b;
3271assign enc64_0[4:0] = (enc32_0[4:0] & {5 {~sel32_0_b}}) | (enc32_1[4:0] & {5 {sel32_0_b}});
3272
3273
3274assign tlb_replacement_index[5:0] = enc64_0[5:0];
3275
3276
3277supply0 vss; // <- port for ground
3278supply1 vdd; // <- port for power
3279endmodule
3280
3281
3282
3283
3284
3285
3286// any PARAMS parms go into naming of macro
3287
3288module n2_tlb_tl_64x59_cust_msff_ctl_macro__width_20 (
3289 din,
3290 l1clk,
3291 scan_in,
3292 siclk,
3293 soclk,
3294 dout,
3295 scan_out);
3296wire [19:0] fdin;
3297wire [18:0] so;
3298
3299 input [19:0] din;
3300 input l1clk;
3301 input scan_in;
3302
3303
3304 input siclk;
3305 input soclk;
3306
3307 output [19:0] dout;
3308 output scan_out;
3309assign fdin[19:0] = din[19:0];
3310
3311
3312
3313
3314
3315
3316dff #(20) d0_0 (
3317.l1clk(l1clk),
3318.siclk(siclk),
3319.soclk(soclk),
3320.d(fdin[19:0]),
3321.si({scan_in,so[18:0]}),
3322.so({so[18:0],scan_out}),
3323.q(dout[19:0])
3324);
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337endmodule
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351// any PARAMS parms go into naming of macro
3352
3353module n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_27 (
3354 din,
3355 l1clk,
3356 scan_in,
3357 siclk,
3358 soclk,
3359 dout,
3360 scan_out);
3361wire [26:0] fdin;
3362
3363 input [26:0] din;
3364 input l1clk;
3365 input [26:0] scan_in;
3366
3367
3368 input siclk;
3369 input soclk;
3370
3371 output [26:0] dout;
3372 output [26:0] scan_out;
3373assign fdin[26:0] = din[26:0];
3374
3375
3376
3377
3378
3379
3380dff #(27) d0_0 (
3381.l1clk(l1clk),
3382.siclk(siclk),
3383.soclk(soclk),
3384.d(fdin[26:0]),
3385.si(scan_in[26:0]),
3386.so(scan_out[26:0]),
3387.q(dout[26:0])
3388);
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401endmodule
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411//
3412// invert macro
3413//
3414//
3415
3416
3417
3418
3419
3420module n2_tlb_tl_64x59_cust_inv_macro__stack_66c__width_66 (
3421 din,
3422 dout);
3423 input [65:0] din;
3424 output [65:0] dout;
3425
3426
3427
3428
3429
3430
3431inv #(66) d0_0 (
3432.in(din[65:0]),
3433.out(dout[65:0])
3434);
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444endmodule
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454// any PARAMS parms go into naming of macro
3455
3456module n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_66 (
3457 din,
3458 l1clk,
3459 scan_in,
3460 siclk,
3461 soclk,
3462 dout,
3463 scan_out);
3464wire [65:0] fdin;
3465
3466 input [65:0] din;
3467 input l1clk;
3468 input [65:0] scan_in;
3469
3470
3471 input siclk;
3472 input soclk;
3473
3474 output [65:0] dout;
3475 output [65:0] scan_out;
3476assign fdin[65:0] = din[65:0];
3477
3478
3479
3480
3481
3482
3483dff #(66) d0_0 (
3484.l1clk(l1clk),
3485.siclk(siclk),
3486.soclk(soclk),
3487.d(fdin[65:0]),
3488.si(scan_in[65:0]),
3489.so(scan_out[65:0]),
3490.q(dout[65:0])
3491);
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504endmodule
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514//
3515// comparator macro (output is 1 if both inputs are equal; 0 otherwise)
3516//
3517//
3518
3519
3520
3521
3522
3523module n2_tlb_tl_64x59_cust_cmp_macro__width_32 (
3524 din0,
3525 din1,
3526 dout);
3527 input [31:0] din0;
3528 input [31:0] din1;
3529 output dout;
3530
3531
3532
3533
3534
3535
3536cmp #(32) m0_0 (
3537.in0(din0[31:0]),
3538.in1(din1[31:0]),
3539.out(dout)
3540);
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551endmodule
3552
3553
3554
3555
3556
3557//
3558// invert macro
3559//
3560//
3561
3562
3563
3564
3565
3566module n2_tlb_tl_64x59_cust_inv_macro__width_8 (
3567 din,
3568 dout);
3569 input [7:0] din;
3570 output [7:0] dout;
3571
3572
3573
3574
3575
3576
3577inv #(8) d0_0 (
3578.in(din[7:0]),
3579.out(dout[7:0])
3580);
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590endmodule
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600// any PARAMS parms go into naming of macro
3601
3602module n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_8 (
3603 din,
3604 l1clk,
3605 scan_in,
3606 siclk,
3607 soclk,
3608 dout,
3609 scan_out);
3610wire [7:0] fdin;
3611
3612 input [7:0] din;
3613 input l1clk;
3614 input [7:0] scan_in;
3615
3616
3617 input siclk;
3618 input soclk;
3619
3620 output [7:0] dout;
3621 output [7:0] scan_out;
3622assign fdin[7:0] = din[7:0];
3623
3624
3625
3626
3627
3628
3629dff #(8) d0_0 (
3630.l1clk(l1clk),
3631.siclk(siclk),
3632.soclk(soclk),
3633.d(fdin[7:0]),
3634.si(scan_in[7:0]),
3635.so(scan_out[7:0]),
3636.q(dout[7:0])
3637);
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650endmodule
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660// general mux macro for pass-gate and and-or muxes with/wout priority encoders
3661// also for pass-gate with decoder
3662
3663
3664
3665
3666
3667// any PARAMS parms go into naming of macro
3668
3669module n2_tlb_tl_64x59_cust_mux_macro__mux_aonpe__ports_8__width_1 (
3670 din0,
3671 sel0,
3672 din1,
3673 sel1,
3674 din2,
3675 sel2,
3676 din3,
3677 sel3,
3678 din4,
3679 sel4,
3680 din5,
3681 sel5,
3682 din6,
3683 sel6,
3684 din7,
3685 sel7,
3686 dout);
3687wire buffout0;
3688wire buffout1;
3689wire buffout2;
3690wire buffout3;
3691wire buffout4;
3692wire buffout5;
3693wire buffout6;
3694wire buffout7;
3695
3696 input [0:0] din0;
3697 input sel0;
3698 input [0:0] din1;
3699 input sel1;
3700 input [0:0] din2;
3701 input sel2;
3702 input [0:0] din3;
3703 input sel3;
3704 input [0:0] din4;
3705 input sel4;
3706 input [0:0] din5;
3707 input sel5;
3708 input [0:0] din6;
3709 input sel6;
3710 input [0:0] din7;
3711 input sel7;
3712 output [0:0] dout;
3713
3714
3715
3716
3717
3718cl_dp1_muxbuff8_8x c0_0 (
3719 .in0(sel0),
3720 .in1(sel1),
3721 .in2(sel2),
3722 .in3(sel3),
3723 .in4(sel4),
3724 .in5(sel5),
3725 .in6(sel6),
3726 .in7(sel7),
3727 .out0(buffout0),
3728 .out1(buffout1),
3729 .out2(buffout2),
3730 .out3(buffout3),
3731 .out4(buffout4),
3732 .out5(buffout5),
3733 .out6(buffout6),
3734 .out7(buffout7)
3735);
3736mux8s #(1) d0_0 (
3737 .sel0(buffout0),
3738 .sel1(buffout1),
3739 .sel2(buffout2),
3740 .sel3(buffout3),
3741 .sel4(buffout4),
3742 .sel5(buffout5),
3743 .sel6(buffout6),
3744 .sel7(buffout7),
3745 .in0(din0[0:0]),
3746 .in1(din1[0:0]),
3747 .in2(din2[0:0]),
3748 .in3(din3[0:0]),
3749 .in4(din4[0:0]),
3750 .in5(din5[0:0]),
3751 .in6(din6[0:0]),
3752 .in7(din7[0:0]),
3753.dout(dout[0:0])
3754);
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768endmodule
3769
3770
3771//
3772// parity macro (even parity)
3773//
3774//
3775
3776
3777
3778
3779
3780module n2_tlb_tl_64x59_cust_prty_macro__width_32 (
3781 din,
3782 dout);
3783 input [31:0] din;
3784 output dout;
3785
3786
3787
3788
3789
3790
3791
3792prty #(32) m0_0 (
3793.in(din[31:0]),
3794.out(dout)
3795);
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806endmodule
3807
3808
3809
3810
3811
3812//
3813// parity macro (even parity)
3814//
3815//
3816
3817
3818
3819
3820
3821module n2_tlb_tl_64x59_cust_prty_macro__width_8 (
3822 din,
3823 dout);
3824 input [7:0] din;
3825 output dout;
3826
3827
3828
3829
3830
3831
3832
3833prty #(8) m0_0 (
3834.in(din[7:0]),
3835.out(dout)
3836);
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847endmodule
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857// any PARAMS parms go into naming of macro
3858
3859module n2_tlb_tl_64x59_cust_msff_ctl_macro__fs_1__width_4 (
3860 din,
3861 l1clk,
3862 scan_in,
3863 siclk,
3864 soclk,
3865 dout,
3866 scan_out);
3867wire [3:0] fdin;
3868
3869 input [3:0] din;
3870 input l1clk;
3871 input [3:0] scan_in;
3872
3873
3874 input siclk;
3875 input soclk;
3876
3877 output [3:0] dout;
3878 output [3:0] scan_out;
3879assign fdin[3:0] = din[3:0];
3880
3881
3882
3883
3884
3885
3886dff #(4) d0_0 (
3887.l1clk(l1clk),
3888.siclk(siclk),
3889.soclk(soclk),
3890.d(fdin[3:0]),
3891.si(scan_in[3:0]),
3892.so(scan_out[3:0]),
3893.q(dout[3:0])
3894);
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907endmodule
3908
3909
3910
3911
3912
3913
3914
3915