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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_1_x/] [or1ksim/] [cpu/] [or1k/] [except.h] - Blame information for rev 1768

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

Line No. Rev Author Line
1 33 lampret
/* except.h -- OR1K architecture specific exceptions
2
   Copyright (C) 1999 Damjan Lampret, lampret@opencores.org
3
 
4
This file is part of OpenRISC 1000 Architectural Simulator.
5
 
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
 
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
GNU General Public License for more details.
15
 
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
 
20 437 simons
#ifndef _EXCEPT_H_
21
#define _EXCEPT_H_
22 33 lampret
 
23
/* Define if you want pure virtual machine simulation (no exceptions etc.) */
24 99 lampret
#define ONLY_VIRTUAL_MACHINE 0
25 33 lampret
 
26
/* Definition of OR1K exceptions */
27
 
28
#define EXCEPT_RESET    0x0100
29
#define EXCEPT_BUSERR   0x0200
30
#define EXCEPT_DPF      0x0300
31
#define EXCEPT_IPF      0x0400
32 599 simons
#define EXCEPT_TICK     0x0500
33 33 lampret
#define EXCEPT_ALIGN    0x0600
34
#define EXCEPT_ILLEGAL  0x0700
35 599 simons
#define EXCEPT_INT      0x0800
36 33 lampret
#define EXCEPT_DTLBMISS 0x0900
37
#define EXCEPT_ITLBMISS 0x0a00
38 102 lampret
#define EXCEPT_RANGE    0x0b00
39 33 lampret
#define EXCEPT_SYSCALL  0x0c00
40 137 chris
#define EXCEPT_TRAP     0x0e00
41 33 lampret
 
42 261 markom
/* Non maskable exceptions */
43
#define IS_NME(E) ((E) == EXCEPT_RESET)
44
 
45 33 lampret
#define EXCEPT_NAME(E) E == EXCEPT_RESET ? "Reset" : \
46
                        E == EXCEPT_BUSERR ? "Bus Error" : \
47
                        E == EXCEPT_DPF ? "Data Page Fault" : \
48
                        E == EXCEPT_IPF ? "Insn Page Fault" : \
49 599 simons
                        E == EXCEPT_TICK ? "Tick timer" : \
50 33 lampret
                        E == EXCEPT_ALIGN ? "Alignment" : \
51
                        E == EXCEPT_ILLEGAL ? "Illegal instruction" : \
52 599 simons
                        E == EXCEPT_INT ? "Interrupt" : \
53 33 lampret
                        E == EXCEPT_DTLBMISS ? "Data TLB Miss" : \
54
                        E == EXCEPT_ITLBMISS ? "Insn TLB Miss" : \
55 102 lampret
                        E == EXCEPT_RANGE ? "Range" : \
56 33 lampret
                        E == EXCEPT_SYSCALL ? "System Call" : \
57 137 chris
                        E == EXCEPT_TRAP ? "Trap" : "Unknown"
58
 
59 437 simons
extern struct _pending {
60
  int valid;
61 1350 nogj
  oraddr_t type;
62
  oraddr_t address;
63
  oraddr_t saved;
64 437 simons
} pending;
65 102 lampret
 
66 479 markom
/* Prototypes */
67 1350 nogj
void except_handle(oraddr_t except, oraddr_t ea);
68 479 markom
 
69
/* Actually handles exception */
70 1350 nogj
void except_handle_backend (oraddr_t except, oraddr_t ea, oraddr_t pc_saved);
71 479 markom
 
72
/* Discards all pending exceptions */
73
void clear_pending_exception();
74
 
75 437 simons
#endif

powered by: WebSVN 2.1.0

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