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

Subversion Repositories rtf65002

[/] [rtf65002/] [trunk/] [rtl/] [verilog/] [byte_ix.v] - Blame information for rev 10

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 and indirect X addressing mode eg. LDA ($12,x) : (zp)
24
BYTE_IX1:
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_IX2;
31
        end
32
        else if (dhit) begin
33
                radr <= radr34p1[33:2];
34
                radr2LSB <= radr34p1[1:0];
35
                ia[7:0] <= rdat8;
36
                state <= BYTE_IX3;
37
        end
38
        else
39
                dmiss <= `TRUE;
40
BYTE_IX2:
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_IX3;
50
        end
51
BYTE_IX3:
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_IX4;
58
        end
59
        else if (dhit) begin
60
                ia[15:8] <= rdat8;
61
                ia[31:16] <= 16'h0000;
62
                state <= BYTE_IX5;
63
        end
64
        else
65
                dmiss <= `TRUE;
66
BYTE_IX4:
67
        if (ack_i) begin
68
                cyc_o <= 1'b0;
69
                stb_o <= 1'b0;
70
                sel_o <= 4'h0;
71
                adr_o <= 34'h0;
72
                ia[15:8] <= dati;
73
                ia[31:16] <= 16'h0000;
74
                state <= BYTE_IX5;
75
        end
76
BYTE_IX5:
77
        begin
78
                radr <= ia[31:2];
79
                radr2LSB <= ia[1:0];
80
                state <= LOAD1;
81
                if (ir[7:0]==`STA_IX || ir[7:0]==`STA_I) begin
82
                        wadr <= ia[31:2];
83
                        wadr2LSB <= ia[1:0];
84
                        wdat <= {4{acc8}};
85
                        state <= STORE1;
86
                end
87
        end

powered by: WebSVN 2.1.0

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