OpenCores
URL https://opencores.org/ocsvn/rtf65002/rtf65002/trunk

Subversion Repositories rtf65002

[/] [rtf65002/] [trunk/] [rtl/] [verilog/] [byte_iy.v] - Blame information for rev 16

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 robfinch
// ============================================================================
2
//        __
3
//   \\__/ o\    (C) 2013  Robert Finch, Stratford
4
//    \  __ /    All rights reserved.
5
//     \/_//     robfinch<remove>@opencores.org
6
//       ||
7
//
8
// This source file is free software: you can redistribute it and/or modify 
9
// it under the terms of the GNU Lesser General Public License as published 
10
// by the Free Software Foundation, either version 3 of the License, or     
11
// (at your option) any later version.                                      
12
//                                                                          
13
// This source file is distributed in the hope that it will be useful,      
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
16
// GNU General Public License for more details.                             
17
//                                                                          
18
// You should have received a copy of the GNU General Public License        
19
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
20
//                                                                          
21
// ============================================================================
22
//
23 5 robfinch
// Indirect Y addressing mode eg. LDA ($12),y
24
BYTE_IY1:
25
        if (unCachedData) begin
26
                cyc_o <= 1'b1;
27
                stb_o <= 1'b1;
28
                sel_o <= 4'hf;
29
                adr_o <= {radr,2'b00};
30
                state <= BYTE_IY2;
31
        end
32
        else if (dhit) begin
33
                ia[7:0] <= rdat8;
34
                radr <= radr34p1[33:2];
35
                radr2LSB <= radr34p1[1:0];
36
                state <= BYTE_IY3;
37
        end
38
        else
39
                dmiss <= `TRUE;
40
BYTE_IY2:
41
        if (ack_i) begin
42
                cyc_o <= 1'b0;
43
                stb_o <= 1'b0;
44
                sel_o <= 4'h0;
45
                adr_o <= 34'h0;
46
                ia[7:0] <= dati;
47
                radr <= radr34p1[33:2];
48
                radr2LSB <= radr34p1[1:0];
49
                state <= BYTE_IY3;
50
        end
51
BYTE_IY3:
52
        if (unCachedData) begin
53
                cyc_o <= 1'b1;
54
                stb_o <= 1'b1;
55
                sel_o <= 4'hf;
56
                adr_o <= {radr,2'b00};
57
                state <= BYTE_IY4;
58
        end
59
        else if (dhit) begin
60
                ia[15:8] <= rdat8;
61
                ia[31:16] <= 16'h0000;
62
                radr <= radr34p1[33:2];
63
                radr2LSB <= radr34p1[1:0];
64
                state <= BYTE_IY5;
65
        end
66
        else
67
                dmiss <= `TRUE;
68
BYTE_IY4:
69
        if (ack_i) begin
70
                cyc_o <= 1'b0;
71
                stb_o <= 1'b0;
72
                sel_o <= 4'h0;
73
                adr_o <= 34'h0;
74
                ia[15:8] <= dati;
75
                ia[31:16] <= 16'h0000;
76
                radr <= radr34p1[33:2];
77
                radr2LSB <= radr34p1[1:0];
78
                state <= BYTE_IY5;
79
        end
80
BYTE_IY5:
81
        begin
82
                radr <= iapy8[31:2];
83
                radr2LSB <= iapy8[1:0];
84
                $display("IY addr: %h", iapy8);
85
                if (ir==`STA_IY) begin
86
                        wadr <= iapy8[31:2];
87
                        wadr2LSB <= iapy8[1:0];
88
                        wdat <= {4{acc8}};
89
                        state <= STORE1;
90
                end
91
                else
92
                        state <= LOAD1;
93
        end
94
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.