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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [common/] [coreservices/] [icpuarm.h] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
/*
2
 *  Copyright 2018 Sergey Khabarov, sergeykhbr@gmail.com
3
 *
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
5
 *  you may not use this file except in compliance with the License.
6
 *  You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *  Unless required by applicable law or agreed to in writing, software
11
 *  distributed under the License is distributed on an "AS IS" BASIS,
12
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *  See the License for the specific language governing permissions and
14
 *  limitations under the License.
15
 */
16
 
17
#ifndef __DEBUGGER_SRC_COMMON_CORESERVICES_ICPUARM_H__
18
#define __DEBUGGER_SRC_COMMON_CORESERVICES_ICPUARM_H__
19
 
20
#include "iface.h"
21
#include <inttypes.h>
22
 
23
namespace debugger {
24
 
25
static const char *const IFACE_CPU_ARM = "ICpuArm";
26
 
27
/** Signal types */
28
//static const int CPU_SIGNAL_RESET   = 0;
29
//static const int CPU_SIGNAL_EXT_IRQ = 1;
30
 
31
enum EInstructionModes {
32
    ARM_mode,
33
    THUMB_mode,
34
    Jazelle_mode,
35
    InstrModes_Total = 4
36
};
37
 
38
enum ECoreModes {
39
    User_mode = 0x10,
40
    FIQ_mode = 0x11,
41
    IRQ_mode = 0x12,
42
    Supervisor_mode = 0x13,
43
    Abort_mode = 0x17,
44
    Undefined_mode = 0x1B,
45
    System_mode = 0x1F,
46
    CoreModes_Total = 32
47
};
48
 
49
class ICpuArm : public IFace {
50
 public:
51
    ICpuArm() : IFace(IFACE_CPU_ARM) {}
52
 
53
    virtual void setInstrMode(EInstructionModes mode) {}
54
    virtual EInstructionModes getInstrMode() { return ARM_mode; }
55
 
56
    /** Zero flag */
57
    virtual uint32_t getZ() = 0;
58
    virtual void setZ(uint32_t z) = 0;
59
 
60
    /** Unsigned higer or same (carry flag) */
61
    virtual uint32_t getC() = 0;
62
    virtual void setC(uint32_t c) = 0;
63
 
64
    /** Negative flag */
65
    virtual uint32_t getN() = 0;
66
    virtual void setN(uint32_t n) = 0;
67
 
68
    /** Overflow flag */
69
    virtual uint32_t getV() = 0;
70
    virtual void setV(uint32_t v) = 0;
71
};
72
 
73
}  // namespace debugger
74
 
75
#endif  // __DEBUGGER_SRC_COMMON_CORESERVICES_ICPUARM_H__

powered by: WebSVN 2.1.0

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