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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [socsim_plugin/] [gpio.h] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2016 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      GPIO functional model.
6
 */
7
 
8
#ifndef __DEBUGGER_SOCSIM_PLUGIN_GPIO_H__
9
#define __DEBUGGER_SOCSIM_PLUGIN_GPIO_H__
10
 
11
#include "iclass.h"
12
#include "iservice.h"
13
#include "coreservices/imemop.h"
14
#include "coreservices/iwire.h"
15
 
16
namespace debugger {
17
 
18
class GPIO : public IService,
19
             public IMemoryOperation,
20
             public IWire {
21
public:
22
    GPIO(const char *name);
23
    ~GPIO();
24
 
25
    /** IService interface */
26
    virtual void postinitService();
27
 
28
    /** IMemoryOperation */
29
    virtual ETransStatus b_transport(Axi4TransactionType *trans);
30
 
31
    /** IWire interface */
32
    virtual void raiseLine() {}
33
    virtual void lowerLine() {}
34
    virtual void setLevel(bool level) {}
35
    virtual bool getLevel() { return 0; }
36
 
37
private:
38
    AttributeType dip_;
39
 
40
    struct gpio_map {
41
        volatile uint32_t led;
42
        volatile uint32_t dip;
43
        volatile uint32_t reg2;
44
        volatile uint32_t reg3;
45
        volatile uint32_t led_period;
46
        volatile uint32_t reg5;
47
        volatile uint32_t reg6;
48
    } regs_;
49
};
50
 
51
DECLARE_CLASS(GPIO)
52
 
53
}  // namespace debugger
54
 
55
#endif  // __DEBUGGER_SOCSIM_PLUGIN_GPIO_H__

powered by: WebSVN 2.1.0

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