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

Subversion Repositories rtf65002

[/] [rtf65002/] [trunk/] [rtl/] [verilog/] [byte_jsl.v] - Blame information for rev 31

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
BYTE_JSL1:
24
        if (ack_i) begin
25 10 robfinch
                state <= BYTE_JSL2;
26
                retstate <= BYTE_JSL2;
27 5 robfinch
                cyc_o <= 1'b0;
28
                stb_o <= 1'b0;
29
                we_o <= 1'b0;
30
                sel_o <= 4'h0;
31
                if (dhit) begin
32
                        wrsel <= sel_o;
33
                        wr <= 1'b1;
34
                end
35 10 robfinch
                else if (write_allocate) begin
36
                        state <= WAIT_DHIT;
37
                        dmiss <= `TRUE;
38
                end
39 5 robfinch
        end
40 21 robfinch
        else if (err_i) begin
41
                lock_o <= 1'b0;
42
                cyc_o <= 1'b0;
43
                stb_o <= 1'b0;
44
                we_o <= 1'b0;
45
                sel_o <= 4'h0;
46
                dat_o <= 32'h0;
47
                state <= BUS_ERROR;
48
        end
49 5 robfinch
BYTE_JSL2:
50
        begin
51 13 robfinch
                radr <= {spage[31:8],sp[7:2]};
52
                wadr <= {spage[31:8],sp[7:2]};
53 5 robfinch
                radr2LSB <= sp[1:0];
54
                wadr2LSB <= sp[1:0];
55
                wdat <= {4{pcp4[23:16]}};
56
                cyc_o <= 1'b1;
57
                stb_o <= 1'b1;
58
                we_o <= 1'b1;
59
                case(sp[1:0])
60
                2'd0:   sel_o <= 4'b0001;
61
                2'd1:   sel_o <= 4'b0010;
62
                2'd2:   sel_o <= 4'b0100;
63
                2'd3:   sel_o <= 4'b1000;
64
                endcase
65 13 robfinch
                adr_o <= {spage[31:8],sp[7:2],2'b00};
66 5 robfinch
                dat_o <= {4{pcp4[23:16]}};
67
                sp <= sp_dec;
68
                state <= BYTE_JSL3;
69
        end
70
BYTE_JSL3:
71
        if (ack_i) begin
72 10 robfinch
                state <= BYTE_JSL4;
73
                retstate <= BYTE_JSL4;
74 5 robfinch
                cyc_o <= 1'b0;
75
                stb_o <= 1'b0;
76
                we_o <= 1'b0;
77
                sel_o <= 4'h0;
78
                if (dhit) begin
79
                        wrsel <= sel_o;
80
                        wr <= 1'b1;
81
                end
82 10 robfinch
                else if (write_allocate) begin
83
                        state <= WAIT_DHIT;
84
                        dmiss <= `TRUE;
85
                end
86 5 robfinch
        end
87 21 robfinch
        else if (err_i) begin
88
                lock_o <= 1'b0;
89
                cyc_o <= 1'b0;
90
                stb_o <= 1'b0;
91
                we_o <= 1'b0;
92
                sel_o <= 4'h0;
93
                dat_o <= 32'h0;
94
                state <= BUS_ERROR;
95
        end
96 5 robfinch
BYTE_JSL4:
97
        begin
98 13 robfinch
                radr <= {spage[31:8],sp[7:2]};
99
                wadr <= {spage[31:8],sp[7:2]};
100 5 robfinch
                radr2LSB <= sp[1:0];
101
                wadr2LSB <= sp[1:0];
102
                wdat <= {4{pcp4[15:8]}};
103
                cyc_o <= 1'b1;
104
                stb_o <= 1'b1;
105
                we_o <= 1'b1;
106
                case(sp[1:0])
107
                2'd0:   sel_o <= 4'b0001;
108
                2'd1:   sel_o <= 4'b0010;
109
                2'd2:   sel_o <= 4'b0100;
110
                2'd3:   sel_o <= 4'b1000;
111
                endcase
112 13 robfinch
                adr_o <= {spage[31:8],sp[7:2],2'b00};
113 5 robfinch
                dat_o <= {4{pcp4[15:8]}};
114
                sp <= sp_dec;
115
                state <= BYTE_JSL5;
116
        end
117
BYTE_JSL5:
118
        if (ack_i) begin
119 10 robfinch
                state <= BYTE_JSL6;
120
                retstate <= BYTE_JSL6;
121 5 robfinch
                cyc_o <= 1'b0;
122
                stb_o <= 1'b0;
123
                we_o <= 1'b0;
124
                sel_o <= 4'h0;
125
                if (dhit) begin
126
                        wrsel <= sel_o;
127
                        wr <= 1'b1;
128
                end
129 10 robfinch
                else if (write_allocate) begin
130
                        state <= WAIT_DHIT;
131
                        dmiss <= `TRUE;
132
                end
133 5 robfinch
        end
134 21 robfinch
        else if (err_i) begin
135
                lock_o <= 1'b0;
136
                cyc_o <= 1'b0;
137
                stb_o <= 1'b0;
138
                we_o <= 1'b0;
139
                sel_o <= 4'h0;
140
                dat_o <= 32'h0;
141
                state <= BUS_ERROR;
142
        end
143 5 robfinch
BYTE_JSL6:
144
        begin
145 13 robfinch
                radr <= {spage[31:8],sp[7:2]};
146
                wadr <= {spage[31:8],sp[7:2]};
147 5 robfinch
                radr2LSB <= sp[1:0];
148
                wadr2LSB <= sp[1:0];
149
                wdat <= {4{pcp4[7:0]}};
150
                cyc_o <= 1'b1;
151
                stb_o <= 1'b1;
152
                we_o <= 1'b1;
153
                case(sp[1:0])
154
                2'd0:   sel_o <= 4'b0001;
155
                2'd1:   sel_o <= 4'b0010;
156
                2'd2:   sel_o <= 4'b0100;
157
                2'd3:   sel_o <= 4'b1000;
158
                endcase
159 13 robfinch
                adr_o <= {spage[31:8],sp[7:2],2'b00};
160 5 robfinch
                dat_o <= {4{pcp4[7:0]}};
161
                sp <= sp_dec;
162
                state <= BYTE_JSL7;
163
        end
164
BYTE_JSL7:
165
        if (ack_i) begin
166 10 robfinch
                state <= IFETCH;
167
                retstate <= IFETCH;
168 5 robfinch
                cyc_o <= 1'b0;
169
                stb_o <= 1'b0;
170
                we_o <= 1'b0;
171
                sel_o <= 4'h0;
172
                if (dhit) begin
173
                        wrsel <= sel_o;
174
                        wr <= 1'b1;
175
                end
176 10 robfinch
                else if (write_allocate) begin
177
                        state <= WAIT_DHIT;
178
                        dmiss <= `TRUE;
179
                end
180 5 robfinch
                pc <= ir[39:8];
181
        end
182 21 robfinch
        else if (err_i) begin
183
                lock_o <= 1'b0;
184
                cyc_o <= 1'b0;
185
                stb_o <= 1'b0;
186
                we_o <= 1'b0;
187
                sel_o <= 4'h0;
188
                dat_o <= 32'h0;
189
                state <= BUS_ERROR;
190
        end

powered by: WebSVN 2.1.0

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