forked from efabless/caravel_user_project
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDmaMem.v
3489 lines (3343 loc) · 137 KB
/
DmaMem.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
// Generator : SpinalHDL v1.4.3 git head : 4dd3b62906925bc269aee976e75f8918d4132efb
// Component : DmaMem
// Git hash : f48be781e668caa4d53186beb7dec459d98a9f2d
`define fsmR_enumDefinition_binary_sequential_type [2:0]
`define fsmR_enumDefinition_binary_sequential_fsmR_BOOT 3'b000
`define fsmR_enumDefinition_binary_sequential_fsmR_IDLE 3'b001
`define fsmR_enumDefinition_binary_sequential_fsmR_AR 3'b010
`define fsmR_enumDefinition_binary_sequential_fsmR_FR 3'b011
`define fsmR_enumDefinition_binary_sequential_fsmR_BR 3'b100
`define fsmR_enumDefinition_binary_sequential_fsmR_LAST 3'b101
`define fsmW_enumDefinition_binary_sequential_type [2:0]
`define fsmW_enumDefinition_binary_sequential_fsmW_BOOT 3'b000
`define fsmW_enumDefinition_binary_sequential_fsmW_IDLE 3'b001
`define fsmW_enumDefinition_binary_sequential_fsmW_W 3'b010
`define fsmW_enumDefinition_binary_sequential_fsmW_LAST 3'b011
`define fsmW_enumDefinition_binary_sequential_fsmW_B 3'b100
`define readFsm_enumDefinition_binary_sequential_type [1:0]
`define readFsm_enumDefinition_binary_sequential_readFsm_BOOT 2'b00
`define readFsm_enumDefinition_binary_sequential_readFsm_ACTIVE 2'b01
`define readFsm_enumDefinition_binary_sequential_readFsm_SEND_READ_CMD 2'b10
`define readFsm_enumDefinition_binary_sequential_readFsm_BURST_READ 2'b11
`define initFsm_enumDefinition_binary_sequential_type [2:0]
`define initFsm_enumDefinition_binary_sequential_initFsm_BOOT 3'b000
`define initFsm_enumDefinition_binary_sequential_initFsm_INIT_WAIT 3'b001
`define initFsm_enumDefinition_binary_sequential_initFsm_INIT_PRECHARGE 3'b010
`define initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_1 3'b011
`define initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_2 3'b100
`define initFsm_enumDefinition_binary_sequential_initFsm_INIT_LOAD_MODE_REG 3'b101
`define writeFsm_enumDefinition_binary_sequential_type [1:0]
`define writeFsm_enumDefinition_binary_sequential_writeFsm_BOOT 2'b00
`define writeFsm_enumDefinition_binary_sequential_writeFsm_ACTIVE_WRITE 2'b01
`define writeFsm_enumDefinition_binary_sequential_writeFsm_BURST_WRITE 2'b10
`define writeFsm_enumDefinition_binary_sequential_writeFsm_TERM_WRITE 2'b11
`define refreshFsm_enumDefinition_binary_sequential_type [1:0]
`define refreshFsm_enumDefinition_binary_sequential_refreshFsm_BOOT 2'b00
`define refreshFsm_enumDefinition_binary_sequential_refreshFsm_REFRESH_PRECHARGE 2'b01
`define refreshFsm_enumDefinition_binary_sequential_refreshFsm_REFRESH 2'b10
`define fsm_enumDefinition_binary_sequential_type [2:0]
`define fsm_enumDefinition_binary_sequential_fsm_BOOT 3'b000
`define fsm_enumDefinition_binary_sequential_fsm_INIT 3'b001
`define fsm_enumDefinition_binary_sequential_fsm_IDLE 3'b010
`define fsm_enumDefinition_binary_sequential_fsm_REFRESH 3'b011
`define fsm_enumDefinition_binary_sequential_fsm_WRITE 3'b100
`define fsm_enumDefinition_binary_sequential_fsm_READ 3'b101
`define fsm_enumDefinition_binary_sequential_fsm_PRECHARGE 3'b110
module DmaMem (
input io_ctrl_start,
output io_ctrl_busy,
output io_ctrl_done,
input io_ctrl_halt,
output [12:0] io_sdram_ADDR,
output [1:0] io_sdram_BA,
input [15:0] io_sdram_DQ_read,
output [15:0] io_sdram_DQ_write,
output [15:0] io_sdram_DQ_writeEnable,
output [1:0] io_sdram_DQM,
output io_sdram_CASn,
output io_sdram_CKE,
output io_sdram_CSn,
output io_sdram_RASn,
output io_sdram_WEn,
input io_wb_CYC,
input io_wb_STB,
output io_wb_ACK,
input io_wb_WE,
input [31:0] io_wb_ADR,
output [31:0] io_wb_DAT_MISO,
input [31:0] io_wb_DAT_MOSI,
input [3:0] io_wb_SEL,
input clk,
input reset
);
wire [31:0] _zz_1;
wire [31:0] _zz_2;
wire [7:0] _zz_3;
wire [7:0] _zz_4;
wire [7:0] _zz_5;
wire [7:0] _zz_6;
wire [31:0] _zz_7;
wire _zz_8;
wire _zz_9;
wire dmaArea_dma_io_axi_ar_valid;
wire [31:0] dmaArea_dma_io_axi_ar_payload_addr;
wire [3:0] dmaArea_dma_io_axi_ar_payload_id;
wire [7:0] dmaArea_dma_io_axi_ar_payload_len;
wire [2:0] dmaArea_dma_io_axi_ar_payload_size;
wire [1:0] dmaArea_dma_io_axi_ar_payload_burst;
wire dmaArea_dma_io_axi_aw_valid;
wire [31:0] dmaArea_dma_io_axi_aw_payload_addr;
wire [3:0] dmaArea_dma_io_axi_aw_payload_id;
wire [7:0] dmaArea_dma_io_axi_aw_payload_len;
wire [2:0] dmaArea_dma_io_axi_aw_payload_size;
wire [1:0] dmaArea_dma_io_axi_aw_payload_burst;
wire dmaArea_dma_io_axi_w_valid;
wire [31:0] dmaArea_dma_io_axi_w_payload_data;
wire [3:0] dmaArea_dma_io_axi_w_payload_strb;
wire dmaArea_dma_io_axi_w_payload_last;
wire dmaArea_dma_io_axi_r_ready;
wire dmaArea_dma_io_axi_b_ready;
wire dmaArea_dma_io_ctrl_busy;
wire dmaArea_dma_io_ctrl_done;
wire sdramArea_sdramController_io_axi_ar_ready;
wire sdramArea_sdramController_io_axi_aw_ready;
wire sdramArea_sdramController_io_axi_w_ready;
wire sdramArea_sdramController_io_axi_r_valid;
wire [31:0] sdramArea_sdramController_io_axi_r_payload_data;
wire [3:0] sdramArea_sdramController_io_axi_r_payload_id;
wire [1:0] sdramArea_sdramController_io_axi_r_payload_resp;
wire sdramArea_sdramController_io_axi_r_payload_last;
wire sdramArea_sdramController_io_axi_b_valid;
wire [3:0] sdramArea_sdramController_io_axi_b_payload_id;
wire [1:0] sdramArea_sdramController_io_axi_b_payload_resp;
wire [12:0] sdramArea_sdramController_io_sdram_ADDR;
wire [1:0] sdramArea_sdramController_io_sdram_BA;
wire sdramArea_sdramController_io_sdram_CASn;
wire sdramArea_sdramController_io_sdram_CKE;
wire sdramArea_sdramController_io_sdram_CSn;
wire [1:0] sdramArea_sdramController_io_sdram_DQM;
wire sdramArea_sdramController_io_sdram_RASn;
wire sdramArea_sdramController_io_sdram_WEn;
wire [15:0] sdramArea_sdramController_io_sdram_DQ_write;
wire [15:0] sdramArea_sdramController_io_sdram_DQ_writeEnable;
wire sdramArea_sdramController_io_initDone;
reg busif_readError;
reg [31:0] busif_readData;
wire busif_selMatch;
wire busif_askWrite;
wire busif_askRead;
wire busif_doWrite;
wire busif_doRead;
reg [31:0] srcAddr;
reg [31:0] dstAddr;
Dma dmaArea_dma (
.io_param_sar (_zz_1[31:0] ), //i
.io_param_dar (_zz_2[31:0] ), //i
.io_param_xsize (_zz_3[7:0] ), //i
.io_param_ysize (_zz_4[7:0] ), //i
.io_param_srcystep (_zz_5[7:0] ), //i
.io_param_dstystep (_zz_6[7:0] ), //i
.io_param_llr (_zz_7[31:0] ), //i
.io_param_bf (_zz_8 ), //i
.io_param_cf (_zz_9 ), //i
.io_axi_aw_valid (dmaArea_dma_io_axi_aw_valid ), //o
.io_axi_aw_ready (sdramArea_sdramController_io_axi_aw_ready ), //i
.io_axi_aw_payload_addr (dmaArea_dma_io_axi_aw_payload_addr[31:0] ), //o
.io_axi_aw_payload_id (dmaArea_dma_io_axi_aw_payload_id[3:0] ), //o
.io_axi_aw_payload_len (dmaArea_dma_io_axi_aw_payload_len[7:0] ), //o
.io_axi_aw_payload_size (dmaArea_dma_io_axi_aw_payload_size[2:0] ), //o
.io_axi_aw_payload_burst (dmaArea_dma_io_axi_aw_payload_burst[1:0] ), //o
.io_axi_w_valid (dmaArea_dma_io_axi_w_valid ), //o
.io_axi_w_ready (sdramArea_sdramController_io_axi_w_ready ), //i
.io_axi_w_payload_data (dmaArea_dma_io_axi_w_payload_data[31:0] ), //o
.io_axi_w_payload_strb (dmaArea_dma_io_axi_w_payload_strb[3:0] ), //o
.io_axi_w_payload_last (dmaArea_dma_io_axi_w_payload_last ), //o
.io_axi_b_valid (sdramArea_sdramController_io_axi_b_valid ), //i
.io_axi_b_ready (dmaArea_dma_io_axi_b_ready ), //o
.io_axi_b_payload_id (sdramArea_sdramController_io_axi_b_payload_id[3:0] ), //i
.io_axi_b_payload_resp (sdramArea_sdramController_io_axi_b_payload_resp[1:0] ), //i
.io_axi_ar_valid (dmaArea_dma_io_axi_ar_valid ), //o
.io_axi_ar_ready (sdramArea_sdramController_io_axi_ar_ready ), //i
.io_axi_ar_payload_addr (dmaArea_dma_io_axi_ar_payload_addr[31:0] ), //o
.io_axi_ar_payload_id (dmaArea_dma_io_axi_ar_payload_id[3:0] ), //o
.io_axi_ar_payload_len (dmaArea_dma_io_axi_ar_payload_len[7:0] ), //o
.io_axi_ar_payload_size (dmaArea_dma_io_axi_ar_payload_size[2:0] ), //o
.io_axi_ar_payload_burst (dmaArea_dma_io_axi_ar_payload_burst[1:0] ), //o
.io_axi_r_valid (sdramArea_sdramController_io_axi_r_valid ), //i
.io_axi_r_ready (dmaArea_dma_io_axi_r_ready ), //o
.io_axi_r_payload_data (sdramArea_sdramController_io_axi_r_payload_data[31:0] ), //i
.io_axi_r_payload_id (sdramArea_sdramController_io_axi_r_payload_id[3:0] ), //i
.io_axi_r_payload_resp (sdramArea_sdramController_io_axi_r_payload_resp[1:0] ), //i
.io_axi_r_payload_last (sdramArea_sdramController_io_axi_r_payload_last ), //i
.io_ctrl_start (io_ctrl_start ), //i
.io_ctrl_busy (dmaArea_dma_io_ctrl_busy ), //o
.io_ctrl_done (dmaArea_dma_io_ctrl_done ), //o
.io_ctrl_halt (io_ctrl_halt ), //i
.clk (clk ), //i
.reset (reset ) //i
);
SdramController sdramArea_sdramController (
.io_axi_aw_valid (dmaArea_dma_io_axi_aw_valid ), //i
.io_axi_aw_ready (sdramArea_sdramController_io_axi_aw_ready ), //o
.io_axi_aw_payload_addr (dmaArea_dma_io_axi_aw_payload_addr[31:0] ), //i
.io_axi_aw_payload_id (dmaArea_dma_io_axi_aw_payload_id[3:0] ), //i
.io_axi_aw_payload_len (dmaArea_dma_io_axi_aw_payload_len[7:0] ), //i
.io_axi_aw_payload_size (dmaArea_dma_io_axi_aw_payload_size[2:0] ), //i
.io_axi_aw_payload_burst (dmaArea_dma_io_axi_aw_payload_burst[1:0] ), //i
.io_axi_w_valid (dmaArea_dma_io_axi_w_valid ), //i
.io_axi_w_ready (sdramArea_sdramController_io_axi_w_ready ), //o
.io_axi_w_payload_data (dmaArea_dma_io_axi_w_payload_data[31:0] ), //i
.io_axi_w_payload_strb (dmaArea_dma_io_axi_w_payload_strb[3:0] ), //i
.io_axi_w_payload_last (dmaArea_dma_io_axi_w_payload_last ), //i
.io_axi_b_valid (sdramArea_sdramController_io_axi_b_valid ), //o
.io_axi_b_ready (dmaArea_dma_io_axi_b_ready ), //i
.io_axi_b_payload_id (sdramArea_sdramController_io_axi_b_payload_id[3:0] ), //o
.io_axi_b_payload_resp (sdramArea_sdramController_io_axi_b_payload_resp[1:0] ), //o
.io_axi_ar_valid (dmaArea_dma_io_axi_ar_valid ), //i
.io_axi_ar_ready (sdramArea_sdramController_io_axi_ar_ready ), //o
.io_axi_ar_payload_addr (dmaArea_dma_io_axi_ar_payload_addr[31:0] ), //i
.io_axi_ar_payload_id (dmaArea_dma_io_axi_ar_payload_id[3:0] ), //i
.io_axi_ar_payload_len (dmaArea_dma_io_axi_ar_payload_len[7:0] ), //i
.io_axi_ar_payload_size (dmaArea_dma_io_axi_ar_payload_size[2:0] ), //i
.io_axi_ar_payload_burst (dmaArea_dma_io_axi_ar_payload_burst[1:0] ), //i
.io_axi_r_valid (sdramArea_sdramController_io_axi_r_valid ), //o
.io_axi_r_ready (dmaArea_dma_io_axi_r_ready ), //i
.io_axi_r_payload_data (sdramArea_sdramController_io_axi_r_payload_data[31:0] ), //o
.io_axi_r_payload_id (sdramArea_sdramController_io_axi_r_payload_id[3:0] ), //o
.io_axi_r_payload_resp (sdramArea_sdramController_io_axi_r_payload_resp[1:0] ), //o
.io_axi_r_payload_last (sdramArea_sdramController_io_axi_r_payload_last ), //o
.io_sdram_ADDR (sdramArea_sdramController_io_sdram_ADDR[12:0] ), //o
.io_sdram_BA (sdramArea_sdramController_io_sdram_BA[1:0] ), //o
.io_sdram_DQ_read (io_sdram_DQ_read[15:0] ), //i
.io_sdram_DQ_write (sdramArea_sdramController_io_sdram_DQ_write[15:0] ), //o
.io_sdram_DQ_writeEnable (sdramArea_sdramController_io_sdram_DQ_writeEnable[15:0] ), //o
.io_sdram_DQM (sdramArea_sdramController_io_sdram_DQM[1:0] ), //o
.io_sdram_CASn (sdramArea_sdramController_io_sdram_CASn ), //o
.io_sdram_CKE (sdramArea_sdramController_io_sdram_CKE ), //o
.io_sdram_CSn (sdramArea_sdramController_io_sdram_CSn ), //o
.io_sdram_RASn (sdramArea_sdramController_io_sdram_RASn ), //o
.io_sdram_WEn (sdramArea_sdramController_io_sdram_WEn ), //o
.io_initDone (sdramArea_sdramController_io_initDone ), //o
.clk (clk ), //i
.reset (reset ) //i
);
assign io_wb_ACK = 1'b1;
assign io_wb_DAT_MISO = busif_readData;
assign busif_selMatch = io_wb_SEL[0];
assign busif_askWrite = (((busif_selMatch && io_wb_CYC) && io_wb_STB) && io_wb_WE);
assign busif_askRead = (((busif_selMatch && io_wb_CYC) && io_wb_STB) && (! io_wb_WE));
assign busif_doWrite = ((((busif_selMatch && io_wb_CYC) && io_wb_STB) && io_wb_ACK) && io_wb_WE);
assign busif_doRead = ((((busif_selMatch && io_wb_CYC) && io_wb_STB) && io_wb_ACK) && (! io_wb_WE));
assign io_ctrl_busy = dmaArea_dma_io_ctrl_busy;
assign io_ctrl_done = dmaArea_dma_io_ctrl_done;
assign _zz_1 = srcAddr;
assign _zz_2 = dstAddr;
assign _zz_3 = 8'h08;
assign _zz_4 = 8'h01;
assign _zz_5 = 8'h0;
assign _zz_6 = 8'h0;
assign _zz_7 = 32'h0;
assign _zz_8 = 1'b1;
assign _zz_9 = 1'b1;
assign io_sdram_ADDR = sdramArea_sdramController_io_sdram_ADDR;
assign io_sdram_BA = sdramArea_sdramController_io_sdram_BA;
assign io_sdram_DQ_write = sdramArea_sdramController_io_sdram_DQ_write;
assign io_sdram_DQ_writeEnable = sdramArea_sdramController_io_sdram_DQ_writeEnable;
assign io_sdram_DQM = sdramArea_sdramController_io_sdram_DQM;
assign io_sdram_CASn = sdramArea_sdramController_io_sdram_CASn;
assign io_sdram_CKE = sdramArea_sdramController_io_sdram_CKE;
assign io_sdram_CSn = sdramArea_sdramController_io_sdram_CSn;
assign io_sdram_RASn = sdramArea_sdramController_io_sdram_RASn;
assign io_sdram_WEn = sdramArea_sdramController_io_sdram_WEn;
always @ (posedge clk or posedge reset) begin
if (reset) begin
busif_readError <= 1'b0;
busif_readData <= 32'h0;
srcAddr <= 32'h0;
dstAddr <= 32'h0;
end else begin
if(((io_wb_ADR == 32'h0) && busif_doWrite))begin
srcAddr <= io_wb_DAT_MISO[31 : 0];
end
if(((io_wb_ADR == 32'h00000004) && busif_doWrite))begin
dstAddr <= io_wb_DAT_MISO[31 : 0];
end
if(busif_doRead)begin
case(io_wb_ADR)
32'h0 : begin
busif_readData <= srcAddr;
busif_readError <= 1'b0;
end
32'h00000004 : begin
busif_readData <= dstAddr;
busif_readError <= 1'b0;
end
default : begin
busif_readData <= 32'h0;
busif_readError <= 1'b1;
end
endcase
end
end
end
endmodule
module SdramController (
(* IOB = "TRUE" *) input io_axi_aw_valid,
(* IOB = "TRUE" *) output io_axi_aw_ready,
(* IOB = "TRUE" *) input [31:0] io_axi_aw_payload_addr,
(* IOB = "TRUE" *) input [3:0] io_axi_aw_payload_id,
(* IOB = "TRUE" *) input [7:0] io_axi_aw_payload_len,
(* IOB = "TRUE" *) input [2:0] io_axi_aw_payload_size,
(* IOB = "TRUE" *) input [1:0] io_axi_aw_payload_burst,
(* IOB = "TRUE" *) input io_axi_w_valid,
(* IOB = "TRUE" *) output io_axi_w_ready,
(* IOB = "TRUE" *) input [31:0] io_axi_w_payload_data,
(* IOB = "TRUE" *) input [3:0] io_axi_w_payload_strb,
(* IOB = "TRUE" *) input io_axi_w_payload_last,
(* IOB = "TRUE" *) output io_axi_b_valid,
(* IOB = "TRUE" *) input io_axi_b_ready,
(* IOB = "TRUE" *) output [3:0] io_axi_b_payload_id,
(* IOB = "TRUE" *) output [1:0] io_axi_b_payload_resp,
(* IOB = "TRUE" *) input io_axi_ar_valid,
(* IOB = "TRUE" *) output io_axi_ar_ready,
(* IOB = "TRUE" *) input [31:0] io_axi_ar_payload_addr,
(* IOB = "TRUE" *) input [3:0] io_axi_ar_payload_id,
(* IOB = "TRUE" *) input [7:0] io_axi_ar_payload_len,
(* IOB = "TRUE" *) input [2:0] io_axi_ar_payload_size,
(* IOB = "TRUE" *) input [1:0] io_axi_ar_payload_burst,
(* IOB = "TRUE" *) output io_axi_r_valid,
(* IOB = "TRUE" *) input io_axi_r_ready,
(* IOB = "TRUE" *) output [31:0] io_axi_r_payload_data,
(* IOB = "TRUE" *) output [3:0] io_axi_r_payload_id,
(* IOB = "TRUE" *) output [1:0] io_axi_r_payload_resp,
(* IOB = "TRUE" *) output io_axi_r_payload_last,
(* IOB = "TRUE" *) output [12:0] io_sdram_ADDR,
(* IOB = "TRUE" *) output [1:0] io_sdram_BA,
(* IOB = "TRUE" *) input [15:0] io_sdram_DQ_read,
(* IOB = "TRUE" *) output [15:0] io_sdram_DQ_write,
(* IOB = "TRUE" *) output reg [15:0] io_sdram_DQ_writeEnable,
(* IOB = "TRUE" *) output [1:0] io_sdram_DQM,
(* IOB = "TRUE" *) output io_sdram_CASn,
(* IOB = "TRUE" *) output io_sdram_CKE,
(* IOB = "TRUE" *) output io_sdram_CSn,
(* IOB = "TRUE" *) output io_sdram_RASn,
(* IOB = "TRUE" *) output io_sdram_WEn,
(* IOB = "TRUE" *) output reg io_initDone,
input clk,
input reset
);
reg _zz_9;
wire _zz_10;
reg _zz_11;
wire _zz_12;
reg _zz_13;
wire [1:0] _zz_14;
wire _zz_15;
reg _zz_16;
wire _zz_17;
wire [1:0] _zz_18;
wire _zz_19;
wire awFifo_io_push_ready;
wire awFifo_io_pop_valid;
wire [31:0] awFifo_io_pop_payload_addr;
wire [3:0] awFifo_io_pop_payload_id;
wire [7:0] awFifo_io_pop_payload_len;
wire [2:0] awFifo_io_pop_payload_size;
wire [1:0] awFifo_io_pop_payload_burst;
wire [6:0] awFifo_io_occupancy;
wire [6:0] awFifo_io_availability;
wire wFifo_io_push_ready;
wire wFifo_io_pop_valid;
wire [31:0] wFifo_io_pop_payload_data;
wire [3:0] wFifo_io_pop_payload_strb;
wire wFifo_io_pop_payload_last;
wire [6:0] wFifo_io_occupancy;
wire [6:0] wFifo_io_availability;
wire bFifo_io_push_ready;
wire bFifo_io_pop_valid;
wire [3:0] bFifo_io_pop_payload_id;
wire [1:0] bFifo_io_pop_payload_resp;
wire [6:0] bFifo_io_occupancy;
wire [6:0] bFifo_io_availability;
wire arFifo_io_push_ready;
wire arFifo_io_pop_valid;
wire [31:0] arFifo_io_pop_payload_addr;
wire [3:0] arFifo_io_pop_payload_id;
wire [7:0] arFifo_io_pop_payload_len;
wire [2:0] arFifo_io_pop_payload_size;
wire [1:0] arFifo_io_pop_payload_burst;
wire [6:0] arFifo_io_occupancy;
wire [6:0] arFifo_io_availability;
wire rFifo_io_push_ready;
wire rFifo_io_pop_valid;
wire [31:0] rFifo_io_pop_payload_data;
wire [3:0] rFifo_io_pop_payload_id;
wire [1:0] rFifo_io_pop_payload_resp;
wire rFifo_io_pop_payload_last;
wire [6:0] rFifo_io_occupancy;
wire [6:0] rFifo_io_availability;
wire _zz_20;
wire _zz_21;
wire _zz_22;
wire _zz_23;
wire _zz_24;
wire _zz_25;
wire _zz_26;
wire _zz_27;
wire _zz_28;
wire [0:0] _zz_29;
wire [9:0] _zz_30;
wire [7:0] _zz_31;
wire [7:0] _zz_32;
wire [8:0] _zz_33;
wire [7:0] _zz_34;
wire [1:0] _zz_35;
wire [15:0] _zz_36;
wire [8:0] _zz_37;
wire [7:0] _zz_38;
wire [3:0] CMD_UNSELECTED;
wire [3:0] CMD_NOP;
wire [3:0] CMD_ACTIVE;
wire [3:0] CMD_READ;
wire [3:0] CMD_WRITE;
wire [3:0] CMD_BURST_TERMINATE;
wire [3:0] CMD_PRECHARGE;
wire [3:0] CMD_REFRESH;
wire [3:0] CMD_LOAD_MODE_REG;
wire [1:0] DQM_ALL_VALID;
wire [1:0] DQM_ALL_INVALID;
wire [12:0] MODE_VALUE;
reg [3:0] commandReg;
reg [12:0] addressReg;
reg [1:0] bankAddrReg;
reg [7:0] burstLenReg;
reg [8:0] columnAddrReg;
reg [31:0] busReadDataReg;
reg busReadDataVldReg;
reg busReadDataLastReg;
reg [3:0] opIdReg;
reg [3:0] strobeReg;
reg [31:0] busWriteDataReg;
reg [1:0] busDataShiftCnt;
wire [1:0] writeMask;
wire [15:0] busWrite;
reg [1:0] mask;
reg [13:0] initCounter_counter;
wire initCounter_busy;
reg [2:0] stateCounter_counter;
wire stateCounter_busy;
wire refreshCounter_willIncrement;
wire refreshCounter_willClear;
reg [9:0] refreshCounter_valueNext;
reg [9:0] refreshCounter_value;
wire refreshCounter_willOverflowIfInc;
wire refreshCounter_willOverflow;
wire initPeriod;
reg refreshReqReg;
reg preReqIsWriteReg;
wire readReq;
wire writeReq;
reg initFsm_wantExit;
reg initFsm_wantStart;
reg refreshFsm_wantExit;
reg refreshFsm_wantStart;
reg writeFsm_wantExit;
reg writeFsm_wantStart;
reg readFsm_wantExit;
reg readFsm_wantStart;
wire fsm_wantExit;
reg fsm_wantStart;
reg [15:0] readArea_readReg;
reg startBurstReadReg;
reg `readFsm_enumDefinition_binary_sequential_type readFsm_stateReg;
reg `readFsm_enumDefinition_binary_sequential_type readFsm_stateNext;
wire _zz_1;
wire _zz_2;
reg `initFsm_enumDefinition_binary_sequential_type initFsm_stateReg;
reg `initFsm_enumDefinition_binary_sequential_type initFsm_stateNext;
reg `writeFsm_enumDefinition_binary_sequential_type writeFsm_stateReg;
reg `writeFsm_enumDefinition_binary_sequential_type writeFsm_stateNext;
wire _zz_3;
wire _zz_4;
reg `refreshFsm_enumDefinition_binary_sequential_type refreshFsm_stateReg;
reg `refreshFsm_enumDefinition_binary_sequential_type refreshFsm_stateNext;
wire _zz_5;
wire _zz_6;
reg `fsm_enumDefinition_binary_sequential_type fsm_stateReg;
reg `fsm_enumDefinition_binary_sequential_type fsm_stateNext;
wire _zz_7;
wire _zz_8;
`ifndef SYNTHESIS
reg [167:0] readFsm_stateReg_string;
reg [167:0] readFsm_stateNext_string;
reg [207:0] initFsm_stateReg_string;
reg [207:0] initFsm_stateNext_string;
reg [167:0] writeFsm_stateReg_string;
reg [167:0] writeFsm_stateNext_string;
reg [223:0] refreshFsm_stateReg_string;
reg [223:0] refreshFsm_stateNext_string;
reg [103:0] fsm_stateReg_string;
reg [103:0] fsm_stateNext_string;
`endif
assign _zz_20 = ((! (writeFsm_stateReg == `writeFsm_enumDefinition_binary_sequential_writeFsm_ACTIVE_WRITE)) && (writeFsm_stateNext == `writeFsm_enumDefinition_binary_sequential_writeFsm_ACTIVE_WRITE));
assign _zz_21 = (2'b00 < busDataShiftCnt);
assign _zz_22 = ((! (writeFsm_stateReg == `writeFsm_enumDefinition_binary_sequential_writeFsm_BURST_WRITE)) && (writeFsm_stateNext == `writeFsm_enumDefinition_binary_sequential_writeFsm_BURST_WRITE));
assign _zz_23 = (_zz_3 && (! _zz_4));
assign _zz_24 = ((! (readFsm_stateReg == `readFsm_enumDefinition_binary_sequential_readFsm_ACTIVE)) && (readFsm_stateNext == `readFsm_enumDefinition_binary_sequential_readFsm_ACTIVE));
assign _zz_25 = (! stateCounter_busy);
assign _zz_26 = (! stateCounter_busy);
assign _zz_27 = (stateCounter_counter == 3'b011);
assign _zz_28 = (! stateCounter_busy);
assign _zz_29 = refreshCounter_willIncrement;
assign _zz_30 = {9'd0, _zz_29};
assign _zz_31 = {1'd0, rFifo_io_availability};
assign _zz_32 = {1'd0, wFifo_io_occupancy};
assign _zz_33 = ({1'd0,arFifo_io_pop_payload_len} <<< 1);
assign _zz_34 = (burstLenReg - 8'h01);
assign _zz_35 = (strobeReg >>> 2);
assign _zz_36 = (busWriteDataReg >>> 16);
assign _zz_37 = ({1'd0,awFifo_io_pop_payload_len} <<< 1);
assign _zz_38 = (burstLenReg - 8'h01);
StreamFifo_1 awFifo (
.io_push_valid (io_axi_aw_valid ), //i
.io_push_ready (awFifo_io_push_ready ), //o
.io_push_payload_addr (io_axi_aw_payload_addr[31:0] ), //i
.io_push_payload_id (io_axi_aw_payload_id[3:0] ), //i
.io_push_payload_len (io_axi_aw_payload_len[7:0] ), //i
.io_push_payload_size (io_axi_aw_payload_size[2:0] ), //i
.io_push_payload_burst (io_axi_aw_payload_burst[1:0] ), //i
.io_pop_valid (awFifo_io_pop_valid ), //o
.io_pop_ready (_zz_9 ), //i
.io_pop_payload_addr (awFifo_io_pop_payload_addr[31:0] ), //o
.io_pop_payload_id (awFifo_io_pop_payload_id[3:0] ), //o
.io_pop_payload_len (awFifo_io_pop_payload_len[7:0] ), //o
.io_pop_payload_size (awFifo_io_pop_payload_size[2:0] ), //o
.io_pop_payload_burst (awFifo_io_pop_payload_burst[1:0] ), //o
.io_flush (_zz_10 ), //i
.io_occupancy (awFifo_io_occupancy[6:0] ), //o
.io_availability (awFifo_io_availability[6:0] ), //o
.clk (clk ), //i
.reset (reset ) //i
);
StreamFifo_2 wFifo (
.io_push_valid (io_axi_w_valid ), //i
.io_push_ready (wFifo_io_push_ready ), //o
.io_push_payload_data (io_axi_w_payload_data[31:0] ), //i
.io_push_payload_strb (io_axi_w_payload_strb[3:0] ), //i
.io_push_payload_last (io_axi_w_payload_last ), //i
.io_pop_valid (wFifo_io_pop_valid ), //o
.io_pop_ready (_zz_11 ), //i
.io_pop_payload_data (wFifo_io_pop_payload_data[31:0] ), //o
.io_pop_payload_strb (wFifo_io_pop_payload_strb[3:0] ), //o
.io_pop_payload_last (wFifo_io_pop_payload_last ), //o
.io_flush (_zz_12 ), //i
.io_occupancy (wFifo_io_occupancy[6:0] ), //o
.io_availability (wFifo_io_availability[6:0] ), //o
.clk (clk ), //i
.reset (reset ) //i
);
StreamFifo_3 bFifo (
.io_push_valid (_zz_13 ), //i
.io_push_ready (bFifo_io_push_ready ), //o
.io_push_payload_id (opIdReg[3:0] ), //i
.io_push_payload_resp (_zz_14[1:0] ), //i
.io_pop_valid (bFifo_io_pop_valid ), //o
.io_pop_ready (io_axi_b_ready ), //i
.io_pop_payload_id (bFifo_io_pop_payload_id[3:0] ), //o
.io_pop_payload_resp (bFifo_io_pop_payload_resp[1:0] ), //o
.io_flush (_zz_15 ), //i
.io_occupancy (bFifo_io_occupancy[6:0] ), //o
.io_availability (bFifo_io_availability[6:0] ), //o
.clk (clk ), //i
.reset (reset ) //i
);
StreamFifo_1 arFifo (
.io_push_valid (io_axi_ar_valid ), //i
.io_push_ready (arFifo_io_push_ready ), //o
.io_push_payload_addr (io_axi_ar_payload_addr[31:0] ), //i
.io_push_payload_id (io_axi_ar_payload_id[3:0] ), //i
.io_push_payload_len (io_axi_ar_payload_len[7:0] ), //i
.io_push_payload_size (io_axi_ar_payload_size[2:0] ), //i
.io_push_payload_burst (io_axi_ar_payload_burst[1:0] ), //i
.io_pop_valid (arFifo_io_pop_valid ), //o
.io_pop_ready (_zz_16 ), //i
.io_pop_payload_addr (arFifo_io_pop_payload_addr[31:0] ), //o
.io_pop_payload_id (arFifo_io_pop_payload_id[3:0] ), //o
.io_pop_payload_len (arFifo_io_pop_payload_len[7:0] ), //o
.io_pop_payload_size (arFifo_io_pop_payload_size[2:0] ), //o
.io_pop_payload_burst (arFifo_io_pop_payload_burst[1:0] ), //o
.io_flush (_zz_17 ), //i
.io_occupancy (arFifo_io_occupancy[6:0] ), //o
.io_availability (arFifo_io_availability[6:0] ), //o
.clk (clk ), //i
.reset (reset ) //i
);
StreamFifo_5 rFifo (
.io_push_valid (busReadDataVldReg ), //i
.io_push_ready (rFifo_io_push_ready ), //o
.io_push_payload_data (busReadDataReg[31:0] ), //i
.io_push_payload_id (opIdReg[3:0] ), //i
.io_push_payload_resp (_zz_18[1:0] ), //i
.io_push_payload_last (busReadDataLastReg ), //i
.io_pop_valid (rFifo_io_pop_valid ), //o
.io_pop_ready (io_axi_r_ready ), //i
.io_pop_payload_data (rFifo_io_pop_payload_data[31:0] ), //o
.io_pop_payload_id (rFifo_io_pop_payload_id[3:0] ), //o
.io_pop_payload_resp (rFifo_io_pop_payload_resp[1:0] ), //o
.io_pop_payload_last (rFifo_io_pop_payload_last ), //o
.io_flush (_zz_19 ), //i
.io_occupancy (rFifo_io_occupancy[6:0] ), //o
.io_availability (rFifo_io_availability[6:0] ), //o
.clk (clk ), //i
.reset (reset ) //i
);
`ifndef SYNTHESIS
always @(*) begin
case(readFsm_stateReg)
`readFsm_enumDefinition_binary_sequential_readFsm_BOOT : readFsm_stateReg_string = "readFsm_BOOT ";
`readFsm_enumDefinition_binary_sequential_readFsm_ACTIVE : readFsm_stateReg_string = "readFsm_ACTIVE ";
`readFsm_enumDefinition_binary_sequential_readFsm_SEND_READ_CMD : readFsm_stateReg_string = "readFsm_SEND_READ_CMD";
`readFsm_enumDefinition_binary_sequential_readFsm_BURST_READ : readFsm_stateReg_string = "readFsm_BURST_READ ";
default : readFsm_stateReg_string = "?????????????????????";
endcase
end
always @(*) begin
case(readFsm_stateNext)
`readFsm_enumDefinition_binary_sequential_readFsm_BOOT : readFsm_stateNext_string = "readFsm_BOOT ";
`readFsm_enumDefinition_binary_sequential_readFsm_ACTIVE : readFsm_stateNext_string = "readFsm_ACTIVE ";
`readFsm_enumDefinition_binary_sequential_readFsm_SEND_READ_CMD : readFsm_stateNext_string = "readFsm_SEND_READ_CMD";
`readFsm_enumDefinition_binary_sequential_readFsm_BURST_READ : readFsm_stateNext_string = "readFsm_BURST_READ ";
default : readFsm_stateNext_string = "?????????????????????";
endcase
end
always @(*) begin
case(initFsm_stateReg)
`initFsm_enumDefinition_binary_sequential_initFsm_BOOT : initFsm_stateReg_string = "initFsm_BOOT ";
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_WAIT : initFsm_stateReg_string = "initFsm_INIT_WAIT ";
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_PRECHARGE : initFsm_stateReg_string = "initFsm_INIT_PRECHARGE ";
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_1 : initFsm_stateReg_string = "initFsm_INIT_REFRESH_1 ";
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_2 : initFsm_stateReg_string = "initFsm_INIT_REFRESH_2 ";
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_LOAD_MODE_REG : initFsm_stateReg_string = "initFsm_INIT_LOAD_MODE_REG";
default : initFsm_stateReg_string = "??????????????????????????";
endcase
end
always @(*) begin
case(initFsm_stateNext)
`initFsm_enumDefinition_binary_sequential_initFsm_BOOT : initFsm_stateNext_string = "initFsm_BOOT ";
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_WAIT : initFsm_stateNext_string = "initFsm_INIT_WAIT ";
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_PRECHARGE : initFsm_stateNext_string = "initFsm_INIT_PRECHARGE ";
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_1 : initFsm_stateNext_string = "initFsm_INIT_REFRESH_1 ";
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_2 : initFsm_stateNext_string = "initFsm_INIT_REFRESH_2 ";
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_LOAD_MODE_REG : initFsm_stateNext_string = "initFsm_INIT_LOAD_MODE_REG";
default : initFsm_stateNext_string = "??????????????????????????";
endcase
end
always @(*) begin
case(writeFsm_stateReg)
`writeFsm_enumDefinition_binary_sequential_writeFsm_BOOT : writeFsm_stateReg_string = "writeFsm_BOOT ";
`writeFsm_enumDefinition_binary_sequential_writeFsm_ACTIVE_WRITE : writeFsm_stateReg_string = "writeFsm_ACTIVE_WRITE";
`writeFsm_enumDefinition_binary_sequential_writeFsm_BURST_WRITE : writeFsm_stateReg_string = "writeFsm_BURST_WRITE ";
`writeFsm_enumDefinition_binary_sequential_writeFsm_TERM_WRITE : writeFsm_stateReg_string = "writeFsm_TERM_WRITE ";
default : writeFsm_stateReg_string = "?????????????????????";
endcase
end
always @(*) begin
case(writeFsm_stateNext)
`writeFsm_enumDefinition_binary_sequential_writeFsm_BOOT : writeFsm_stateNext_string = "writeFsm_BOOT ";
`writeFsm_enumDefinition_binary_sequential_writeFsm_ACTIVE_WRITE : writeFsm_stateNext_string = "writeFsm_ACTIVE_WRITE";
`writeFsm_enumDefinition_binary_sequential_writeFsm_BURST_WRITE : writeFsm_stateNext_string = "writeFsm_BURST_WRITE ";
`writeFsm_enumDefinition_binary_sequential_writeFsm_TERM_WRITE : writeFsm_stateNext_string = "writeFsm_TERM_WRITE ";
default : writeFsm_stateNext_string = "?????????????????????";
endcase
end
always @(*) begin
case(refreshFsm_stateReg)
`refreshFsm_enumDefinition_binary_sequential_refreshFsm_BOOT : refreshFsm_stateReg_string = "refreshFsm_BOOT ";
`refreshFsm_enumDefinition_binary_sequential_refreshFsm_REFRESH_PRECHARGE : refreshFsm_stateReg_string = "refreshFsm_REFRESH_PRECHARGE";
`refreshFsm_enumDefinition_binary_sequential_refreshFsm_REFRESH : refreshFsm_stateReg_string = "refreshFsm_REFRESH ";
default : refreshFsm_stateReg_string = "????????????????????????????";
endcase
end
always @(*) begin
case(refreshFsm_stateNext)
`refreshFsm_enumDefinition_binary_sequential_refreshFsm_BOOT : refreshFsm_stateNext_string = "refreshFsm_BOOT ";
`refreshFsm_enumDefinition_binary_sequential_refreshFsm_REFRESH_PRECHARGE : refreshFsm_stateNext_string = "refreshFsm_REFRESH_PRECHARGE";
`refreshFsm_enumDefinition_binary_sequential_refreshFsm_REFRESH : refreshFsm_stateNext_string = "refreshFsm_REFRESH ";
default : refreshFsm_stateNext_string = "????????????????????????????";
endcase
end
always @(*) begin
case(fsm_stateReg)
`fsm_enumDefinition_binary_sequential_fsm_BOOT : fsm_stateReg_string = "fsm_BOOT ";
`fsm_enumDefinition_binary_sequential_fsm_INIT : fsm_stateReg_string = "fsm_INIT ";
`fsm_enumDefinition_binary_sequential_fsm_IDLE : fsm_stateReg_string = "fsm_IDLE ";
`fsm_enumDefinition_binary_sequential_fsm_REFRESH : fsm_stateReg_string = "fsm_REFRESH ";
`fsm_enumDefinition_binary_sequential_fsm_WRITE : fsm_stateReg_string = "fsm_WRITE ";
`fsm_enumDefinition_binary_sequential_fsm_READ : fsm_stateReg_string = "fsm_READ ";
`fsm_enumDefinition_binary_sequential_fsm_PRECHARGE : fsm_stateReg_string = "fsm_PRECHARGE";
default : fsm_stateReg_string = "?????????????";
endcase
end
always @(*) begin
case(fsm_stateNext)
`fsm_enumDefinition_binary_sequential_fsm_BOOT : fsm_stateNext_string = "fsm_BOOT ";
`fsm_enumDefinition_binary_sequential_fsm_INIT : fsm_stateNext_string = "fsm_INIT ";
`fsm_enumDefinition_binary_sequential_fsm_IDLE : fsm_stateNext_string = "fsm_IDLE ";
`fsm_enumDefinition_binary_sequential_fsm_REFRESH : fsm_stateNext_string = "fsm_REFRESH ";
`fsm_enumDefinition_binary_sequential_fsm_WRITE : fsm_stateNext_string = "fsm_WRITE ";
`fsm_enumDefinition_binary_sequential_fsm_READ : fsm_stateNext_string = "fsm_READ ";
`fsm_enumDefinition_binary_sequential_fsm_PRECHARGE : fsm_stateNext_string = "fsm_PRECHARGE";
default : fsm_stateNext_string = "?????????????";
endcase
end
`endif
assign CMD_UNSELECTED = 4'b1000;
assign CMD_NOP = 4'b0111;
assign CMD_ACTIVE = 4'b0011;
assign CMD_READ = 4'b0101;
assign CMD_WRITE = 4'b0100;
assign CMD_BURST_TERMINATE = 4'b0110;
assign CMD_PRECHARGE = 4'b0010;
assign CMD_REFRESH = 4'b0001;
assign CMD_LOAD_MODE_REG = 4'b0000;
assign DQM_ALL_VALID = 2'b00;
assign DQM_ALL_INVALID = (~ DQM_ALL_VALID);
assign MODE_VALUE = {{6'h0,3'b011},4'b0111};
assign io_axi_aw_ready = awFifo_io_push_ready;
assign io_axi_w_ready = wFifo_io_push_ready;
assign io_axi_b_valid = bFifo_io_pop_valid;
assign io_axi_b_payload_id = bFifo_io_pop_payload_id;
assign io_axi_b_payload_resp = bFifo_io_pop_payload_resp;
assign io_axi_ar_ready = arFifo_io_push_ready;
assign io_axi_r_valid = rFifo_io_pop_valid;
assign io_axi_r_payload_data = rFifo_io_pop_payload_data;
assign io_axi_r_payload_id = rFifo_io_pop_payload_id;
assign io_axi_r_payload_resp = rFifo_io_pop_payload_resp;
assign io_axi_r_payload_last = rFifo_io_pop_payload_last;
assign writeMask = strobeReg[1 : 0];
assign busWrite = busWriteDataReg[15 : 0];
always @ (*) begin
_zz_9 = 1'b0;
if(_zz_20)begin
_zz_9 = 1'b1;
end
end
always @ (*) begin
_zz_11 = 1'b0;
case(writeFsm_stateReg)
`writeFsm_enumDefinition_binary_sequential_writeFsm_ACTIVE_WRITE : begin
end
`writeFsm_enumDefinition_binary_sequential_writeFsm_BURST_WRITE : begin
if(! _zz_21) begin
_zz_11 = 1'b1;
end
end
`writeFsm_enumDefinition_binary_sequential_writeFsm_TERM_WRITE : begin
end
default : begin
end
endcase
if(_zz_22)begin
_zz_11 = 1'b1;
end
end
always @ (*) begin
_zz_13 = 1'b0;
if(_zz_23)begin
_zz_13 = 1'b1;
end
end
always @ (*) begin
_zz_16 = 1'b0;
if(_zz_24)begin
_zz_16 = 1'b1;
end
end
assign _zz_14 = 2'b00;
assign _zz_18 = 2'b00;
assign io_sdram_BA = bankAddrReg;
assign io_sdram_ADDR = addressReg;
assign io_sdram_DQM = mask;
assign io_sdram_CKE = 1'b1;
assign io_sdram_CSn = commandReg[3];
assign io_sdram_RASn = commandReg[2];
assign io_sdram_CASn = commandReg[1];
assign io_sdram_WEn = commandReg[0];
assign io_sdram_DQ_write = busWrite;
always @ (*) begin
io_initDone = 1'b0;
if((_zz_7 && (! _zz_8)))begin
io_initDone = 1'b1;
end
end
assign initCounter_busy = (initCounter_counter != 14'h0);
assign stateCounter_busy = (stateCounter_counter != 3'b000);
assign refreshCounter_willClear = 1'b0;
assign refreshCounter_willOverflowIfInc = (refreshCounter_value == 10'h30d);
assign refreshCounter_willOverflow = (refreshCounter_willOverflowIfInc && refreshCounter_willIncrement);
always @ (*) begin
if(refreshCounter_willOverflow)begin
refreshCounter_valueNext = 10'h0;
end else begin
refreshCounter_valueNext = (refreshCounter_value + _zz_30);
end
if(refreshCounter_willClear)begin
refreshCounter_valueNext = 10'h0;
end
end
assign refreshCounter_willIncrement = 1'b1;
assign readReq = (arFifo_io_pop_valid && (arFifo_io_pop_payload_len <= _zz_31));
assign writeReq = ((awFifo_io_pop_valid && (awFifo_io_pop_payload_len <= _zz_32)) && (7'h0 < bFifo_io_availability));
always @ (*) begin
initFsm_wantExit = 1'b0;
case(initFsm_stateReg)
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_WAIT : begin
end
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_PRECHARGE : begin
end
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_1 : begin
end
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_2 : begin
end
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_LOAD_MODE_REG : begin
if(_zz_25)begin
initFsm_wantExit = 1'b1;
end
end
default : begin
end
endcase
end
always @ (*) begin
initFsm_wantStart = 1'b0;
if(((! _zz_7) && _zz_8))begin
initFsm_wantStart = 1'b1;
end
end
always @ (*) begin
refreshFsm_wantExit = 1'b0;
case(refreshFsm_stateReg)
`refreshFsm_enumDefinition_binary_sequential_refreshFsm_REFRESH_PRECHARGE : begin
end
`refreshFsm_enumDefinition_binary_sequential_refreshFsm_REFRESH : begin
if(_zz_26)begin
refreshFsm_wantExit = 1'b1;
end
end
default : begin
end
endcase
end
always @ (*) begin
refreshFsm_wantStart = 1'b0;
if(((! (fsm_stateReg == `fsm_enumDefinition_binary_sequential_fsm_REFRESH)) && (fsm_stateNext == `fsm_enumDefinition_binary_sequential_fsm_REFRESH)))begin
refreshFsm_wantStart = 1'b1;
end
end
always @ (*) begin
writeFsm_wantExit = 1'b0;
case(writeFsm_stateReg)
`writeFsm_enumDefinition_binary_sequential_writeFsm_ACTIVE_WRITE : begin
end
`writeFsm_enumDefinition_binary_sequential_writeFsm_BURST_WRITE : begin
end
`writeFsm_enumDefinition_binary_sequential_writeFsm_TERM_WRITE : begin
writeFsm_wantExit = 1'b1;
end
default : begin
end
endcase
end
always @ (*) begin
writeFsm_wantStart = 1'b0;
if(((! (fsm_stateReg == `fsm_enumDefinition_binary_sequential_fsm_WRITE)) && (fsm_stateNext == `fsm_enumDefinition_binary_sequential_fsm_WRITE)))begin
writeFsm_wantStart = 1'b1;
end
end
always @ (*) begin
readFsm_wantExit = 1'b0;
case(readFsm_stateReg)
`readFsm_enumDefinition_binary_sequential_readFsm_ACTIVE : begin
end
`readFsm_enumDefinition_binary_sequential_readFsm_SEND_READ_CMD : begin
end
`readFsm_enumDefinition_binary_sequential_readFsm_BURST_READ : begin
if(! _zz_27) begin
if(_zz_28)begin
readFsm_wantExit = 1'b1;
end
end
end
default : begin
end
endcase
end
always @ (*) begin
readFsm_wantStart = 1'b0;
if(((! (fsm_stateReg == `fsm_enumDefinition_binary_sequential_fsm_READ)) && (fsm_stateNext == `fsm_enumDefinition_binary_sequential_fsm_READ)))begin
readFsm_wantStart = 1'b1;
end
end
assign fsm_wantExit = 1'b0;
always @ (*) begin
fsm_wantStart = 1'b0;
case(fsm_stateReg)
`fsm_enumDefinition_binary_sequential_fsm_INIT : begin
end
`fsm_enumDefinition_binary_sequential_fsm_IDLE : begin
end
`fsm_enumDefinition_binary_sequential_fsm_REFRESH : begin
end
`fsm_enumDefinition_binary_sequential_fsm_WRITE : begin
end
`fsm_enumDefinition_binary_sequential_fsm_READ : begin
end
`fsm_enumDefinition_binary_sequential_fsm_PRECHARGE : begin
end
default : begin
fsm_wantStart = 1'b1;
end
endcase
end
assign initPeriod = (fsm_stateReg == `fsm_enumDefinition_binary_sequential_fsm_INIT);
always @ (*) begin
if((writeFsm_stateReg == `writeFsm_enumDefinition_binary_sequential_writeFsm_BURST_WRITE))begin
mask = (DQM_ALL_VALID | (~ writeMask));
end else begin
if((fsm_stateReg == `fsm_enumDefinition_binary_sequential_fsm_READ))begin
mask = DQM_ALL_VALID;
end else begin
mask = DQM_ALL_INVALID;
end
end
end
always @ (*) begin
if((writeFsm_stateReg == `writeFsm_enumDefinition_binary_sequential_writeFsm_BURST_WRITE))begin
io_sdram_DQ_writeEnable = 16'hffff;
end else begin
io_sdram_DQ_writeEnable = 16'h0;
end
end
assign _zz_1 = (readFsm_stateReg == `readFsm_enumDefinition_binary_sequential_readFsm_BURST_READ);
assign _zz_2 = (readFsm_stateNext == `readFsm_enumDefinition_binary_sequential_readFsm_BURST_READ);
always @ (*) begin
readFsm_stateNext = readFsm_stateReg;
case(readFsm_stateReg)
`readFsm_enumDefinition_binary_sequential_readFsm_ACTIVE : begin
if((! stateCounter_busy))begin
readFsm_stateNext = `readFsm_enumDefinition_binary_sequential_readFsm_SEND_READ_CMD;
end
end
`readFsm_enumDefinition_binary_sequential_readFsm_SEND_READ_CMD : begin
if((! stateCounter_busy))begin
readFsm_stateNext = `readFsm_enumDefinition_binary_sequential_readFsm_BURST_READ;
end
end
`readFsm_enumDefinition_binary_sequential_readFsm_BURST_READ : begin
if(! _zz_27) begin
if(_zz_28)begin
readFsm_stateNext = `readFsm_enumDefinition_binary_sequential_readFsm_BOOT;
end
end
end
default : begin
end
endcase
if(readFsm_wantStart)begin
readFsm_stateNext = `readFsm_enumDefinition_binary_sequential_readFsm_ACTIVE;
end
end
always @ (*) begin
initFsm_stateNext = initFsm_stateReg;
case(initFsm_stateReg)
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_WAIT : begin
if((! initCounter_busy))begin
initFsm_stateNext = `initFsm_enumDefinition_binary_sequential_initFsm_INIT_PRECHARGE;
end
end
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_PRECHARGE : begin
if((! stateCounter_busy))begin
initFsm_stateNext = `initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_1;
end
end
`initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_1 : begin
if((! stateCounter_busy))begin
initFsm_stateNext = `initFsm_enumDefinition_binary_sequential_initFsm_INIT_REFRESH_2;