ParaNut SystemC Model
A SystemC Model of the ParaNut architecture
exu_csr.h
Go to the documentation of this file.
1 /*************************************************************************
2 
3  This file is part of the ParaNut project.
4 
5  Copyright (C) 2019-2022 Alexander Bahle <alexander.bahle@hs-augsburg.de>
6  Christian H. Meyer <christian.meyer@hs-augsburg.de>
7  Hochschule Augsburg, University of Applied Sciences
8 
9  Description:
10  This is a SystemC model of a Debug Module compatible with the
11  RISC-V External Debug Support Version 0.13
12 
13  Redistribution and use in source and binary forms, with or without modification,
14  are permitted provided that the following conditions are met:
15 
16  1. Redistributions of source code must retain the above copyright notice, this
17  list of conditions and the following disclaimer.
18 
19  2. Redistributions in binary form must reproduce the above copyright notice,
20  this list of conditions and the following disclaimer in the documentation and/or
21  other materials provided with the distribution.
22 
23  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
27  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34  *************************************************************************/
35 
36 
37 #pragma once
38 
39 #include "paranut-config.h"
40 
41 #define EX_ID_LENGTH 5
42 
43 typedef enum {
51 } EPerfCount;
52 
53 typedef enum {
54  User = 0,
56  Machine = 3,
57 } EPrivMode;
58 
59 typedef enum {
60  off = 0, // All off
61  initial, // None dirty or clean, some on
62  clean, // None dirty, some clean
63  dirty, // Some dirty
64 } EXS;
65 
66 // **************** Exception Codes *************
67 typedef enum {
68  /*** Interrupts: ***/
78 
79  /*** Exceptions: ***/
81  // InstructionAccessFault, // no access faults from IFU
85  // LoadAccessFault, // no access faults from LSU
87  // StoreAccessFault, // no access faults from LSU
88  ECallU = 8,
89  ECallS = 9,
90  // 10 Reserved
91  ECallM = 11,
94  // 14 Reserved
96  // >= 16 Reserved
97  CoPUException = 16
EPrivMode
Definition: exu_csr.h:53
@ Supervisor
Definition: exu_csr.h:55
@ Machine
Definition: exu_csr.h:56
@ User
Definition: exu_csr.h:54
EExceptions
Definition: exu_csr.h:67
@ SupervisorSoftwareInterrupt
Definition: exu_csr.h:70
@ InstructionAddressMisaligned
Definition: exu_csr.h:80
@ ECallM
Definition: exu_csr.h:91
@ MachineSoftwareInterrupt
Definition: exu_csr.h:71
@ ECallU
Definition: exu_csr.h:88
@ ECallS
Definition: exu_csr.h:89
@ SupervisorTimerInterrupt
Definition: exu_csr.h:73
@ Breakpoint
Definition: exu_csr.h:83
@ MachineExternalInterrupt
Definition: exu_csr.h:77
@ InstructionPageFault
Definition: exu_csr.h:92
@ IllegalInstruction
Definition: exu_csr.h:82
@ SupervisorExternalInterrupt
Definition: exu_csr.h:76
@ LoadPageFault
Definition: exu_csr.h:93
@ CoPUException
Definition: exu_csr.h:97
@ MachineTimerInterrupt
Definition: exu_csr.h:74
@ UserSoftwareInterrupt
Definition: exu_csr.h:69
@ UserExternalInterrupt
Definition: exu_csr.h:75
@ StorePageFault
Definition: exu_csr.h:95
@ UserTimerInterrupt
Definition: exu_csr.h:72
@ StoreAddressMisaligned
Definition: exu_csr.h:86
@ LoadAddressMisaligned
Definition: exu_csr.h:84
EXS
Definition: exu_csr.h:59
@ clean
Definition: exu_csr.h:62
@ off
Definition: exu_csr.h:60
@ initial
Definition: exu_csr.h:61
@ dirty
Definition: exu_csr.h:63
EPerfCount
Definition: exu_csr.h:43
@ perfSystem
Definition: exu_csr.h:49
@ perfLoad
Definition: exu_csr.h:46
@ perfStore
Definition: exu_csr.h:47
@ perfJump
Definition: exu_csr.h:48
@ perfInstret
Definition: exu_csr.h:44
@ perfLoadStoreWait
Definition: exu_csr.h:50
@ perfALU
Definition: exu_csr.h:45
Configuration Makros used in most ParaNut files.