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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [socsim_plugin/] [gptimers.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      General Purpose Timers model.
6
 */
7
 
8
#ifndef __DEBUGGER_SOCSIM_PLUGIN_GPTIMERS_H__
9
#define __DEBUGGER_SOCSIM_PLUGIN_GPTIMERS_H__
10
 
11
#include "iclass.h"
12
#include "iservice.h"
13
#include "coreservices/imemop.h"
14
#include "coreservices/iclklistener.h"
15
#include "coreservices/iclock.h"
16
#include "coreservices/iwire.h"
17
 
18
namespace debugger {
19
 
20
class GPTimers : public IService,
21
                 public IMemoryOperation,
22
                 public IClockListener {
23
public:
24
    GPTimers(const char *name);
25
    ~GPTimers();
26
 
27
    /** IService interface */
28
    virtual void postinitService();
29
 
30
    /** IMemoryOperation */
31
    virtual ETransStatus b_transport(Axi4TransactionType *trans);
32
 
33
    /** IClockListener */
34
    virtual void stepCallback(uint64_t t);
35
 
36
private:
37
    AttributeType irqctrl_;
38
    AttributeType clksrc_;
39
    IWire *iwire_;
40
    IClock *iclk_;
41
 
42
    static const uint32_t TIMER_CONTROL_ENA = 1<<0;
43
    struct gptimers_map {
44
        uint64_t highcnt;
45
        uint32_t pending;
46
        uint32_t rsvr[13];
47
        typedef struct gptimer_type {
48
            volatile uint32_t control;
49
            volatile uint32_t rsv1;
50
            volatile uint64_t cur_value;
51
            volatile uint64_t init_value;
52
        } gptimer_type;
53
        gptimer_type timer[2];
54
    } regs_;
55
 
56
    int dbg_irq_cnt_;
57
};
58
 
59
DECLARE_CLASS(GPTimers)
60
 
61
}  // namespace debugger
62
 
63
#endif  // __DEBUGGER_SOCSIM_PLUGIN_GPTIMERS_H__

powered by: WebSVN 2.1.0

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