-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpu_0.vhd
5939 lines (5271 loc) · 314 KB
/
cpu_0.vhd
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
--Legal Notice: (C)2013 Altera Corporation. All rights reserved. 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 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 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.
-- turn off superfluous VHDL processor warnings
-- altera message_level Level1
-- altera message_off 10034 10035 10036 10037 10230 10240 10030
library altera;
use altera.altera_europa_support_lib.all;
library altera_mf;
use altera_mf.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
library lpm;
use lpm.all;
entity cpu_0_register_bank_a_module is
generic (
lpm_file : STRING := "UNUSED"
);
port (
-- inputs:
signal clock : IN STD_LOGIC;
signal data : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
signal rdaddress : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
signal wraddress : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
signal wren : IN STD_LOGIC;
-- outputs:
signal q : OUT STD_LOGIC_VECTOR (31 DOWNTO 0)
);
end entity cpu_0_register_bank_a_module;
architecture europa of cpu_0_register_bank_a_module is
component altsyncram is
GENERIC (
address_reg_b : STRING;
init_file : STRING;
maximum_depth : NATURAL;
numwords_a : NATURAL;
numwords_b : NATURAL;
operation_mode : STRING;
outdata_reg_b : STRING;
ram_block_type : STRING;
rdcontrol_reg_b : STRING;
read_during_write_mode_mixed_ports : STRING;
width_a : NATURAL;
width_b : NATURAL;
widthad_a : NATURAL;
widthad_b : NATURAL
);
PORT (
signal q_b : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
signal wren_a : IN STD_LOGIC;
signal clock0 : IN STD_LOGIC;
signal address_a : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
signal address_b : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
signal data_a : IN STD_LOGIC_VECTOR (31 DOWNTO 0)
);
end component altsyncram;
signal ram_q : STD_LOGIC_VECTOR (31 DOWNTO 0);
begin
q <= ram_q;
the_altsyncram : altsyncram
generic map(
address_reg_b => "CLOCK0",
init_file => lpm_file,
maximum_depth => 0,
numwords_a => 32,
numwords_b => 32,
operation_mode => "DUAL_PORT",
outdata_reg_b => "UNREGISTERED",
ram_block_type => "AUTO",
rdcontrol_reg_b => "CLOCK0",
read_during_write_mode_mixed_ports => "DONT_CARE",
width_a => 32,
width_b => 32,
widthad_a => 5,
widthad_b => 5
)
port map(
address_a => wraddress,
address_b => rdaddress,
clock0 => clock,
data_a => data,
q_b => ram_q,
wren_a => wren
);
end europa;
-- turn off superfluous VHDL processor warnings
-- altera message_level Level1
-- altera message_off 10034 10035 10036 10037 10230 10240 10030
library altera;
use altera.altera_europa_support_lib.all;
library altera_mf;
use altera_mf.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
library lpm;
use lpm.all;
entity cpu_0_register_bank_b_module is
generic (
lpm_file : STRING := "UNUSED"
);
port (
-- inputs:
signal clock : IN STD_LOGIC;
signal data : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
signal rdaddress : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
signal wraddress : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
signal wren : IN STD_LOGIC;
-- outputs:
signal q : OUT STD_LOGIC_VECTOR (31 DOWNTO 0)
);
end entity cpu_0_register_bank_b_module;
architecture europa of cpu_0_register_bank_b_module is
component altsyncram is
GENERIC (
address_reg_b : STRING;
init_file : STRING;
maximum_depth : NATURAL;
numwords_a : NATURAL;
numwords_b : NATURAL;
operation_mode : STRING;
outdata_reg_b : STRING;
ram_block_type : STRING;
rdcontrol_reg_b : STRING;
read_during_write_mode_mixed_ports : STRING;
width_a : NATURAL;
width_b : NATURAL;
widthad_a : NATURAL;
widthad_b : NATURAL
);
PORT (
signal q_b : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
signal wren_a : IN STD_LOGIC;
signal clock0 : IN STD_LOGIC;
signal address_a : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
signal address_b : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
signal data_a : IN STD_LOGIC_VECTOR (31 DOWNTO 0)
);
end component altsyncram;
signal ram_q : STD_LOGIC_VECTOR (31 DOWNTO 0);
begin
q <= ram_q;
the_altsyncram : altsyncram
generic map(
address_reg_b => "CLOCK0",
init_file => lpm_file,
maximum_depth => 0,
numwords_a => 32,
numwords_b => 32,
operation_mode => "DUAL_PORT",
outdata_reg_b => "UNREGISTERED",
ram_block_type => "AUTO",
rdcontrol_reg_b => "CLOCK0",
read_during_write_mode_mixed_ports => "DONT_CARE",
width_a => 32,
width_b => 32,
widthad_a => 5,
widthad_b => 5
)
port map(
address_a => wraddress,
address_b => rdaddress,
clock0 => clock,
data_a => data,
q_b => ram_q,
wren_a => wren
);
end europa;
-- turn off superfluous VHDL processor warnings
-- altera message_level Level1
-- altera message_off 10034 10035 10036 10037 10230 10240 10030
library altera;
use altera.altera_europa_support_lib.all;
library altera_mf;
use altera_mf.altera_mf_components.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity cpu_0_nios2_oci_debug is
port (
-- inputs:
signal clk : IN STD_LOGIC;
signal dbrk_break : IN STD_LOGIC;
signal debugreq : IN STD_LOGIC;
signal hbreak_enabled : IN STD_LOGIC;
signal jdo : IN STD_LOGIC_VECTOR (37 DOWNTO 0);
signal jrst_n : IN STD_LOGIC;
signal ocireg_ers : IN STD_LOGIC;
signal ocireg_mrs : IN STD_LOGIC;
signal reset : IN STD_LOGIC;
signal st_ready_test_idle : IN STD_LOGIC;
signal take_action_ocimem_a : IN STD_LOGIC;
signal take_action_ocireg : IN STD_LOGIC;
signal xbrk_break : IN STD_LOGIC;
-- outputs:
signal debugack : OUT STD_LOGIC;
signal monitor_error : OUT STD_LOGIC;
signal monitor_go : OUT STD_LOGIC;
signal monitor_ready : OUT STD_LOGIC;
signal oci_hbreak_req : OUT STD_LOGIC;
signal resetlatch : OUT STD_LOGIC;
signal resetrequest : OUT STD_LOGIC
);
end entity cpu_0_nios2_oci_debug;
architecture europa of cpu_0_nios2_oci_debug is
signal internal_debugack : STD_LOGIC;
signal internal_resetlatch : STD_LOGIC;
signal jtag_break : STD_LOGIC;
signal probepresent : STD_LOGIC;
attribute ALTERA_ATTRIBUTE : string;
attribute ALTERA_ATTRIBUTE of jtag_break : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,R101""";
attribute ALTERA_ATTRIBUTE of monitor_error : signal is "SUPPRESS_DA_RULE_INTERNAL=D101";
attribute ALTERA_ATTRIBUTE of monitor_go : signal is "SUPPRESS_DA_RULE_INTERNAL=D101";
attribute ALTERA_ATTRIBUTE of monitor_ready : signal is "SUPPRESS_DA_RULE_INTERNAL=D101";
attribute ALTERA_ATTRIBUTE of probepresent : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,R101""";
attribute ALTERA_ATTRIBUTE of resetlatch : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,R101""";
attribute ALTERA_ATTRIBUTE of resetrequest : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,R101""";
begin
process (clk, jrst_n)
begin
if jrst_n = '0' then
probepresent <= std_logic'('0');
resetrequest <= std_logic'('0');
jtag_break <= std_logic'('0');
elsif clk'event and clk = '1' then
if std_logic'(take_action_ocimem_a) = '1' then
resetrequest <= jdo(22);
jtag_break <= Vector_To_Std_Logic(A_WE_StdLogicVector((std_logic'(jdo(21)) = '1'), std_logic_vector'("00000000000000000000000000000001"), A_WE_StdLogicVector((std_logic'(jdo(20)) = '1'), std_logic_vector'("00000000000000000000000000000000"), (std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(jtag_break))))));
probepresent <= Vector_To_Std_Logic(A_WE_StdLogicVector((std_logic'(jdo(19)) = '1'), std_logic_vector'("00000000000000000000000000000001"), A_WE_StdLogicVector((std_logic'(jdo(18)) = '1'), std_logic_vector'("00000000000000000000000000000000"), (std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(probepresent))))));
internal_resetlatch <= Vector_To_Std_Logic(A_WE_StdLogicVector((std_logic'(jdo(24)) = '1'), std_logic_vector'("00000000000000000000000000000000"), (std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(internal_resetlatch)))));
elsif std_logic'(reset) = '1' then
jtag_break <= probepresent;
internal_resetlatch <= std_logic'('1');
elsif std_logic'(((NOT internal_debugack AND debugreq) AND probepresent)) = '1' then
jtag_break <= std_logic'('1');
end if;
end if;
end process;
process (clk, jrst_n)
begin
if jrst_n = '0' then
monitor_ready <= std_logic'('0');
monitor_error <= std_logic'('0');
monitor_go <= std_logic'('0');
elsif clk'event and clk = '1' then
if std_logic'((take_action_ocimem_a AND jdo(25))) = '1' then
monitor_ready <= std_logic'('0');
elsif std_logic'((take_action_ocireg AND ocireg_mrs)) = '1' then
monitor_ready <= std_logic'('1');
end if;
if std_logic'((take_action_ocimem_a AND jdo(25))) = '1' then
monitor_error <= std_logic'('0');
elsif std_logic'((take_action_ocireg AND ocireg_ers)) = '1' then
monitor_error <= std_logic'('1');
end if;
if std_logic'((take_action_ocimem_a AND jdo(23))) = '1' then
monitor_go <= std_logic'('1');
elsif std_logic'(st_ready_test_idle) = '1' then
monitor_go <= std_logic'('0');
end if;
end if;
end process;
oci_hbreak_req <= ((jtag_break OR dbrk_break) OR xbrk_break) OR debugreq;
internal_debugack <= NOT hbreak_enabled;
--vhdl renameroo for output signals
debugack <= internal_debugack;
--vhdl renameroo for output signals
resetlatch <= internal_resetlatch;
end europa;
-- turn off superfluous VHDL processor warnings
-- altera message_level Level1
-- altera message_off 10034 10035 10036 10037 10230 10240 10030
library altera;
use altera.altera_europa_support_lib.all;
library altera_mf;
use altera_mf.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
library lpm;
use lpm.all;
entity cpu_0_ociram_lpm_dram_bdp_component_module is
generic (
lpm_file : STRING := "UNUSED"
);
port (
-- inputs:
signal address_a : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
signal address_b : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
signal byteena_a : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
signal clock0 : IN STD_LOGIC;
signal clock1 : IN STD_LOGIC;
signal clocken0 : IN STD_LOGIC;
signal clocken1 : IN STD_LOGIC;
signal data_a : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
signal data_b : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
signal wren_a : IN STD_LOGIC;
signal wren_b : IN STD_LOGIC;
-- outputs:
signal q_a : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
signal q_b : OUT STD_LOGIC_VECTOR (31 DOWNTO 0)
);
end entity cpu_0_ociram_lpm_dram_bdp_component_module;
architecture europa of cpu_0_ociram_lpm_dram_bdp_component_module is
component altsyncram is
GENERIC (
address_aclr_a : STRING;
address_aclr_b : STRING;
address_reg_b : STRING;
indata_aclr_a : STRING;
indata_aclr_b : STRING;
init_file : STRING;
intended_device_family : STRING;
lpm_type : STRING;
numwords_a : NATURAL;
numwords_b : NATURAL;
operation_mode : STRING;
outdata_aclr_a : STRING;
outdata_aclr_b : STRING;
outdata_reg_a : STRING;
outdata_reg_b : STRING;
ram_block_type : STRING;
read_during_write_mode_mixed_ports : STRING;
width_a : NATURAL;
width_b : NATURAL;
width_byteena_a : NATURAL;
widthad_a : NATURAL;
widthad_b : NATURAL;
wrcontrol_aclr_a : STRING;
wrcontrol_aclr_b : STRING
);
PORT (
signal q_b : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
signal q_a : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
signal wren_a : IN STD_LOGIC;
signal data_b : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
signal clock0 : IN STD_LOGIC;
signal clocken0 : IN STD_LOGIC;
signal byteena_a : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
signal clocken1 : IN STD_LOGIC;
signal wren_b : IN STD_LOGIC;
signal clock1 : IN STD_LOGIC;
signal address_a : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
signal address_b : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
signal data_a : IN STD_LOGIC_VECTOR (31 DOWNTO 0)
);
end component altsyncram;
signal internal_q_a : STD_LOGIC_VECTOR (31 DOWNTO 0);
signal internal_q_b : STD_LOGIC_VECTOR (31 DOWNTO 0);
begin
the_altsyncram : altsyncram
generic map(
address_aclr_a => "NONE",
address_aclr_b => "NONE",
address_reg_b => "CLOCK1",
indata_aclr_a => "NONE",
indata_aclr_b => "NONE",
init_file => lpm_file,
intended_device_family => "CYCLONEII",
lpm_type => "altsyncram",
numwords_a => 256,
numwords_b => 256,
operation_mode => "BIDIR_DUAL_PORT",
outdata_aclr_a => "NONE",
outdata_aclr_b => "NONE",
outdata_reg_a => "UNREGISTERED",
outdata_reg_b => "UNREGISTERED",
ram_block_type => "AUTO",
read_during_write_mode_mixed_ports => "OLD_DATA",
width_a => 32,
width_b => 32,
width_byteena_a => 4,
widthad_a => 8,
widthad_b => 8,
wrcontrol_aclr_a => "NONE",
wrcontrol_aclr_b => "NONE"
)
port map(
address_a => address_a,
address_b => address_b,
byteena_a => byteena_a,
clock0 => clock0,
clock1 => clock1,
clocken0 => clocken0,
clocken1 => clocken1,
data_a => data_a,
data_b => data_b,
q_a => internal_q_a,
q_b => internal_q_b,
wren_a => wren_a,
wren_b => wren_b
);
--vhdl renameroo for output signals
q_a <= internal_q_a;
--vhdl renameroo for output signals
q_b <= internal_q_b;
end europa;
-- turn off superfluous VHDL processor warnings
-- altera message_level Level1
-- altera message_off 10034 10035 10036 10037 10230 10240 10030
library altera;
use altera.altera_europa_support_lib.all;
library altera_mf;
use altera_mf.altera_mf_components.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity cpu_0_nios2_ocimem is
port (
-- inputs:
signal address : IN STD_LOGIC_VECTOR (8 DOWNTO 0);
signal begintransfer : IN STD_LOGIC;
signal byteenable : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
signal chipselect : IN STD_LOGIC;
signal clk : IN STD_LOGIC;
signal debugaccess : IN STD_LOGIC;
signal jdo : IN STD_LOGIC_VECTOR (37 DOWNTO 0);
signal jrst_n : IN STD_LOGIC;
signal resetrequest : IN STD_LOGIC;
signal take_action_ocimem_a : IN STD_LOGIC;
signal take_action_ocimem_b : IN STD_LOGIC;
signal take_no_action_ocimem_a : IN STD_LOGIC;
signal write : IN STD_LOGIC;
signal writedata : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
-- outputs:
signal MonDReg : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
signal oci_ram_readdata : OUT STD_LOGIC_VECTOR (31 DOWNTO 0)
);
end entity cpu_0_nios2_ocimem;
architecture europa of cpu_0_nios2_ocimem is
component cpu_0_ociram_lpm_dram_bdp_component_module is
generic (
lpm_file : STRING := "UNUSED"
);
port (
-- inputs:
signal address_a : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
signal address_b : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
signal byteena_a : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
signal clock0 : IN STD_LOGIC;
signal clock1 : IN STD_LOGIC;
signal clocken0 : IN STD_LOGIC;
signal clocken1 : IN STD_LOGIC;
signal data_a : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
signal data_b : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
signal wren_a : IN STD_LOGIC;
signal wren_b : IN STD_LOGIC;
-- outputs:
signal q_a : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
signal q_b : OUT STD_LOGIC_VECTOR (31 DOWNTO 0)
);
end component cpu_0_ociram_lpm_dram_bdp_component_module;
signal MonAReg : STD_LOGIC_VECTOR (10 DOWNTO 0);
signal MonRd : STD_LOGIC;
signal MonRd1 : STD_LOGIC;
signal MonWr : STD_LOGIC;
signal avalon : STD_LOGIC;
signal cfgdout : STD_LOGIC_VECTOR (31 DOWNTO 0);
signal internal_MonDReg : STD_LOGIC_VECTOR (31 DOWNTO 0);
signal internal_oci_ram_readdata : STD_LOGIC_VECTOR (31 DOWNTO 0);
signal module_input : STD_LOGIC_VECTOR (7 DOWNTO 0);
signal module_input1 : STD_LOGIC_VECTOR (7 DOWNTO 0);
signal module_input2 : STD_LOGIC;
signal module_input3 : STD_LOGIC;
signal module_input4 : STD_LOGIC_VECTOR (31 DOWNTO 0);
signal module_input5 : STD_LOGIC;
signal sramdout : STD_LOGIC_VECTOR (31 DOWNTO 0);
attribute ALTERA_ATTRIBUTE : string;
attribute ALTERA_ATTRIBUTE of MonDReg, MonAReg, MonRd1, MonRd, MonWr : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,D103,R101""";
--synthesis translate_off
constant cpu_0_ociram_lpm_dram_bdp_component_lpm_file : string := "cpu_0_ociram_default_contents.hex";
--synthesis translate_on
--synthesis read_comments_as_HDL on
--constant cpu_0_ociram_lpm_dram_bdp_component_lpm_file : string := "cpu_0_ociram_default_contents.mif";
--synthesis read_comments_as_HDL off
begin
avalon <= begintransfer AND NOT resetrequest;
process (clk, jrst_n)
begin
if jrst_n = '0' then
MonWr <= std_logic'('0');
MonRd <= std_logic'('0');
MonRd1 <= std_logic'('0');
MonAReg <= std_logic_vector'("00000000000");
internal_MonDReg <= std_logic_vector'("00000000000000000000000000000000");
elsif clk'event and clk = '1' then
if std_logic'(take_no_action_ocimem_a) = '1' then
MonAReg(10 DOWNTO 2) <= A_EXT (((std_logic_vector'("000000000000000000000000") & (MonAReg(10 DOWNTO 2))) + std_logic_vector'("000000000000000000000000000000001")), 9);
MonRd <= std_logic'('1');
elsif std_logic'(take_action_ocimem_a) = '1' then
MonAReg(10 DOWNTO 2) <= Std_Logic_Vector'(A_ToStdLogicVector(jdo(17)) & jdo(33 DOWNTO 26));
MonRd <= std_logic'('1');
elsif std_logic'(take_action_ocimem_b) = '1' then
MonAReg(10 DOWNTO 2) <= A_EXT (((std_logic_vector'("000000000000000000000000") & (MonAReg(10 DOWNTO 2))) + std_logic_vector'("000000000000000000000000000000001")), 9);
internal_MonDReg <= jdo(34 DOWNTO 3);
MonWr <= std_logic'('1');
else
if std_logic'(NOT avalon) = '1' then
MonWr <= std_logic'('0');
MonRd <= std_logic'('0');
end if;
if std_logic'(MonRd1) = '1' then
internal_MonDReg <= A_WE_StdLogicVector((std_logic'(MonAReg(10)) = '1'), cfgdout, sramdout);
end if;
end if;
MonRd1 <= MonRd;
end if;
end process;
--cpu_0_ociram_lpm_dram_bdp_component, which is an nios_tdp_ram
cpu_0_ociram_lpm_dram_bdp_component : cpu_0_ociram_lpm_dram_bdp_component_module
generic map(
lpm_file => cpu_0_ociram_lpm_dram_bdp_component_lpm_file
)
port map(
q_a => internal_oci_ram_readdata,
q_b => sramdout,
address_a => module_input,
address_b => module_input1,
byteena_a => byteenable,
clock0 => clk,
clock1 => clk,
clocken0 => module_input2,
clocken1 => module_input3,
data_a => writedata,
data_b => module_input4,
wren_a => module_input5,
wren_b => MonWr
);
module_input <= address(7 DOWNTO 0);
module_input1 <= MonAReg(9 DOWNTO 2);
module_input2 <= std_logic'('1');
module_input3 <= std_logic'('1');
module_input4 <= internal_MonDReg(31 DOWNTO 0);
module_input5 <= ((chipselect AND write) AND debugaccess) AND NOT address(8);
cfgdout <= A_WE_StdLogicVector(((MonAReg(4 DOWNTO 2) = std_logic_vector'("000"))), std_logic_vector'("00000000000010000000000000100000"), A_WE_StdLogicVector(((MonAReg(4 DOWNTO 2) = std_logic_vector'("001"))), std_logic_vector'("00000000000000000001010100010101"), A_WE_StdLogicVector(((MonAReg(4 DOWNTO 2) = std_logic_vector'("010"))), std_logic_vector'("00000000000001000000000000000000"), A_WE_StdLogicVector(((MonAReg(4 DOWNTO 2) = std_logic_vector'("011"))), std_logic_vector'("00000000000000000000000000000000"), A_WE_StdLogicVector(((MonAReg(4 DOWNTO 2) = std_logic_vector'("100"))), std_logic_vector'("00100000000000000000000000000000"), A_WE_StdLogicVector(((MonAReg(4 DOWNTO 2) = std_logic_vector'("101"))), std_logic_vector'("00000000000010000000000000000000"), A_WE_StdLogicVector(((MonAReg(4 DOWNTO 2) = std_logic_vector'("110"))), std_logic_vector'("00000000000000000000000000000000"), std_logic_vector'("00000000000000000000000000000000"))))))));
--vhdl renameroo for output signals
MonDReg <= internal_MonDReg;
--vhdl renameroo for output signals
oci_ram_readdata <= internal_oci_ram_readdata;
end europa;
-- turn off superfluous VHDL processor warnings
-- altera message_level Level1
-- altera message_off 10034 10035 10036 10037 10230 10240 10030
library altera;
use altera.altera_europa_support_lib.all;
library altera_mf;
use altera_mf.altera_mf_components.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity cpu_0_nios2_avalon_reg is
port (
-- inputs:
signal address : IN STD_LOGIC_VECTOR (8 DOWNTO 0);
signal chipselect : IN STD_LOGIC;
signal clk : IN STD_LOGIC;
signal debugaccess : IN STD_LOGIC;
signal monitor_error : IN STD_LOGIC;
signal monitor_go : IN STD_LOGIC;
signal monitor_ready : IN STD_LOGIC;
signal reset_n : IN STD_LOGIC;
signal write : IN STD_LOGIC;
signal writedata : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
-- outputs:
signal oci_ienable : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
signal oci_reg_readdata : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
signal oci_single_step_mode : OUT STD_LOGIC;
signal ocireg_ers : OUT STD_LOGIC;
signal ocireg_mrs : OUT STD_LOGIC;
signal take_action_ocireg : OUT STD_LOGIC
);
end entity cpu_0_nios2_avalon_reg;
architecture europa of cpu_0_nios2_avalon_reg is
signal internal_oci_ienable1 : STD_LOGIC_VECTOR (31 DOWNTO 0);
signal internal_oci_single_step_mode1 : STD_LOGIC;
signal internal_take_action_ocireg : STD_LOGIC;
signal oci_reg_00_addressed : STD_LOGIC;
signal oci_reg_01_addressed : STD_LOGIC;
signal ocireg_sstep : STD_LOGIC;
signal take_action_oci_intr_mask_reg : STD_LOGIC;
signal write_strobe : STD_LOGIC;
begin
oci_reg_00_addressed <= to_std_logic((address = std_logic_vector'("100000000")));
oci_reg_01_addressed <= to_std_logic((address = std_logic_vector'("100000001")));
write_strobe <= (chipselect AND write) AND debugaccess;
internal_take_action_ocireg <= write_strobe AND oci_reg_00_addressed;
take_action_oci_intr_mask_reg <= write_strobe AND oci_reg_01_addressed;
ocireg_ers <= writedata(1);
ocireg_mrs <= writedata(0);
ocireg_sstep <= writedata(3);
oci_reg_readdata <= A_WE_StdLogicVector((std_logic'(oci_reg_00_addressed) = '1'), Std_Logic_Vector'(std_logic_vector'("0000000000000000000000000000") & A_ToStdLogicVector(internal_oci_single_step_mode1) & A_ToStdLogicVector(monitor_go) & A_ToStdLogicVector(monitor_ready) & A_ToStdLogicVector(monitor_error)), A_WE_StdLogicVector((std_logic'(oci_reg_01_addressed) = '1'), internal_oci_ienable1, std_logic_vector'("00000000000000000000000000000000")));
process (clk, reset_n)
begin
if reset_n = '0' then
internal_oci_single_step_mode1 <= std_logic'('0');
elsif clk'event and clk = '1' then
if std_logic'(internal_take_action_ocireg) = '1' then
internal_oci_single_step_mode1 <= ocireg_sstep;
end if;
end if;
end process;
process (clk, reset_n)
begin
if reset_n = '0' then
internal_oci_ienable1 <= std_logic_vector'("00000000000000000000000000000001");
elsif clk'event and clk = '1' then
if std_logic'(take_action_oci_intr_mask_reg) = '1' then
internal_oci_ienable1 <= writedata OR NOT (std_logic_vector'("00000000000000000000000000000001"));
end if;
end if;
end process;
--vhdl renameroo for output signals
oci_ienable <= internal_oci_ienable1;
--vhdl renameroo for output signals
oci_single_step_mode <= internal_oci_single_step_mode1;
--vhdl renameroo for output signals
take_action_ocireg <= internal_take_action_ocireg;
end europa;
-- turn off superfluous VHDL processor warnings
-- altera message_level Level1
-- altera message_off 10034 10035 10036 10037 10230 10240 10030
library altera;
use altera.altera_europa_support_lib.all;
library altera_mf;
use altera_mf.altera_mf_components.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity cpu_0_nios2_oci_break is
port (
-- inputs:
signal clk : IN STD_LOGIC;
signal dbrk_break : IN STD_LOGIC;
signal dbrk_goto0 : IN STD_LOGIC;
signal dbrk_goto1 : IN STD_LOGIC;
signal jdo : IN STD_LOGIC_VECTOR (37 DOWNTO 0);
signal jrst_n : IN STD_LOGIC;
signal reset_n : IN STD_LOGIC;
signal take_action_break_a : IN STD_LOGIC;
signal take_action_break_b : IN STD_LOGIC;
signal take_action_break_c : IN STD_LOGIC;
signal take_no_action_break_a : IN STD_LOGIC;
signal take_no_action_break_b : IN STD_LOGIC;
signal take_no_action_break_c : IN STD_LOGIC;
signal xbrk_goto0 : IN STD_LOGIC;
signal xbrk_goto1 : IN STD_LOGIC;
-- outputs:
signal break_readreg : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
signal dbrk_hit0_latch : OUT STD_LOGIC;
signal dbrk_hit1_latch : OUT STD_LOGIC;
signal dbrk_hit2_latch : OUT STD_LOGIC;
signal dbrk_hit3_latch : OUT STD_LOGIC;
signal trigbrktype : OUT STD_LOGIC;
signal trigger_state_0 : OUT STD_LOGIC;
signal trigger_state_1 : OUT STD_LOGIC;
signal xbrk_ctrl0 : OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
signal xbrk_ctrl1 : OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
signal xbrk_ctrl2 : OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
signal xbrk_ctrl3 : OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
end entity cpu_0_nios2_oci_break;
architecture europa of cpu_0_nios2_oci_break is
signal break_a_wpr : STD_LOGIC_VECTOR (3 DOWNTO 0);
signal break_a_wpr_high_bits : STD_LOGIC_VECTOR (1 DOWNTO 0);
signal break_a_wpr_low_bits : STD_LOGIC_VECTOR (1 DOWNTO 0);
signal break_b_rr : STD_LOGIC_VECTOR (1 DOWNTO 0);
signal break_c_rr : STD_LOGIC_VECTOR (1 DOWNTO 0);
signal dbrk0_high_value : STD_LOGIC;
signal dbrk0_low_value : STD_LOGIC;
signal dbrk1_high_value : STD_LOGIC;
signal dbrk1_low_value : STD_LOGIC;
signal dbrk2_high_value : STD_LOGIC;
signal dbrk2_low_value : STD_LOGIC;
signal dbrk3_high_value : STD_LOGIC;
signal dbrk3_low_value : STD_LOGIC;
signal internal_trigger_state_0 : STD_LOGIC;
signal internal_trigger_state_1 : STD_LOGIC;
signal take_action_any_break : STD_LOGIC;
signal trigger_state : STD_LOGIC;
signal xbrk0_value : STD_LOGIC_VECTOR (31 DOWNTO 0);
signal xbrk1_value : STD_LOGIC_VECTOR (31 DOWNTO 0);
signal xbrk2_value : STD_LOGIC_VECTOR (31 DOWNTO 0);
signal xbrk3_value : STD_LOGIC_VECTOR (31 DOWNTO 0);
attribute ALTERA_ATTRIBUTE : string;
attribute ALTERA_ATTRIBUTE of break_readreg : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,R101""";
attribute ALTERA_ATTRIBUTE of trigbrktype : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,R101""";
attribute ALTERA_ATTRIBUTE of xbrk_ctrl0 : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,R101""";
attribute ALTERA_ATTRIBUTE of xbrk_ctrl1 : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,R101""";
attribute ALTERA_ATTRIBUTE of xbrk_ctrl2 : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,R101""";
attribute ALTERA_ATTRIBUTE of xbrk_ctrl3 : signal is "SUPPRESS_DA_RULE_INTERNAL=""D101,R101""";
begin
break_a_wpr <= jdo(35 DOWNTO 32);
break_a_wpr_high_bits <= break_a_wpr(3 DOWNTO 2);
break_a_wpr_low_bits <= break_a_wpr(1 DOWNTO 0);
break_b_rr <= jdo(33 DOWNTO 32);
break_c_rr <= jdo(33 DOWNTO 32);
take_action_any_break <= (take_action_break_a OR take_action_break_b) OR take_action_break_c;
process (clk, jrst_n)
begin
if jrst_n = '0' then
xbrk_ctrl0 <= std_logic_vector'("00000000");
xbrk_ctrl1 <= std_logic_vector'("00000000");
xbrk_ctrl2 <= std_logic_vector'("00000000");
xbrk_ctrl3 <= std_logic_vector'("00000000");
trigbrktype <= std_logic'('0');
elsif clk'event and clk = '1' then
if std_logic'(take_action_any_break) = '1' then
trigbrktype <= std_logic'('0');
elsif std_logic'(dbrk_break) = '1' then
trigbrktype <= std_logic'('1');
end if;
if std_logic'(take_action_break_b) = '1' then
if ((break_b_rr = std_logic_vector'("00"))) AND ((std_logic_vector'("00000000000000000000000000000000")>=std_logic_vector'("00000000000000000000000000000001"))) then
xbrk_ctrl0(0) <= jdo(27);
xbrk_ctrl0(1) <= jdo(28);
xbrk_ctrl0(2) <= jdo(29);
xbrk_ctrl0(3) <= jdo(30);
xbrk_ctrl0(4) <= jdo(21);
xbrk_ctrl0(5) <= jdo(20);
xbrk_ctrl0(6) <= jdo(19);
xbrk_ctrl0(7) <= jdo(18);
end if;
if ((break_b_rr = std_logic_vector'("01"))) AND ((std_logic_vector'("00000000000000000000000000000000")>=std_logic_vector'("00000000000000000000000000000010"))) then
xbrk_ctrl1(0) <= jdo(27);
xbrk_ctrl1(1) <= jdo(28);
xbrk_ctrl1(2) <= jdo(29);
xbrk_ctrl1(3) <= jdo(30);
xbrk_ctrl1(4) <= jdo(21);
xbrk_ctrl1(5) <= jdo(20);
xbrk_ctrl1(6) <= jdo(19);
xbrk_ctrl1(7) <= jdo(18);
end if;
if ((break_b_rr = std_logic_vector'("10"))) AND ((std_logic_vector'("00000000000000000000000000000000")>=std_logic_vector'("00000000000000000000000000000011"))) then
xbrk_ctrl2(0) <= jdo(27);
xbrk_ctrl2(1) <= jdo(28);
xbrk_ctrl2(2) <= jdo(29);
xbrk_ctrl2(3) <= jdo(30);
xbrk_ctrl2(4) <= jdo(21);
xbrk_ctrl2(5) <= jdo(20);
xbrk_ctrl2(6) <= jdo(19);
xbrk_ctrl2(7) <= jdo(18);
end if;
if ((break_b_rr = std_logic_vector'("11"))) AND ((std_logic_vector'("00000000000000000000000000000000")>=std_logic_vector'("00000000000000000000000000000100"))) then
xbrk_ctrl3(0) <= jdo(27);
xbrk_ctrl3(1) <= jdo(28);
xbrk_ctrl3(2) <= jdo(29);
xbrk_ctrl3(3) <= jdo(30);
xbrk_ctrl3(4) <= jdo(21);
xbrk_ctrl3(5) <= jdo(20);
xbrk_ctrl3(6) <= jdo(19);
xbrk_ctrl3(7) <= jdo(18);
end if;
end if;
end if;
end process;
dbrk_hit0_latch <= std_logic'('0');
dbrk0_low_value <= std_logic'('0');
dbrk0_high_value <= std_logic'('0');
dbrk_hit1_latch <= std_logic'('0');
dbrk1_low_value <= std_logic'('0');
dbrk1_high_value <= std_logic'('0');
dbrk_hit2_latch <= std_logic'('0');
dbrk2_low_value <= std_logic'('0');
dbrk2_high_value <= std_logic'('0');
dbrk_hit3_latch <= std_logic'('0');
dbrk3_low_value <= std_logic'('0');
dbrk3_high_value <= std_logic'('0');
xbrk0_value <= std_logic_vector'("00000000000000000000000000000000");
xbrk1_value <= std_logic_vector'("00000000000000000000000000000000");
xbrk2_value <= std_logic_vector'("00000000000000000000000000000000");
xbrk3_value <= std_logic_vector'("00000000000000000000000000000000");
process (clk, jrst_n)
begin
if jrst_n = '0' then
break_readreg <= std_logic_vector'("00000000000000000000000000000000");
elsif clk'event and clk = '1' then
if std_logic'(take_action_any_break) = '1' then
break_readreg <= jdo(31 DOWNTO 0);
elsif std_logic'(take_no_action_break_a) = '1' then
case break_a_wpr_high_bits is
when std_logic_vector'("00") =>
case break_a_wpr_low_bits is -- synthesis full_case
when std_logic_vector'("00") =>
break_readreg <= xbrk0_value;
-- when std_logic_vector'("00")
when std_logic_vector'("01") =>
break_readreg <= xbrk1_value;
-- when std_logic_vector'("01")
when std_logic_vector'("10") =>
break_readreg <= xbrk2_value;
-- when std_logic_vector'("10")
when std_logic_vector'("11") =>
break_readreg <= xbrk3_value;
-- when std_logic_vector'("11")
when others =>
-- when others
end case; -- break_a_wpr_low_bits
-- when std_logic_vector'("00")
when std_logic_vector'("01") =>
break_readreg <= std_logic_vector'("00000000000000000000000000000000");
-- when std_logic_vector'("01")
when std_logic_vector'("10") =>
case break_a_wpr_low_bits is -- synthesis full_case
when std_logic_vector'("00") =>
break_readreg <= std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(dbrk0_low_value));
-- when std_logic_vector'("00")
when std_logic_vector'("01") =>
break_readreg <= std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(dbrk1_low_value));
-- when std_logic_vector'("01")
when std_logic_vector'("10") =>
break_readreg <= std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(dbrk2_low_value));
-- when std_logic_vector'("10")
when std_logic_vector'("11") =>
break_readreg <= std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(dbrk3_low_value));
-- when std_logic_vector'("11")
when others =>
-- when others
end case; -- break_a_wpr_low_bits
-- when std_logic_vector'("10")
when std_logic_vector'("11") =>
case break_a_wpr_low_bits is -- synthesis full_case
when std_logic_vector'("00") =>
break_readreg <= std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(dbrk0_high_value));
-- when std_logic_vector'("00")
when std_logic_vector'("01") =>
break_readreg <= std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(dbrk1_high_value));
-- when std_logic_vector'("01")
when std_logic_vector'("10") =>
break_readreg <= std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(dbrk2_high_value));
-- when std_logic_vector'("10")
when std_logic_vector'("11") =>
break_readreg <= std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(dbrk3_high_value));
-- when std_logic_vector'("11")
when others =>
-- when others
end case; -- break_a_wpr_low_bits
-- when std_logic_vector'("11")
when others =>
-- when others
end case; -- break_a_wpr_high_bits
elsif std_logic'(take_no_action_break_b) = '1' then
break_readreg <= jdo(31 DOWNTO 0);
elsif std_logic'(take_no_action_break_c) = '1' then
break_readreg <= jdo(31 DOWNTO 0);
end if;
end if;
end process;
process (clk, reset_n)
begin
if reset_n = '0' then