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

Subversion Repositories rtf8088

[/] [rtf8088/] [trunk/] [rtl/] [verilog/] [IRET.v] - Blame information for rev 6

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

Line No. Rev Author Line
1 2 robfinch
// ============================================================================
2
//  IRET
3
//  - return from interrupt
4
//
5
//
6
//  2009-2012  Robert Finch
7
//  robfinch@opencores.org
8
//
9
//
10
// This source file is free software: you can redistribute it and/or modify 
11
// it under the terms of the GNU Lesser General Public License as published 
12
// by the Free Software Foundation, either version 3 of the License, or     
13
// (at your option) any later version.                                      
14
//                                                                          
15
// This source file is distributed in the hope that it will be useful,      
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
18
// GNU General Public License for more details.                             
19
//                                                                          
20
// You should have received a copy of the GNU General Public License        
21
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
22
//
23
//
24
//
25
//  Verilog 
26
//
27
//  IRET: return from interrupt
28
//  Fetch cs:ip from stack
29
//  pop ip
30
//  pop cs
31
//  pop flags
32
// ============================================================================
33
//
34
IRET1:
35
        begin
36
                `INITIATE_STACK_POP
37
                state <= IRET2;
38
        end
39
IRET2:
40
        if (ack_i) begin
41
                `PAUSE_STACK_POP
42
                ip[7:0] <= dat_i;
43
                state <= IRET3;
44
        end
45
IRET3:
46
        begin
47
                `CONTINUE_STACK_POP
48
                state <= IRET4;
49
        end
50
IRET4:
51
        if (ack_i) begin
52
                `PAUSE_STACK_POP
53
                ip[15:8] <= dat_i;
54
                state <= IRET5;
55
        end
56
IRET5:
57
        begin
58
                `CONTINUE_STACK_POP
59
                state <= IRET6;
60
        end
61
IRET6:
62
        if (ack_i) begin
63
                `PAUSE_STACK_POP
64
                cs[7:0] <= dat_i;
65
                state <= IRET7;
66
        end
67
IRET7:
68
        begin
69
                `CONTINUE_STACK_POP
70
                state <= IRET8;
71
        end
72
IRET8:
73
        if (ack_i) begin
74
                `PAUSE_STACK_POP
75
                cs[15:8] <= dat_i;
76
                state <= IRET9;
77
        end
78
IRET9:
79
        begin
80
                `CONTINUE_STACK_POP
81
                state <= IRET10;
82
        end
83
IRET10:
84
        if (ack_i) begin
85
                `PAUSE_STACK_POP
86
                cf <= dat_i[0];
87
                pf <= dat_i[2];
88
                af <= dat_i[4];
89
                zf <= dat_i[6];
90
                sf <= dat_i[7];
91
                state <= IRET11;
92
        end
93
IRET11:
94
        begin
95
                `CONTINUE_STACK_POP
96
                state <= IRET12;
97
        end
98
IRET12:
99
        if (ack_i) begin
100
                cyc_type <= `CT_PASSIVE;
101
                sp    <= sp_inc;
102
                lock_o <= 1'b0;
103
                cyc_o <= 1'b0;
104
                stb_o <= 1'b0;
105
                tf <= dat_i[0];
106
                ie <= dat_i[1];
107
                df <= dat_i[2];
108
                vf <= dat_i[3];
109
                state <= IFETCH;
110
        end

powered by: WebSVN 2.1.0

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