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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [socsim_plugin/] [gnss_stub.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      GNSS stub module functional model.
6
 */
7
 
8
#ifndef __DEBUGGER_SOCSIM_PLUGIN_GNSS_STUB_H__
9
#define __DEBUGGER_SOCSIM_PLUGIN_GNSS_STUB_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 GNSSStub : public IService,
21
                 public IMemoryOperation,
22
                 public IClockListener {
23
public:
24
    GNSSStub(const char *name);
25
    ~GNSSStub();
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
    uint64_t OFFSET(void *addr) {
38
        return reinterpret_cast<uint64_t>(addr)
39
             - reinterpret_cast<uint64_t>(&regs_);
40
    }
41
 
42
private:
43
    AttributeType irqctrl_;
44
    AttributeType clksrc_;
45
    IWire *iwire_;
46
    IClock *iclk_;
47
 
48
    typedef struct MiscType {
49
        volatile uint32_t Date;
50
        volatile uint32_t GenericChanCfg;
51
        uint64_t hide[7];
52
    } MiscType;
53
 
54
    typedef struct TimerType {
55
        uint32_t rw_MsLength;
56
        uint32_t r_MsCnt;
57
        int32_t  rw_tow;
58
        int32_t  rw_tod;
59
        uint32_t unused[12];
60
    } TimerType;
61
 
62
    struct gnss_map {
63
        MiscType misc;
64
        TimerType   tmr;
65
        uint64_t noise[8];
66
        uint64_t chan[256*8];
67
    } regs_;
68
};
69
 
70
DECLARE_CLASS(GNSSStub)
71
 
72
}  // namespace debugger
73
 
74
#endif  // __DEBUGGER_SOCSIM_PLUGIN_GNSS_STUB_H__

powered by: WebSVN 2.1.0

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