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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [socsim_plugin/] [irqctrl.h] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2016 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      Interrupt controller functional model.
6
 */
7
 
8
#ifndef __DEBUGGER_SOCSIM_PLUGIN_IRQCTRL_H__
9
#define __DEBUGGER_SOCSIM_PLUGIN_IRQCTRL_H__
10
 
11
#include "iclass.h"
12
#include "iservice.h"
13
#include "coreservices/imemop.h"
14
#include "coreservices/iwire.h"
15
#include "coreservices/icpuriscv.h"
16
 
17
namespace debugger {
18
 
19
class IrqController : public IService,
20
                      public IMemoryOperation,
21
                      public IWire {
22
public:
23
    IrqController(const char *name);
24
    ~IrqController();
25
 
26
    /** IService interface */
27
    virtual void postinitService();
28
 
29
    /** IMemoryOperation */
30
    virtual void b_transport(Axi4TransactionType *payload);
31
 
32
    virtual uint64_t getBaseAddress() {
33
        return baseAddress_.to_uint64();
34
    }
35
    virtual uint64_t getLength() {
36
        return length_.to_uint64();
37
    }
38
 
39
    /** IWire */
40
    virtual void raiseLine(int idx);
41
    virtual void lowerLine() {}
42
    virtual void setLevel(bool level) {}
43
 
44
private:
45
    AttributeType baseAddress_;
46
    AttributeType length_;
47
    AttributeType mipi_;
48
    AttributeType irqTotal_;
49
    AttributeType cpu_;
50
    ICpuRiscV *icpu_;
51
 
52
    struct irqctrl_map {
53
        uint32_t irq_mask;      // 0x00: [RW] 1=disable; 0=enable
54
        uint32_t irq_pending;   // 0x04: [RW]
55
        uint32_t irq_clear;     // 0x08: [WO]
56
        uint32_t irq_rise;      // 0x0c: [WO]
57
        uint64_t isr_table;     // 0x10: [RW]
58
        uint64_t dbg_cause;     // 0x18: [RW]
59
        uint64_t dbg_epc;       // 0x20: [RW]
60
        uint32_t irq_lock;      // 0x28: [RW]
61
        uint32_t irq_cause_idx; // 0x2c: [RW]
62
    } regs_;
63
    uint32_t irq_wait_unlock;
64
};
65
 
66
DECLARE_CLASS(IrqController)
67
 
68
}  // namespace debugger
69
 
70
#endif  // __DEBUGGER_SOCSIM_PLUGIN_IRQCTRL_H__

powered by: WebSVN 2.1.0

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