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

Subversion Repositories rtf65002

[/] [rtf65002/] [trunk/] [rtl/] [verilog/] [load_mac.v] - Blame information for rev 36

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

Line No. Rev Author Line
1 21 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
LOAD_MAC1:
24 30 robfinch
`ifdef SUPPORT_DCACHE
25
        if (unCachedData)
26
`endif
27
        begin
28 21 robfinch
                if (isRMW)
29
                        lock_o <= 1'b1;
30 35 robfinch
                wb_read({radr,2'b00});
31 21 robfinch
                state <= LOAD_MAC2;
32
        end
33 30 robfinch
`ifdef SUPPORT_DCACHE
34 32 robfinch
        else if (dhit)
35
                load_tsk(rdat,rdat8);
36
        else begin
37
                retstate <= LOAD_MAC1;
38
                state <= DCACHE1;
39 21 robfinch
        end
40 30 robfinch
`endif
41 21 robfinch
LOAD_MAC2:
42
        if (ack_i) begin
43 35 robfinch
                wb_nack();
44 32 robfinch
                load_tsk(dat_i,dati);
45 21 robfinch
        end
46 30 robfinch
`ifdef SUPPORT_BERR
47 21 robfinch
        else if (err_i) begin
48
                lock_o <= 1'b0;
49 35 robfinch
                wb_nack();
50
                if (em | isOrb)
51
                        derr_address <= adr_o[31:0];
52
                else
53
                        derr_address <= adr_o[33:2];
54
                intno <= 9'd508;
55 21 robfinch
                state <= BUS_ERROR;
56
        end
57 30 robfinch
`endif
58 32 robfinch
LOAD_MAC3:
59
        begin
60
                // Rt will be zero by the time the IFETCH stage is entered because of
61
                // the decrement below.
62
                if (Rt==4'd1)
63
                        state <= IFETCH;
64
                else begin
65
                        radr <= isp;
66
                        isp <= isp_inc;
67
                        state <= LOAD_MAC1;
68
                end
69
                Rt <= Rt - 4'd1;
70
        end
71
 
72 21 robfinch
RTS1:
73
        begin
74
                pc <= pc + 32'd1;
75 32 robfinch
                state <= BYTE_IFETCH;
76 21 robfinch
        end
77
IY3:
78
        begin
79
                radr <= radr + y;
80
                wadr <= radr + y;
81 32 robfinch
                if (ir9==`ST_IY) begin
82 30 robfinch
                        store_what <= `STW_A;
83 21 robfinch
                        state <= STORE1;
84 30 robfinch
                end
85 36 robfinch
                else if (ir9==`LEA_IY) begin
86
                        res <= radr + y;
87
                        next_state(IFETCH);
88
                end
89 21 robfinch
                else begin
90
                        load_what <= `WORD_310;
91
                        state <= LOAD_MAC1;
92
                end
93
                isIY <= 1'b0;
94
        end
95 30 robfinch
`ifdef SUPPORT_EM8
96 21 robfinch
BYTE_IX5:
97
        begin
98
                radr <= ia[31:2];
99
                radr2LSB <= ia[1:0];
100
                load_what <= `BYTE_70;
101
                state <= LOAD_MAC1;
102
                if (ir[7:0]==`STA_IX || ir[7:0]==`STA_I) begin
103
                        wadr <= ia[31:2];
104
                        wadr2LSB <= ia[1:0];
105 30 robfinch
                        store_what <= `STW_ACC8;
106 21 robfinch
                        state <= STORE1;
107
                end
108
        end
109
BYTE_IY5:
110
        begin
111
                isIY <= `FALSE;
112
                radr <= iapy8[31:2];
113
                radr2LSB <= iapy8[1:0];
114
                $display("IY addr: %h", iapy8);
115
                if (ir[7:0]==`STA_IY) begin
116
                        wadr <= iapy8[31:2];
117
                        wadr2LSB <= iapy8[1:0];
118 30 robfinch
                        store_what <= `STW_ACC8;
119 21 robfinch
                        state <= STORE1;
120
                end
121
                else begin
122
                        load_what <= `BYTE_70;
123
                        state <= LOAD_MAC1;
124
                end
125
        end
126 30 robfinch
`endif

powered by: WebSVN 2.1.0

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