forked from robinsonb5/VIC20_MiST
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpll_reconfig.v
1621 lines (1605 loc) · 69.7 KB
/
pll_reconfig.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
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
// megafunction wizard: %ALTPLL_RECONFIG%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altpll_reconfig
// ============================================================
// File Name: pll_reconfig.v
// Megafunction Name(s):
// altpll_reconfig
//
// Simulation Library Files(s):
// altera_mf;cycloneiii;lpm
// ============================================================
// ************************************************************
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
//
// 13.1.4 Build 182 03/12/2014 SJ Web Edition
// ************************************************************
//Copyright (C) 1991-2014 Altera Corporation
//Your use of Altera Corporation's design tools, logic functions
//and other software and tools, and its AMPP partner logic
//functions, and any output files from any of the foregoing
//(including device programming or simulation files), and any
//associated documentation or information are expressly subject
//to the terms and conditions of the Altera Program License
//Subscription Agreement, Altera MegaCore Function License
//Agreement, or other applicable license agreement, including,
//without limitation, that your use is for the sole purpose of
//programming logic devices manufactured by Altera and sold by
//Altera or its authorized distributors. Please refer to the
//applicable agreement for further details.
//altpll_reconfig CBX_AUTO_BLACKBOX="ALL" device_family="Cyclone III" busy clock counter_param counter_type data_in data_out pll_areset pll_areset_in pll_configupdate pll_scanclk pll_scanclkena pll_scandata pll_scandataout pll_scandone read_param reconfig reset reset_rom_address rom_address_out rom_data_in write_from_rom write_param write_rom_ena
//VERSION_BEGIN 13.1 cbx_altpll_reconfig 2014:03:12:19:24:28:SJ cbx_altsyncram 2014:03:12:19:24:28:SJ cbx_cycloneii 2014:03:12:19:24:28:SJ cbx_lpm_add_sub 2014:03:12:19:24:28:SJ cbx_lpm_compare 2014:03:12:19:24:28:SJ cbx_lpm_counter 2014:03:12:19:24:28:SJ cbx_lpm_decode 2014:03:12:19:24:28:SJ cbx_lpm_mux 2014:03:12:19:24:28:SJ cbx_mgl 2014:03:12:19:35:38:SJ cbx_stratix 2014:03:12:19:24:28:SJ cbx_stratixii 2014:03:12:19:24:28:SJ cbx_stratixiii 2014:03:12:19:24:28:SJ cbx_stratixv 2014:03:12:19:24:28:SJ cbx_util_mgl 2014:03:12:19:24:28:SJ VERSION_END
// synthesis VERILOG_INPUT_VERSION VERILOG_2001
// altera message_off 10463
//synthesis_resources = altsyncram 1 lpm_add_sub 2 lpm_compare 1 lpm_counter 8 lpm_decode 1 lut 3 reg 102
//synopsys translate_off
`timescale 1 ps / 1 ps
//synopsys translate_on
(* ALTERA_ATTRIBUTE = {"ADV_NETLIST_OPT_ALLOWED=\"NEVER_ALLOW\";suppress_da_rule_internal=C106;{-to le_comb10} PLL_SCAN_RECONFIG_COUNTER_REMAP_LCELL=2;{-to le_comb8} PLL_SCAN_RECONFIG_COUNTER_REMAP_LCELL=0;{-to le_comb9} PLL_SCAN_RECONFIG_COUNTER_REMAP_LCELL=1"} *)
module pll_reconfig_pllrcfg_fj11
(
busy,
clock,
counter_param,
counter_type,
data_in,
data_out,
pll_areset,
pll_areset_in,
pll_configupdate,
pll_scanclk,
pll_scanclkena,
pll_scandata,
pll_scandataout,
pll_scandone,
read_param,
reconfig,
reset,
reset_rom_address,
rom_address_out,
rom_data_in,
write_from_rom,
write_param,
write_rom_ena) /* synthesis synthesis_clearbox=2 */;
output busy;
input clock;
input [2:0] counter_param;
input [3:0] counter_type;
input [8:0] data_in;
output [8:0] data_out;
output pll_areset;
input pll_areset_in;
output pll_configupdate;
output pll_scanclk;
output pll_scanclkena;
output pll_scandata;
input pll_scandataout;
input pll_scandone;
input read_param;
input reconfig;
input reset;
input reset_rom_address;
output [7:0] rom_address_out;
input rom_data_in;
input write_from_rom;
input write_param;
output write_rom_ena;
`ifndef ALTERA_RESERVED_QIS
// synopsys translate_off
`endif
tri0 [2:0] counter_param;
tri0 [3:0] counter_type;
tri0 [8:0] data_in;
tri0 pll_areset_in;
tri0 pll_scandataout;
tri0 pll_scandone;
tri0 read_param;
tri0 reconfig;
tri0 reset_rom_address;
tri0 rom_data_in;
tri0 write_from_rom;
tri0 write_param;
`ifndef ALTERA_RESERVED_QIS
// synopsys translate_on
`endif
wire [0:0] wire_altsyncram4_q_a;
wire wire_le_comb10_combout;
wire wire_le_comb8_combout;
wire wire_le_comb9_combout;
reg [7:0] addr_from_rom;
reg [7:0] addr_from_rom2;
reg areset_init_state_1;
reg areset_state;
reg C0_data_state;
reg C0_ena_state;
reg C1_data_state;
reg C1_ena_state;
reg C2_data_state;
reg C2_ena_state;
reg C3_data_state;
reg C3_ena_state;
reg C4_data_state;
reg C4_ena_state;
reg configupdate2_state;
reg configupdate3_state;
reg configupdate_state;
reg [2:0] counter_param_latch_reg;
reg [3:0] counter_type_latch_reg;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg idle_state;
reg [0:0] nominal_data0;
reg [0:0] nominal_data1;
reg [0:0] nominal_data2;
reg [0:0] nominal_data3;
reg [0:0] nominal_data4;
reg [0:0] nominal_data5;
reg [0:0] nominal_data6;
reg [0:0] nominal_data7;
reg [0:0] nominal_data8;
reg [0:0] nominal_data9;
reg [0:0] nominal_data10;
reg [0:0] nominal_data11;
reg [0:0] nominal_data12;
reg [0:0] nominal_data13;
reg [0:0] nominal_data14;
reg [0:0] nominal_data15;
reg [0:0] nominal_data16;
reg [0:0] nominal_data17;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg read_data_nominal_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg read_data_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg read_first_nominal_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg read_first_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg read_init_nominal_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg read_init_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg read_last_nominal_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg read_last_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg reconfig_counter_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg reconfig_init_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg reconfig_post_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg reconfig_seq_data_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg reconfig_seq_ena_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg reconfig_wait_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=HIGH"} *)
reg reset_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg rom_data_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg rom_first_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg rom_init_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg rom_last_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg rom_second_last_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg rom_second_state;
reg [0:0] shift_reg0;
reg [0:0] shift_reg1;
reg [0:0] shift_reg2;
reg [0:0] shift_reg3;
reg [0:0] shift_reg4;
reg [0:0] shift_reg5;
reg [0:0] shift_reg6;
reg [0:0] shift_reg7;
reg [0:0] shift_reg8;
reg [0:0] shift_reg9;
reg [0:0] shift_reg10;
reg [0:0] shift_reg11;
reg [0:0] shift_reg12;
reg [0:0] shift_reg13;
reg [0:0] shift_reg14;
reg [0:0] shift_reg15;
reg [0:0] shift_reg16;
reg [0:0] shift_reg17;
wire [17:0] wire_shift_reg_ena;
reg tmp_nominal_data_out_state;
reg tmp_seq_ena_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg write_data_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg write_init_nominal_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg write_init_state;
(* ALTERA_ATTRIBUTE = {"POWER_UP_LEVEL=LOW"} *)
reg write_nominal_state;
wire [8:0] wire_add_sub5_result;
wire [7:0] wire_add_sub6_result;
wire wire_cmpr7_aeb;
wire [7:0] wire_cntr1_q;
wire [7:0] wire_cntr12_q;
wire [5:0] wire_cntr13_q;
wire [7:0] wire_cntr14_q;
wire [4:0] wire_cntr15_q;
wire [7:0] wire_cntr16_q;
wire [7:0] wire_cntr2_q;
wire [4:0] wire_cntr3_q;
wire [4:0] wire_decode11_eq;
wire addr_counter_enable;
wire [7:0] addr_counter_out;
wire addr_counter_sload;
wire [7:0] addr_counter_sload_value;
wire [7:0] addr_decoder_out;
wire [7:0] c0_wire;
wire [7:0] c1_wire;
wire [7:0] c2_wire;
wire [7:0] c3_wire;
wire [7:0] c4_wire;
wire [7:0] const_scan_chain_size;
wire [2:0] counter_param_latch;
wire [3:0] counter_type_latch;
wire [2:0] cuda_combout_wire;
wire dummy_scandataout;
wire [2:0] encode_out;
wire input_latch_enable;
wire power_up;
wire read_addr_counter_done;
wire read_addr_counter_enable;
wire [7:0] read_addr_counter_out;
wire read_addr_counter_sload;
wire [7:0] read_addr_counter_sload_value;
wire [7:0] read_addr_decoder_out;
wire read_nominal_out;
wire reconfig_addr_counter_enable;
wire [7:0] reconfig_addr_counter_out;
wire reconfig_addr_counter_sload;
wire [7:0] reconfig_addr_counter_sload_value;
wire reconfig_done;
wire reconfig_post_done;
wire reconfig_width_counter_done;
wire reconfig_width_counter_enable;
wire reconfig_width_counter_sload;
wire [5:0] reconfig_width_counter_sload_value;
wire rom_width_counter_done;
wire rom_width_counter_enable;
wire rom_width_counter_sload;
wire [7:0] rom_width_counter_sload_value;
wire rotate_addr_counter_enable;
wire [7:0] rotate_addr_counter_out;
wire rotate_addr_counter_sload;
wire [7:0] rotate_addr_counter_sload_value;
wire [4:0] rotate_decoder_wires;
wire rotate_width_counter_done;
wire rotate_width_counter_enable;
wire rotate_width_counter_sload;
wire [4:0] rotate_width_counter_sload_value;
wire [7:0] scan_cache_address;
wire scan_cache_in;
wire scan_cache_out;
wire scan_cache_write_enable;
wire sel_param_bypass_LF_unused;
wire sel_param_c;
wire sel_param_high_i_postscale;
wire sel_param_low_r;
wire sel_param_nominal_count;
wire sel_param_odd_CP_unused;
wire sel_type_c0;
wire sel_type_c1;
wire sel_type_c2;
wire sel_type_c3;
wire sel_type_c4;
wire sel_type_cplf;
wire sel_type_m;
wire sel_type_n;
wire sel_type_vco;
wire [7:0] seq_addr_wire;
wire [5:0] seq_sload_value;
wire shift_reg_clear;
wire shift_reg_load_enable;
wire shift_reg_load_nominal_enable;
wire shift_reg_serial_in;
wire shift_reg_serial_out;
wire shift_reg_shift_enable;
wire shift_reg_shift_nominal_enable;
wire [7:0] shift_reg_width_select;
wire w1565w;
wire w1592w;
wire w64w;
wire width_counter_done;
wire width_counter_enable;
wire width_counter_sload;
wire [4:0] width_counter_sload_value;
wire [4:0] width_decoder_out;
wire [7:0] width_decoder_select;
altsyncram altsyncram4
(
.address_a(scan_cache_address),
.clock0(clock),
.data_a({scan_cache_in}),
.eccstatus(),
.q_a(wire_altsyncram4_q_a),
.q_b(),
.wren_a(scan_cache_write_enable)
`ifndef FORMAL_VERIFICATION
// synopsys translate_off
`endif
,
.aclr0(1'b0),
.aclr1(1'b0),
.address_b({1{1'b1}}),
.addressstall_a(1'b0),
.addressstall_b(1'b0),
.byteena_a({1{1'b1}}),
.byteena_b({1{1'b1}}),
.clock1(1'b1),
.clocken0(1'b1),
.clocken1(1'b1),
.clocken2(1'b1),
.clocken3(1'b1),
.data_b({1{1'b1}}),
.rden_a(1'b1),
.rden_b(1'b1),
.wren_b(1'b0)
`ifndef FORMAL_VERIFICATION
// synopsys translate_on
`endif
);
defparam
altsyncram4.numwords_a = 144,
altsyncram4.operation_mode = "SINGLE_PORT",
altsyncram4.width_a = 1,
altsyncram4.width_byteena_a = 1,
altsyncram4.widthad_a = 8,
altsyncram4.intended_device_family = "Cyclone III",
altsyncram4.lpm_type = "altsyncram";
cycloneiii_lcell_comb le_comb10
(
.combout(wire_le_comb10_combout),
.cout(),
.dataa(encode_out[0]),
.datab(encode_out[1]),
.datac(encode_out[2]),
.cin(1'b0),
.datad(1'b0)
);
defparam
le_comb10.dont_touch = "on",
le_comb10.lut_mask = 16'hF0F0,
le_comb10.sum_lutc_input = "datac",
le_comb10.lpm_type = "cycloneiii_lcell_comb";
cycloneiii_lcell_comb le_comb8
(
.combout(wire_le_comb8_combout),
.cout(),
.dataa(encode_out[0]),
.datab(encode_out[1]),
.datac(encode_out[2]),
.cin(1'b0),
.datad(1'b0)
);
defparam
le_comb8.dont_touch = "on",
le_comb8.lut_mask = 16'hAAAA,
le_comb8.sum_lutc_input = "datac",
le_comb8.lpm_type = "cycloneiii_lcell_comb";
cycloneiii_lcell_comb le_comb9
(
.combout(wire_le_comb9_combout),
.cout(),
.dataa(encode_out[0]),
.datab(encode_out[1]),
.datac(encode_out[2]),
.cin(1'b0),
.datad(1'b0)
);
defparam
le_comb9.dont_touch = "on",
le_comb9.lut_mask = 16'hCCCC,
le_comb9.sum_lutc_input = "datac",
le_comb9.lpm_type = "cycloneiii_lcell_comb";
// synopsys translate_off
initial
addr_from_rom = 0;
// synopsys translate_on
always @ ( posedge clock)
addr_from_rom <= read_addr_counter_out;
// synopsys translate_off
initial
addr_from_rom2 = 0;
// synopsys translate_on
always @ ( posedge clock)
addr_from_rom2 <= addr_from_rom;
// synopsys translate_off
initial
areset_init_state_1 = 0;
// synopsys translate_on
always @ ( posedge clock)
areset_init_state_1 <= pll_scandone;
// synopsys translate_off
initial
areset_state = 0;
// synopsys translate_on
always @ ( posedge clock)
areset_state <= (areset_init_state_1 & (~ reset));
// synopsys translate_off
initial
C0_data_state = 0;
// synopsys translate_on
always @ ( posedge clock)
C0_data_state <= (C0_ena_state | (C0_data_state & (~ rotate_width_counter_done)));
// synopsys translate_off
initial
C0_ena_state = 0;
// synopsys translate_on
always @ ( posedge clock)
C0_ena_state <= (C1_data_state & rotate_width_counter_done);
// synopsys translate_off
initial
C1_data_state = 0;
// synopsys translate_on
always @ ( posedge clock)
C1_data_state <= (C1_ena_state | (C1_data_state & (~ rotate_width_counter_done)));
// synopsys translate_off
initial
C1_ena_state = 0;
// synopsys translate_on
always @ ( posedge clock)
C1_ena_state <= (C2_data_state & rotate_width_counter_done);
// synopsys translate_off
initial
C2_data_state = 0;
// synopsys translate_on
always @ ( posedge clock)
C2_data_state <= (C2_ena_state | (C2_data_state & (~ rotate_width_counter_done)));
// synopsys translate_off
initial
C2_ena_state = 0;
// synopsys translate_on
always @ ( posedge clock)
C2_ena_state <= (C3_data_state & rotate_width_counter_done);
// synopsys translate_off
initial
C3_data_state = 0;
// synopsys translate_on
always @ ( posedge clock)
C3_data_state <= (C3_ena_state | (C3_data_state & (~ rotate_width_counter_done)));
// synopsys translate_off
initial
C3_ena_state = 0;
// synopsys translate_on
always @ ( posedge clock)
C3_ena_state <= (C4_data_state & rotate_width_counter_done);
// synopsys translate_off
initial
C4_data_state = 0;
// synopsys translate_on
always @ ( posedge clock)
C4_data_state <= (C4_ena_state | (C4_data_state & (~ rotate_width_counter_done)));
// synopsys translate_off
initial
C4_ena_state = 0;
// synopsys translate_on
always @ ( posedge clock)
C4_ena_state <= reconfig_init_state;
// synopsys translate_off
initial
configupdate2_state = 0;
// synopsys translate_on
always @ ( posedge clock)
configupdate2_state <= configupdate_state;
// synopsys translate_off
initial
configupdate3_state = 0;
// synopsys translate_on
always @ ( negedge clock)
configupdate3_state <= configupdate2_state;
// synopsys translate_off
initial
configupdate_state = 0;
// synopsys translate_on
always @ ( posedge clock)
configupdate_state <= reconfig_post_state;
// synopsys translate_off
initial
counter_param_latch_reg = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) counter_param_latch_reg <= 3'b0;
else if (input_latch_enable == 1'b1) counter_param_latch_reg <= counter_param;
// synopsys translate_off
initial
counter_type_latch_reg = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) counter_type_latch_reg <= 4'b0;
else if (input_latch_enable == 1'b1) counter_type_latch_reg <= counter_type;
// synopsys translate_off
initial
idle_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) idle_state <= 1'b0;
else idle_state <= (((((((((((((idle_state & (~ read_param)) & (~ write_param)) & (~ reconfig)) & (~ write_from_rom)) | read_last_state) | (write_data_state & width_counter_done)) | (write_nominal_state & width_counter_done)) | read_last_nominal_state) | (reconfig_wait_state & reconfig_done)) | ((rom_data_state & rom_width_counter_done) & (~ reset_rom_address))) | (rom_second_last_state & (~ reset_rom_address))) | (rom_last_state & (~ reset_rom_address))) | reset_state);
// synopsys translate_off
initial
nominal_data0 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data0 <= 1'b0;
else nominal_data0 <= wire_add_sub6_result[0];
// synopsys translate_off
initial
nominal_data1 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data1 <= 1'b0;
else nominal_data1 <= wire_add_sub6_result[1];
// synopsys translate_off
initial
nominal_data2 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data2 <= 1'b0;
else nominal_data2 <= wire_add_sub6_result[2];
// synopsys translate_off
initial
nominal_data3 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data3 <= 1'b0;
else nominal_data3 <= wire_add_sub6_result[3];
// synopsys translate_off
initial
nominal_data4 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data4 <= 1'b0;
else nominal_data4 <= wire_add_sub6_result[4];
// synopsys translate_off
initial
nominal_data5 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data5 <= 1'b0;
else nominal_data5 <= wire_add_sub6_result[5];
// synopsys translate_off
initial
nominal_data6 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data6 <= 1'b0;
else nominal_data6 <= wire_add_sub6_result[6];
// synopsys translate_off
initial
nominal_data7 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data7 <= 1'b0;
else nominal_data7 <= wire_add_sub6_result[7];
// synopsys translate_off
initial
nominal_data8 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data8 <= 1'b0;
else nominal_data8 <= data_in[0];
// synopsys translate_off
initial
nominal_data9 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data9 <= 1'b0;
else nominal_data9 <= data_in[1];
// synopsys translate_off
initial
nominal_data10 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data10 <= 1'b0;
else nominal_data10 <= data_in[2];
// synopsys translate_off
initial
nominal_data11 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data11 <= 1'b0;
else nominal_data11 <= data_in[3];
// synopsys translate_off
initial
nominal_data12 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data12 <= 1'b0;
else nominal_data12 <= data_in[4];
// synopsys translate_off
initial
nominal_data13 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data13 <= 1'b0;
else nominal_data13 <= data_in[5];
// synopsys translate_off
initial
nominal_data14 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data14 <= 1'b0;
else nominal_data14 <= data_in[6];
// synopsys translate_off
initial
nominal_data15 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data15 <= 1'b0;
else nominal_data15 <= data_in[7];
// synopsys translate_off
initial
nominal_data16 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data16 <= 1'b0;
else nominal_data16 <= data_in[8];
// synopsys translate_off
initial
nominal_data17 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) nominal_data17 <= 1'b0;
else nominal_data17 <= wire_cmpr7_aeb;
// synopsys translate_off
initial
read_data_nominal_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) read_data_nominal_state <= 1'b0;
else read_data_nominal_state <= ((read_first_nominal_state & (~ width_counter_done)) | (read_data_nominal_state & (~ width_counter_done)));
// synopsys translate_off
initial
read_data_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) read_data_state <= 1'b0;
else read_data_state <= ((read_first_state & (~ width_counter_done)) | (read_data_state & (~ width_counter_done)));
// synopsys translate_off
initial
read_first_nominal_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) read_first_nominal_state <= 1'b0;
else read_first_nominal_state <= read_init_nominal_state;
// synopsys translate_off
initial
read_first_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) read_first_state <= 1'b0;
else read_first_state <= read_init_state;
// synopsys translate_off
initial
read_init_nominal_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) read_init_nominal_state <= 1'b0;
else read_init_nominal_state <= ((idle_state & read_param) & ((((((~ counter_type[3]) & (~ counter_type[2])) & (~ counter_type[1])) & counter_param[2]) & counter_param[1]) & counter_param[0]));
// synopsys translate_off
initial
read_init_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) read_init_state <= 1'b0;
else read_init_state <= ((idle_state & read_param) & (~ ((((((~ counter_type[3]) & (~ counter_type[2])) & (~ counter_type[1])) & counter_param[2]) & counter_param[1]) & counter_param[0])));
// synopsys translate_off
initial
read_last_nominal_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) read_last_nominal_state <= 1'b0;
else read_last_nominal_state <= ((read_first_nominal_state & width_counter_done) | (read_data_nominal_state & width_counter_done));
// synopsys translate_off
initial
read_last_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) read_last_state <= 1'b0;
else read_last_state <= ((read_first_state & width_counter_done) | (read_data_state & width_counter_done));
// synopsys translate_off
initial
reconfig_counter_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) reconfig_counter_state <= 1'b0;
else reconfig_counter_state <= ((((((((((reconfig_init_state | C0_data_state) | C1_data_state) | C2_data_state) | C3_data_state) | C4_data_state) | C0_ena_state) | C1_ena_state) | C2_ena_state) | C3_ena_state) | C4_ena_state);
// synopsys translate_off
initial
reconfig_init_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) reconfig_init_state <= 1'b0;
else reconfig_init_state <= (idle_state & reconfig);
// synopsys translate_off
initial
reconfig_post_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) reconfig_post_state <= 1'b0;
else reconfig_post_state <= ((reconfig_seq_data_state & reconfig_width_counter_done) | (reconfig_post_state & (~ reconfig_post_done)));
// synopsys translate_off
initial
reconfig_seq_data_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) reconfig_seq_data_state <= 1'b0;
else reconfig_seq_data_state <= (reconfig_seq_ena_state | (reconfig_seq_data_state & (~ reconfig_width_counter_done)));
// synopsys translate_off
initial
reconfig_seq_ena_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) reconfig_seq_ena_state <= 1'b0;
else reconfig_seq_ena_state <= tmp_seq_ena_state;
// synopsys translate_off
initial
reconfig_wait_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) reconfig_wait_state <= 1'b0;
else reconfig_wait_state <= ((reconfig_post_state & reconfig_post_done) | (reconfig_wait_state & (~ reconfig_done)));
// synopsys translate_off
initial
reset_state = {1{1'b1}};
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) reset_state <= {1{1'b1}};
else reset_state <= power_up;
// synopsys translate_off
initial
rom_data_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) rom_data_state <= 1'b0;
else rom_data_state <= (rom_second_state | ((rom_data_state & (~ read_addr_counter_done)) & (~ reset_rom_address)));
// synopsys translate_off
initial
rom_first_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) rom_first_state <= 1'b0;
else rom_first_state <= rom_init_state;
// synopsys translate_off
initial
rom_init_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) rom_init_state <= 1'b0;
else rom_init_state <= (((((idle_state & write_from_rom) | (rom_first_state & reset_rom_address)) | (rom_second_state & reset_rom_address)) | (rom_data_state & reset_rom_address)) | (rom_second_last_state & reset_rom_address));
// synopsys translate_off
initial
rom_last_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) rom_last_state <= 1'b0;
else rom_last_state <= (rom_second_last_state & (~ reset_rom_address));
// synopsys translate_off
initial
rom_second_last_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) rom_second_last_state <= 1'b0;
else rom_second_last_state <= ((rom_data_state & read_addr_counter_done) & (~ reset_rom_address));
// synopsys translate_off
initial
rom_second_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) rom_second_state <= 1'b0;
else rom_second_state <= (rom_first_state & (~ reset_rom_address));
// synopsys translate_off
initial
shift_reg0 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg0 <= 1'b0;
else if (wire_shift_reg_ena[0:0] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg0 <= 1'b0;
else shift_reg0 <= ((((shift_reg_load_nominal_enable & nominal_data17[0:0]) | (shift_reg_load_enable & w64w)) | (shift_reg_shift_enable & shift_reg_serial_in)) | (shift_reg_shift_nominal_enable & shift_reg_serial_in));
// synopsys translate_off
initial
shift_reg1 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg1 <= 1'b0;
else if (wire_shift_reg_ena[1:1] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg1 <= 1'b0;
else shift_reg1 <= ((((shift_reg_load_nominal_enable & nominal_data16[0:0]) | (shift_reg_load_enable & w64w)) | (shift_reg_shift_enable & shift_reg0[0:0])) | (shift_reg_shift_nominal_enable & shift_reg0[0:0]));
// synopsys translate_off
initial
shift_reg2 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg2 <= 1'b0;
else if (wire_shift_reg_ena[2:2] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg2 <= 1'b0;
else shift_reg2 <= ((((shift_reg_load_nominal_enable & nominal_data15[0:0]) | (shift_reg_load_enable & w64w)) | (shift_reg_shift_enable & shift_reg1[0:0])) | (shift_reg_shift_nominal_enable & shift_reg1[0:0]));
// synopsys translate_off
initial
shift_reg3 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg3 <= 1'b0;
else if (wire_shift_reg_ena[3:3] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg3 <= 1'b0;
else shift_reg3 <= ((((shift_reg_load_nominal_enable & nominal_data14[0:0]) | (shift_reg_load_enable & w64w)) | (shift_reg_shift_enable & shift_reg2[0:0])) | (shift_reg_shift_nominal_enable & shift_reg2[0:0]));
// synopsys translate_off
initial
shift_reg4 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg4 <= 1'b0;
else if (wire_shift_reg_ena[4:4] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg4 <= 1'b0;
else shift_reg4 <= ((((shift_reg_load_nominal_enable & nominal_data13[0:0]) | (shift_reg_load_enable & w64w)) | (shift_reg_shift_enable & shift_reg3[0:0])) | (shift_reg_shift_nominal_enable & shift_reg3[0:0]));
// synopsys translate_off
initial
shift_reg5 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg5 <= 1'b0;
else if (wire_shift_reg_ena[5:5] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg5 <= 1'b0;
else shift_reg5 <= ((((shift_reg_load_nominal_enable & nominal_data12[0:0]) | (shift_reg_load_enable & w64w)) | (shift_reg_shift_enable & shift_reg4[0:0])) | (shift_reg_shift_nominal_enable & shift_reg4[0:0]));
// synopsys translate_off
initial
shift_reg6 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg6 <= 1'b0;
else if (wire_shift_reg_ena[6:6] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg6 <= 1'b0;
else shift_reg6 <= ((((shift_reg_load_nominal_enable & nominal_data11[0:0]) | (shift_reg_load_enable & w64w)) | (shift_reg_shift_enable & shift_reg5[0:0])) | (shift_reg_shift_nominal_enable & shift_reg5[0:0]));
// synopsys translate_off
initial
shift_reg7 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg7 <= 1'b0;
else if (wire_shift_reg_ena[7:7] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg7 <= 1'b0;
else shift_reg7 <= ((((shift_reg_load_nominal_enable & nominal_data10[0:0]) | (shift_reg_load_enable & w64w)) | (shift_reg_shift_enable & shift_reg6[0:0])) | (shift_reg_shift_nominal_enable & shift_reg6[0:0]));
// synopsys translate_off
initial
shift_reg8 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg8 <= 1'b0;
else if (wire_shift_reg_ena[8:8] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg8 <= 1'b0;
else shift_reg8 <= ((((shift_reg_load_nominal_enable & nominal_data9[0:0]) | (shift_reg_load_enable & w64w)) | (shift_reg_shift_enable & shift_reg7[0:0])) | (shift_reg_shift_nominal_enable & shift_reg7[0:0]));
// synopsys translate_off
initial
shift_reg9 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg9 <= 1'b0;
else if (wire_shift_reg_ena[9:9] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg9 <= 1'b0;
else shift_reg9 <= ((((shift_reg_load_nominal_enable & nominal_data8[0:0]) | (shift_reg_load_enable & data_in[8])) | (shift_reg_shift_enable & shift_reg8[0:0])) | (shift_reg_shift_nominal_enable & shift_reg8[0:0]));
// synopsys translate_off
initial
shift_reg10 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg10 <= 1'b0;
else if (wire_shift_reg_ena[10:10] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg10 <= 1'b0;
else shift_reg10 <= ((((shift_reg_load_nominal_enable & nominal_data7[0:0]) | (shift_reg_load_enable & data_in[7])) | (shift_reg_shift_enable & shift_reg9[0:0])) | (shift_reg_shift_nominal_enable & shift_reg9[0:0]));
// synopsys translate_off
initial
shift_reg11 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg11 <= 1'b0;
else if (wire_shift_reg_ena[11:11] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg11 <= 1'b0;
else shift_reg11 <= ((((shift_reg_load_nominal_enable & nominal_data6[0:0]) | (shift_reg_load_enable & data_in[6])) | (shift_reg_shift_enable & shift_reg10[0:0])) | (shift_reg_shift_nominal_enable & shift_reg10[0:0]));
// synopsys translate_off
initial
shift_reg12 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg12 <= 1'b0;
else if (wire_shift_reg_ena[12:12] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg12 <= 1'b0;
else shift_reg12 <= ((((shift_reg_load_nominal_enable & nominal_data5[0:0]) | (shift_reg_load_enable & data_in[5])) | (shift_reg_shift_enable & shift_reg11[0:0])) | (shift_reg_shift_nominal_enable & shift_reg11[0:0]));
// synopsys translate_off
initial
shift_reg13 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg13 <= 1'b0;
else if (wire_shift_reg_ena[13:13] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg13 <= 1'b0;
else shift_reg13 <= ((((shift_reg_load_nominal_enable & nominal_data4[0:0]) | (shift_reg_load_enable & data_in[4])) | (shift_reg_shift_enable & shift_reg12[0:0])) | (shift_reg_shift_nominal_enable & shift_reg12[0:0]));
// synopsys translate_off
initial
shift_reg14 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg14 <= 1'b0;
else if (wire_shift_reg_ena[14:14] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg14 <= 1'b0;
else shift_reg14 <= ((((shift_reg_load_nominal_enable & nominal_data3[0:0]) | (shift_reg_load_enable & data_in[3])) | (shift_reg_shift_enable & shift_reg13[0:0])) | (shift_reg_shift_nominal_enable & shift_reg13[0:0]));
// synopsys translate_off
initial
shift_reg15 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg15 <= 1'b0;
else if (wire_shift_reg_ena[15:15] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg15 <= 1'b0;
else shift_reg15 <= ((((shift_reg_load_nominal_enable & nominal_data2[0:0]) | (shift_reg_load_enable & data_in[2])) | (shift_reg_shift_enable & shift_reg14[0:0])) | (shift_reg_shift_nominal_enable & shift_reg14[0:0]));
// synopsys translate_off
initial
shift_reg16 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg16 <= 1'b0;
else if (wire_shift_reg_ena[16:16] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg16 <= 1'b0;
else shift_reg16 <= ((((shift_reg_load_nominal_enable & nominal_data1[0:0]) | (shift_reg_load_enable & data_in[1])) | (shift_reg_shift_enable & shift_reg15[0:0])) | (shift_reg_shift_nominal_enable & shift_reg15[0:0]));
// synopsys translate_off
initial
shift_reg17 = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) shift_reg17 <= 1'b0;
else if (wire_shift_reg_ena[17:17] == 1'b1)
if (shift_reg_clear == 1'b1) shift_reg17 <= 1'b0;
else shift_reg17 <= ((((shift_reg_load_nominal_enable & nominal_data0[0:0]) | (shift_reg_load_enable & data_in[0])) | (shift_reg_shift_enable & shift_reg16[0:0])) | (shift_reg_shift_nominal_enable & shift_reg16[0:0]));
assign
wire_shift_reg_ena = {18{((((shift_reg_load_enable | shift_reg_shift_enable) | shift_reg_load_nominal_enable) | shift_reg_shift_nominal_enable) | shift_reg_clear)}};
// synopsys translate_off
initial
tmp_nominal_data_out_state = 0;
// synopsys translate_on
always @ ( posedge clock)
tmp_nominal_data_out_state <= ((read_last_nominal_state & (~ idle_state)) | (tmp_nominal_data_out_state & idle_state));
// synopsys translate_off
initial
tmp_seq_ena_state = 0;
// synopsys translate_on
always @ ( posedge clock)
tmp_seq_ena_state <= (reconfig_counter_state & (C0_data_state & rotate_width_counter_done));
// synopsys translate_off
initial
write_data_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) write_data_state <= 1'b0;
else write_data_state <= (write_init_state | (write_data_state & (~ width_counter_done)));
// synopsys translate_off
initial
write_init_nominal_state = 0;
// synopsys translate_on
always @ ( posedge clock or posedge reset)
if (reset == 1'b1) write_init_nominal_state <= 1'b0;
else write_init_nominal_state <= ((idle_state & write_param) & ((((((~ counter_type[3]) & (~ counter_type[2])) & (~ counter_type[1])) & counter_param[2]) & counter_param[1]) & counter_param[0]));
// synopsys translate_off
initial