aboutsummaryrefslogtreecommitdiffstats
path: root/data/cells_xilinx_7.v
blob: cc72893274013f8c994def4980dd687f154c7890 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
// Based on the simulation models from /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/

module IBUF(O, I);
   output O;
   input  I;
   assign O = I;
endmodule

module OBUF(O, I);
   output O;
   input  I;
   assign O = I;
endmodule

module OBUFT(O, I, T);
   output O;
   input  I, T;
   assign O = T ? 1'bz : I;
endmodule

module GND(G);
   output G;
   assign G = 0;
endmodule

module INV(O, I);
   input I;
   output O;
   assign O = !I;
endmodule

module LUT1(O, I0);
   parameter INIT = 0;
   input I0;
   wire [1:0] lutdata = INIT;
   wire [0:0] idx = { I0 };
   output     O;
   assign O = lutdata[idx];
endmodule

module LUT2(O, I0, I1);
   parameter INIT = 0;
   input I0, I1;
   wire [3:0] lutdata = INIT;
   wire [1:0] idx = { I1, I0 };
   output     O;
   assign O = lutdata[idx];
endmodule

module LUT3(O, I0, I1, I2);
   parameter INIT = 0;
   input I0, I1, I2;
   wire [7:0] lutdata = INIT;
   wire [2:0] idx = { I2, I1, I0 };
   output     O;
   assign O = lutdata[idx];
endmodule

module LUT4(O, I0, I1, I2, I3);
   parameter INIT = 0;
   input I0, I1, I2, I3;
   wire [15:0] lutdata = INIT;
   wire [3:0]  idx = { I3, I2, I1, I0 };
   output      O;
   assign O = lutdata[idx];
endmodule

module LUT5(O, I0, I1, I2, I3, I4);
   parameter INIT = 0;
   input I0, I1, I2, I3, I4;
   wire [31:0] lutdata = INIT;
   wire [4:0]  idx = { I4, I3, I2, I1, I0 };
   output      O;
   assign O = lutdata[idx];
endmodule

module LUT6(O, I0, I1, I2, I3, I4, I5);
   parameter INIT = 0;
   input I0, I1, I2, I3, I4, I5;
   wire [63:0] lutdata = INIT;
   wire [5:0]  idx = { I5, I4, I3, I2, I1, I0 };
   output      O;
   assign O = lutdata[idx];
endmodule

module MUXCY(O, CI, DI, S);
   input CI, DI, S;
   output O;
   assign O = S ? CI : DI;
endmodule

module MUXF7(O, I0, I1, S);
   input I0, I1, S;
   output O;
   assign O = S ? I1 : I0;
endmodule

module MUXF8(O, I0, I1, S);
   input I0, I1, S;
   output O;
   assign O = S ? I1 : I0;
endmodule

module VCC(P);
   output P;
   assign P = 1;
endmodule

module XORCY(O, CI, LI);
   input CI, LI;
   output O;
   assign O = CI ^ LI;
endmodule

module CARRY4(CO, O, CI, CYINIT, DI, S);
   output [3:0] CO, O;
   input        CI, CYINIT;
   input [3:0]  DI, S;
   wire         ci_or_cyinit;
   assign O = S ^ {CO[2:0], ci_or_cyinit};
   assign CO[0] = S[0] ? ci_or_cyinit : DI[0];
   assign CO[1] = S[1] ? CO[0] : DI[1];
   assign CO[2] = S[2] ? CO[1] : DI[2];
   assign CO[3] = S[3] ? CO[2] : DI[3];
   assign ci_or_cyinit = CI | CYINIT;
endmodule

module FD_1 (Q, C, D);
   parameter INIT = 1'b0;
   output Q;
   input  C, D;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(negedge C  )
	 q_out <= D;
endmodule // FD_1

module FDC_1 (Q, C, CLR, D);
   parameter INIT = 1'b0;
   output Q;
   input  C, CLR, D;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR)
     if (CLR)
       q_out <= 0;
   always @(negedge C)
	 q_out <=  D;
endmodule // FDC_1

module FDCE_1 (Q, C, CE, CLR, D);
   parameter INIT = 1'b0;
   output Q;
   input  C, CE, CLR, D;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR)
     if (CLR)
       q_out <= 0;
   always @(negedge C)
     if (CE)
       q_out <=  D;
endmodule // FDCE_1

module FDCE (Q, C, CE, CLR, D);
   parameter INIT = 1'b0;
   output Q;
   input  C, CE, CLR, D;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR)
     if (CLR)
       q_out <= 0;
   always @(posedge C)
     if (CE)
	   q_out <= D;
endmodule // FDCE

module FDCP_1 (Q, C, CLR, D, PRE);
   parameter INIT = 1'b0;
   output Q;
   input  C, CLR, D, PRE;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or PRE)
     if (CLR)
       q_out <= 0;
     else if (PRE)
       q_out <= 1;
   always @(negedge C )
     q_out <=  D;
endmodule // FDCP_1

module FDCPE_1 (Q, C, CE, CLR, D, PRE);
   parameter INIT = 1'b0;
   output Q;
   input  C, CE, CLR, D, PRE;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or PRE)
     if (CLR)
       q_out <= 0;
     else if (PRE)
       q_out <= 1;
   always @(negedge C )
     if ( CE ==1)
       q_out <=  D;
endmodule // FDCPE_1

module FDCPE (Q, C, CE, CLR, D, PRE);
   parameter INIT = 1'b0;
   output Q;
   input  C, CE, CLR, D, PRE;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or PRE)
     if (CLR)
       q_out <= 0;
     else if (PRE)
       q_out <= 1;
   always @(posedge C )
     if (CE)
	   q_out <= D;
endmodule // FDCPE

module FDCP (Q, C, CLR, D, PRE);
   parameter INIT = 1'b0;
   output Q;
   input  C, CLR, D, PRE;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or PRE)
     if (CLR)
       q_out <= 0;
     else if (PRE)
       q_out <= 1;
   always @(posedge C )
	 q_out <=  D;
endmodule // FDCP

module FDC (Q, C, CLR, D);
   parameter INIT = 1'b0;
   output Q;
   input  C, CLR, D;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   always @(CLR)
     if (CLR)
       q_out <= 0;
   always @(posedge C)
	 q_out <=  D;
   assign Q = q_out;
endmodule // FDC

module FDDRCPE (Q, C0, C1, CE, CLR, D0, D1, PRE);
   parameter INIT = 1'b0;
   output Q;
   input  C0, C1, CE, CLR, D0, D1, PRE;
   wire   Q;
   reg    q_out;
   reg    q0_out, q1_out;
   reg    C0_tmp, C1_tmp;
   initial begin
      q_out = INIT;
      q0_out = INIT;
      q1_out = INIT;
      C0_tmp = 0;
      C1_tmp = 0;
   end
   assign Q = q_out;
   always @(CLR or PRE)
     if (CLR) begin
        q_out  <= 0;
        q0_out <= 0;
        q1_out <= 0;
        C0_tmp <= 0;
        C1_tmp <= 0;
     end
     else if (PRE) begin
        q_out  <= 1;
        q0_out <= 1;
        q1_out <= 1;
        C0_tmp <= 0;
        C1_tmp <= 0;
     end
   always @(posedge C0) 
     if ( CE) begin
        C0_tmp <=  1;
        q0_out <=  D0;
     end
   always @(posedge C1)
     if ( CE ) begin
        C1_tmp <=  1;
        q1_out <=  D1;
     end
   always @(posedge C0_tmp or posedge C1_tmp )
     if (C1_tmp)
       q_out <=  q1_out;
     else 
       q_out <=  q0_out;
endmodule // FDDRCPE

module FDDRRSE (Q, C0, C1, CE, D0, D1, R, S);
   parameter INIT = 1'b0;
   output Q;
   input  C0, C1, CE, D0, D1, R, S;
   wire   Q;
   reg    q_out;
   reg    q0_out, q1_out;
   reg    C0_tmp, C1_tmp;
   initial begin
      q_out = INIT;
      q0_out = INIT;
      q1_out = INIT;
      C0_tmp = 0;
      C1_tmp = 0;
   end
   assign Q = q_out;
   always @(posedge C0) 
     if (CE == 1 || R == 1 || S == 1) begin
        C0_tmp <=  1;
        //      C0_tmp <= #100 0;
     end
   always @(posedge C1) 
     if (CE == 1 || R == 1 || S == 1) begin
        C1_tmp <=  1;
        //      C1_tmp <= #100 0;
     end
   always @(posedge C0) 
     if (R)
       q0_out <=  0;
     else if (S)
       q0_out <=  1;
     else if (CE)
       q0_out <= D0;
   always @(posedge C1)
     if (R)
       q1_out <=  0;
     else if (S)
       q1_out <=  1;
     else if (CE)
       q1_out <=  D1;
   always @(posedge C0_tmp or posedge C1_tmp )
     if (C1_tmp)
       q_out <=  q1_out;
     else 
       q_out <=  q0_out;
endmodule // FDDRRSE

module FDE_1 (Q, C, CE, D);
   parameter INIT = 1'b0;
   output Q;
   input  C, CE, D;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(negedge C )
     if (CE)
	   q_out <=  D;
endmodule // FDE_1

module FDE (Q, C, CE, D);
   parameter INIT = 1'b0;
   output Q;
   input  C, CE, D;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(posedge C)
	 if (CE)
	   q_out <=  D;
endmodule // FDE

module FDP_1 (Q, C, D, PRE);
   parameter INIT = 1'b1;
   output Q;
   input  C, D, PRE;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(PRE)
     if (PRE)
       q_out <= 1;
   always @(negedge C)
	 q_out <=  D;
endmodule // FDP_1

module FDPE_1 (Q, C, CE, D, PRE);
   parameter INIT = 1'b1;
   output Q;
   input  C, CE, D, PRE;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(PRE)
     if (PRE)
       q_out <= 1;
   always @(negedge C )
     if (CE)
	   q_out <=  D;
endmodule // FDPE_1

module FDPE (Q, C, CE, D, PRE);
   parameter INIT = 1'b1;
   output Q;
   input  C, CE, D, PRE;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(PRE)
     if (PRE)
       q_out <= 1;
   always @(posedge C )
     if (CE)
	   q_out <=  D;
endmodule // FDPE

module FDP (Q, C, D, PRE);
   parameter INIT = 1'b1;
   output Q;
   input  C, D, PRE;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(PRE)
     if (PRE) 
       q_out <= 1;
   always @(posedge C )
	 q_out <= D;
endmodule // FDP

module FDR_1 (Q, C, D, R);
   parameter INIT = 1'b0;
   output Q;
   input  C, D, R;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(negedge C )
     if (R)
	   q_out <=  0;
     else
	   q_out <=  D;
endmodule // FDR_1

module FDRE_1 (Q, C, CE, D, R);
   parameter INIT = 1'b0;
   output Q;
   input  C, CE, D, R;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(negedge C )
	 if (R)
	   q_out <=  0;
	 else if (CE)
	   q_out <=  D;
endmodule // FDRE_1

module FDRE (Q, C, CE, D, R);
   parameter INIT = 1'b0;
   output Q;
   input  C, CE, D, R;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(posedge C )
     if (R)
	   q_out <=  0;
     else if (CE)
	   q_out <=  D;
endmodule // FDRE

module FDRS_1 (Q, C, D, R, S);
   parameter INIT = 1'b0;
   output Q;
   input  C, D, R, S;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(negedge C)
	 if (R)
	   q_out <=  0;
	 else if (S)
	   q_out <=  1;
	 else
	   q_out <=  D;
endmodule // FDRS_1

module FDRSE_1 (Q, C, CE, D, R, S);
   parameter INIT = 1'b0;
   output Q;
   input  C, CE, D, R, S;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(negedge C )
     if (R)
	   q_out <=  0;
     else if (S)
	   q_out <=  1;
     else if (CE)
	   q_out <=  D;
endmodule // FDRSE_1

module FDRSE (Q, C, CE, D, R, S);
   parameter INIT = 1'b0;
   output Q;
   input  C, CE, D, R, S;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(posedge C )
     if (R)
	   q_out <=  0;
     else if (S)
	   q_out <=  1;
     else if (CE)
	   q_out <=  D;
endmodule // FDRSE

module FDRS (Q, C, D, R, S);
   parameter INIT = 1'b0;
   output Q;
   input  C, D, R, S;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(posedge C )
	 if (R)
	   q_out <=  0;
	 else if (S)
	   q_out <=  1;
	 else
	   q_out <=  D;
endmodule // FDRS

module FDR (Q, C, D, R);
   parameter INIT = 1'b0;
   output Q;
   input  C, D, R;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(posedge C )
     if (R)
	   q_out <=  0;
     else
	   q_out <=  D;
endmodule // FDR

module FDS_1 (Q, C, D, S);
   parameter INIT = 1'b1;
   output Q;
   input  C, D, S;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(negedge C )
     if (S)
	   q_out <=  1;
     else
	   q_out <=  D;
endmodule // FDS_1

module FDSE_1 (Q, C, CE, D, S);
   parameter INIT = 1'b1;
   output Q;
   input  C, CE, D, S;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(negedge C )
	 if (S)
	   q_out <=  1;
	 else if (CE)
	   q_out <=  D;
endmodule // FDSE_1

module FDSE (Q, C, CE, D, S);
   parameter INIT = 1'b1;
   output Q;
   input  C, CE, D, S;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(posedge C )
	 if (S)
	   q_out <=  1;
	 else if (CE)
	   q_out <=  D;
endmodule // FDSE

module FDS (Q, C, D, S);
   parameter INIT = 1'b1;
   output Q;
   input  C, D, S;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(posedge C )
     if (S)
	   q_out <=  1;
     else
	   q_out <=  D;
endmodule // FDS

module FD (Q, C, D);
   parameter INIT = 1'b0;
   output Q;
   input  C, D;
   wire   Q;
   reg    q_out;
   initial q_out = INIT;
   always @(posedge C)
	 q_out <=  D;
   assign Q = q_out;
endmodule // FD


module LD_1 (Q, D, G);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  D, G;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(D or G)
	 if (!G)
	   q_out <= D;
endmodule // LD_1

module LDC_1 (Q, CLR, D, G);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  CLR, D, G;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or D or G)
	 if (CLR)
	   q_out <= 0;
	 else if (!G)
	   q_out <= D;
endmodule // LDC_1

module LDCE_1 (Q, CLR, D, G, GE);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  CLR, D, G, GE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or D or G or GE)
	 if (CLR)
	   q_out <= 0;
	 else if (!G && GE)
	   q_out <= D;
endmodule // LDCE_1

module LDCE (Q, CLR, D, G, GE);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  CLR, D, G, GE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or D or G or GE)
	 if (CLR)
	   q_out <= 0;
	 else if (G && GE)
	   q_out <= D;
endmodule // LDCE

module LDCP_1 (Q, CLR, D, G, PRE);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  CLR, D, G, PRE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or PRE or D or G)
	 if (CLR)
	   q_out <= 0;
	 else if (PRE)
	   q_out <= 1;
	 else if (!G)
	   q_out <= D;
endmodule // LDCP_1

module LDCPE_1 (Q, CLR, D, G, GE, PRE);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  CLR, D, G, GE, PRE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or PRE or D or G or GE)
	 if (CLR)
	   q_out <= 0;
	 else if (PRE)
	   q_out <= 1;
	 else if (!G && GE)
	   q_out <= D;
endmodule // LDCPE_1

module LDCPE (Q, CLR, D, G, GE, PRE);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  CLR, D, G, GE, PRE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or PRE or D or G or GE)
	 if (CLR)
	   q_out <= 0;
	 else if (PRE)
	   q_out <= 1;
	 else if (G && GE)
	   q_out <= D;
endmodule // LDCPE

module LDCP (Q, CLR, D, G, PRE);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  CLR, D, G, PRE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or PRE or D or G)
	 if (CLR)
	   q_out <= 0;
	 else if (PRE)
	   q_out <= 1;
	 else if (G)
	   q_out <= D;
endmodule // LDCP

module LDC (Q, CLR, D, G);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  CLR, D, G;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(CLR or D or G)
	 if (CLR)
	   q_out <= 0;
	 else if (G)
	   q_out <= D;
endmodule // LDC

module LDE_1 (Q, D, G, GE);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  D, G, GE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(D or G or GE)
	 if (!G && GE)
	   q_out <= D;
endmodule // LDE_1

module LDE (Q, D, G, GE);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  D, G, GE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(D or G or GE)
	 if (G && GE)
	   q_out <= D;
endmodule // LDE

module LDP_1 (Q, D, G, PRE);
   parameter INIT = 1'b1;
   output Q;
   wire   Q;
   input  D, G, PRE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(PRE or D or G)
	 if (PRE)
	   q_out <= 1;
	 else if (!G)
	   q_out <= D;
endmodule // LDP_1

module LDPE_1 (Q, D, G, GE, PRE);
   parameter INIT = 1'b1;
   output Q;
   wire   Q;
   input  D, G, GE, PRE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(PRE or D or G or GE)
	 if (PRE)
	   q_out <= 1;
	 else if (!G && GE)
	   q_out <= D;
endmodule // LDPE_1

module LDPE (Q, D, G, GE, PRE);
   parameter INIT = 1'b1;
   output Q;
   wire   Q;
   input  D, G, GE, PRE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(PRE or D or G or GE)
	 if (PRE)
	   q_out <= 1;
	 else if (G && GE)
	   q_out <= D;
endmodule // LDPE

module LDP (Q, D, G, PRE);
   parameter INIT = 1'b1;
   output Q;
   wire   Q;
   input  D, G, PRE;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(PRE or D or G)
	 if (PRE)
	   q_out <= 1;
	 else if (G)
	   q_out <= D;
endmodule // LDP

module LD (Q, D, G);
   parameter INIT = 1'b0;
   output Q;
   wire   Q;
   input  D, G;
   reg    q_out;
   initial q_out = INIT;
   assign Q = q_out;
   always @(D or G)
	 if (G)
	   q_out <= D;
endmodule // LD


module BUFCF (O, I);
   output O;
   input  I;
   buf B1 (O, I);
endmodule // BUFCF

module BUFE (O, E, I);
   output O;
   input  E, I;
   bufif1 B1 (O, I, E);
endmodule // BUFE

module BUFGCE_1 (O, CE, I);
   output O;
   input  CE, I;
   wire   NCE;
   BUFGMUX_1 B1 (.I0(I),
	             .I1(1'b1),
	             .O(O),
	             .S(NCE));
   INV I1 (.I(CE),
	       .O(NCE));
endmodule // BUFGCE_1

module BUFGCE (O, CE, I);
   output O;
   input  CE, I;
   wire   NCE;
   BUFGMUX B1 (.I0(I),
	           .I1(1'b0),
	           .O(O),
	           .S(NCE));
   INV I1 (.I(CE),
	       .O(NCE));
endmodule // BUFGCE

module BUFGCTRL (O, CE0, CE1, I0, I1, IGNORE0, IGNORE1, S0, S1);
   output O;
   input  CE0;
   input  CE1;
   input  I0;
   input  I1;
   input  IGNORE0;
   input  IGNORE1;
   input  S0;
   input  S1;
   parameter integer INIT_OUT = 0;
   parameter PRESELECT_I0 = "FALSE";
   parameter PRESELECT_I1 = "FALSE";
   reg               O;
   reg               q0, q1;
   reg               q0_enable, q1_enable;
   reg               preselect_i0, preselect_i1;
   reg               task_input_ce0, task_input_ce1, task_input_i0;
   reg               task_input_i1, task_input_ignore0, task_input_ignore1;
   reg               task_input_s0, task_input_s1;
   wire              I0t, I1t;
   // *** parameter checking
   // *** Start here
   assign I0t = INIT_OUT ? ~I0 : I0;
   assign I1t = INIT_OUT ? ~I1 : I1;
   always @(q0 or q1 or I0t or I1t) begin 
	  case ({q1, q0})
        2'b01: O = I0;
        2'b10: O = I1; 
        2'b00: O = INIT_OUT;
	    2'b11: begin
		   q0 = 1'bx;
		   q1 = 1'bx;
		   q0_enable = 1'bx;
		   q1_enable = 1'bx;
		   O = 1'bx;
		end
      endcase
   end
endmodule // BUFGCTRL

module BUFG_LB (
                CLKOUT,
                CLKIN
                );
   output CLKOUT;
   input  CLKIN;
   buf B_CLKOUT (CLKOUT, CLKIN);
endmodule // BUFG_LB

module BUFGMUX_1 (O, I0, I1, S);
   parameter CLK_SEL_TYPE = "SYNC";
   output O;
   input  I0, I1, S;
   reg    q0, q1;
   reg    q0_enable, q1_enable;
   wire   q0_t, q1_t;
   reg    clk_sel_in;
   bufif1 B0 (O, I0, q0_t);
   bufif1 B1 (O, I1, q1_t);
   pullup P1 (O);
   initial
     clk_sel_in = (CLK_SEL_TYPE == "ASYNC") ? 1 : 0;
   assign q0_t = (clk_sel_in) ? ~S : q0;
   assign q1_t = (clk_sel_in) ? S : q1;
   always @(I0 or S or q0_enable)
 	 if (I0)
	   q0 <= !S && q0_enable;
   always @(I1 or S or q1_enable)
 	 if (I1)
	   q1 <= S && q1_enable;
   always @(q1 or I0)
	 if (q1)
	   q0_enable <= 0;
	 else if (!I0)
	   q0_enable <= !q1;
   always @(q0 or I1)
	 if (q0)
	   q1_enable <= 0;
	 else if (!I1)
	   q1_enable <= !q0;
endmodule // BUFGMUX_1

module BUFGMUX_CTRL (O, I0, I1, S);
   output O;
   input  I0;
   input  I1;
   input  S;
   BUFGCTRL bufgctrl_inst (.O(O), .CE0(1'b1), .CE1(1'b1), .I0(I0), .I1(I1), .IGNORE0(1'b0), .IGNORE1(1'b0), .S0(~S), .S1(S));
   defparam bufgctrl_inst.INIT_OUT = 1'b0;
   defparam bufgctrl_inst.PRESELECT_I0 = "TRUE";
   defparam bufgctrl_inst.PRESELECT_I1 = "FALSE";
endmodule // BUFGMUX_CTRL

module BUFGMUX (O, I0, I1, S);
   parameter CLK_SEL_TYPE = "SYNC";
   output O;
   input  I0, I1, S;
   reg    q0, q1;
   reg    q0_enable, q1_enable;
   wire   q0_t, q1_t;
   reg    clk_sel_in;
   bufif1 B0 (O, I0, q0_t);
   bufif1 B1 (O, I1, q1_t);
   pulldown P1 (O);
   initial
     clk_sel_in = (CLK_SEL_TYPE == "ASYNC") ? 1 : 0;
   assign q0_t = (clk_sel_in) ? ~S : q0;
   assign q1_t = (clk_sel_in) ? S : q1;
   always @(I0 or S or q0_enable)
 	 if (!I0)
	   q0 <= !S && q0_enable;
   always @(I1 or S or q1_enable)
 	 if (!I1)
	   q1 <= S && q1_enable;
   always @(q1 or I0)
	 if (q1)
	   q0_enable <= 0;
	 else if (I0)
	   q0_enable <= !q1;
   always @(q0 or I1)
	 if (q0)
	   q1_enable <= 0;
	 else if (I1)
	   q1_enable <= !q0;
endmodule // BUFGMUX

module BUFGMUX_VIRTEX4 (O, I0, I1, S);
   output O;
   input  I0;
   input  I1;
   input  S;
   BUFGCTRL bufgctrl_inst (.O(O), .CE0(1'b1), .CE1(1'b1), .I0(I0), .I1(I1), .IGNORE0(1'b0), .IGNORE1(1'b0), .S0(~S), .S1(S));
   defparam bufgctrl_inst.INIT_OUT = 1'b0;
   defparam bufgctrl_inst.PRESELECT_I0 = "TRUE";
   defparam bufgctrl_inst.PRESELECT_I1 = "FALSE";
endmodule // BUFGMUX_VIRTEX4

module BUFGP (O, I);
   output O;
   input  I;
   buf B1 (O, I);
endmodule // BUFGP

module BUFG (O, I);
   output O;
   input  I;
   buf B1 (O, I);
endmodule // BUFG

module BUFHCE (O, CE, I);
   parameter CE_TYPE = "SYNC";
   parameter integer INIT_OUT = 0;
   output            O;
   input             CE;
   input             I;
   wire              NCE, o_bufg_o, o_bufg1_o;
   reg               CE_TYPE_BINARY;
   reg               INIT_OUT_BINARY;
   BUFGMUX #(.CLK_SEL_TYPE(CE_TYPE)) 
   B1 (.I0(I),
       .I1(1'b0),
       .O(o_bufg_o),
       .S(NCE));
   INV I1 (.I(CE),
           .O(NCE));
   BUFGMUX_1 #(.CLK_SEL_TYPE(CE_TYPE)) 
   B2 (.I0(I),
       .I1(1'b1),
       .O(o_bufg1_o),
       .S(NCE));
   assign O = (INIT_OUT == 1) ? o_bufg1_o : o_bufg_o;
endmodule // BUFHCE

module BUFH (O, I);
   output O;
   input  I;
   buf B1 (O, I);
endmodule // BUFH

// BUFIO2_2CLK
module BUFIO2FB (O, I);
   parameter DIVIDE_BYPASS = "TRUE";      // TRUE, FALSE
   output O; 
   input  I; 
   reg    divclk_bypass_attr;
   // Other signals
   reg    attr_err_flag = 0;
   //----------------------------------------------------------------------
   //------------------------  Output Ports  ------------------------------
   //----------------------------------------------------------------------
   buf buf_o(O, I);
endmodule // BUFIO2FB

// BUFIO2FB
// BUFIO2
module BUFIODQS (O, DQSMASK, I);
   parameter DQSMASK_ENABLE = "FALSE";      // TRUE, FALSE
   output O; 
   input  DQSMASK; 
   input  I; 
   reg    delay_bypass_attr;
   reg    dqsmask_enable_attr;
   wire   o_out;
   // Other signals
   reg    attr_err_flag = 0;
   //----------------------------------------------------------------------
   //------------------------  Output Ports  ------------------------------
   //----------------------------------------------------------------------
   buf buf_o(O, o_out);
   reg    q1, q2;
   wire   clk, dglitch_en;
   assign clk = (dglitch_en == 1'b1) ? I : 1'b0;
   always @(DQSMASK or clk) begin
      if (DQSMASK == 1'b1) q1 = 0;
      else #(300) if (clk == 1) q1 = 1;
   end
   always @(DQSMASK or clk) begin
      if (DQSMASK == 1'b1) q2 = 0;
      else #(400) if (clk == 0) q2 = q1;
   end
   assign dglitch_en = (~q2 | DQSMASK);
   assign o_out = (DQSMASK_ENABLE == "TRUE") ?  clk : I;
endmodule // BUFIODQS

// BUFIODQS
module BUFIO (O, I);
   output O;
   input  I;
   buf B1 (O, I);
endmodule // BUFIO

module BUFMRCE (
                O,
                CE,
                I
                );
   parameter CE_TYPE = "SYNC";
   parameter integer INIT_OUT = 0;
   output            O;
   input             CE;
   input             I;
   wire              NCE, o_bufg_o, o_bufg1_o;
   reg               CE_TYPE_BINARY;
   reg               INIT_OUT_BINARY;
   wire              O_OUT;
   wire              CE_IN;
   wire              I_IN;
   wire              CE_INDELAY;
   wire              I_INDELAY;
   BUFGMUX #(.CLK_SEL_TYPE(CE_TYPE))
   B1 (.I0(I),
       .I1(1'b0),
       .O(o_bufg_o),
       .S(NCE));
   INV I1 (.I(CE),
           .O(NCE));
   BUFGMUX_1 #(.CLK_SEL_TYPE(CE_TYPE))
   B2 (.I0(I),
       .I1(1'b1),
       .O(o_bufg1_o),
       .S(NCE));
   assign O = (INIT_OUT == 1) ? o_bufg1_o : o_bufg_o;
endmodule // BUFMRCE

module BUFMR (
              O,
              I
              );
   output O;
   input  I;
   buf B1 (O, I);
endmodule // BUFMR

module BUFT (O, I, T);
   output O;
   input  I, T;
   bufif0 T1 (O, I, T);
endmodule // BUFT

module BUF (O, I);
   output O;
   input  I;
   buf B1 (O, I);
endmodule // BUF