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

Subversion Repositories sardmips

[/] [sardmips/] [trunk/] [source/] [cpu/] [cp0/] [exception.h] - Blame information for rev 18

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 igorloi
#include "systemc.h"
2
#include "../../constants/constants.h"
3
 
4
SC_MODULE(exception)
5
{
6
        sc_in<bool> in_clk;
7
        sc_in<bool> reset;
8
 
9
        sc_in<sc_logic>         m_wb_IBUS;
10
        sc_in<sc_logic>         m_wb_inst_addrl;
11
        sc_in<sc_logic>         m_wb_syscall_exception;
12
        sc_in<sc_logic>         m_wb_illegal_instruction;
13
        sc_in<sc_logic>         m_wb_ovf_excep;
14
        sc_in<sc_logic>         m_wb_DBUS;
15
        sc_in<sc_logic>         m_wb_data_addrl;
16
        sc_in<sc_logic>         m_wb_data_addrs;
17
        sc_in<sc_uint<32> >     m_wb_dataaddr;
18
        sc_in<sc_uint<32> >     m_wb_instaddr;
19
        sc_in<sc_lv<4> >        cp0_inst;
20
 
21
        //**************INTERRUPT****************
22
        sc_in<bool>             m_wb_interrupt_signal;
23
        //sc_out<sc_logic>      interrupt_exception;
24
        //sc_in<sc_uint<32> >   ex_m_instaddr;
25
        sc_signal<sc_logic>     to_SR;
26
        //***************************************       
27
 
28
        sc_out<sc_lv<32> >      cause;
29
        sc_out<bool>    check_excep;
30
        sc_out<sc_uint<32> >    to_EPC;
31
        sc_out<sc_uint<32> >    to_BadVAddr;
32
 
33
 
34
 
35
        void compute_cause();
36
 
37
        void check_for_exception();
38
 
39
        void check_for_interrupt();
40
 
41
        void check_for_Page_fault();
42
 
43
        void save_EPC();
44
 
45
        void handling_status_register();
46
 
47
        SC_CTOR(exception)
48
        {
49
                SC_METHOD(compute_cause);
50
                sensitive << m_wb_IBUS << m_wb_inst_addrl << m_wb_syscall_exception;
51
                sensitive << m_wb_illegal_instruction << m_wb_ovf_excep;
52
                sensitive << m_wb_DBUS << m_wb_data_addrl << m_wb_data_addrs;
53
                sensitive << m_wb_interrupt_signal;
54
 
55
                SC_METHOD(check_for_exception);
56
                sensitive << m_wb_IBUS << m_wb_inst_addrl << m_wb_syscall_exception;
57
                sensitive << m_wb_illegal_instruction << m_wb_ovf_excep;
58
                sensitive << m_wb_DBUS << m_wb_data_addrl << m_wb_data_addrs << m_wb_interrupt_signal;
59
 
60
                SC_METHOD(check_for_interrupt);
61
                //sensitive << interrupt_signal;
62
 
63
                SC_METHOD(check_for_Page_fault);
64
                sensitive << cause << m_wb_instaddr << m_wb_dataaddr;
65
 
66
                SC_METHOD(save_EPC);
67
                sensitive << check_excep;
68
                sensitive << m_wb_instaddr;
69
 
70
                SC_METHOD(handling_status_register);
71
                sensitive << m_wb_interrupt_signal;
72
                sensitive << cp0_inst << reset;
73
        }
74
};

powered by: WebSVN 2.1.0

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